[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/g/, how do I convince my retarded programmer friend to use ints
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 18
Thread images: 4
File: 1454506414823.gif (1020 KB, 500x373) Image search: [Google]
1454506414823.gif
1020 KB, 500x373
/g/, how do I convince my retarded programmer friend to use ints by default instead of floats? He literally uses floats for everything because he thinks they're perfect, he even uses floats as iterators in loops

example argument that we have every week:
>dude you need to realize using floats for things that will only correctly be whole numbers is a waste of space
>>space doesn't matter! i'd be saving 5% space at most if i switched from floats to appropriately sized ints/shorts for everything
>floats aren't semantic when all you're trying to express is a whole number of something, it has the possibility to introduce errors
>>but i need to make sure that other people working on the same project are looking at the exact same numbers i am
>what
>>also if i start mixing floats and ints, everything will become a mess and it'll be worse than how it was
>you're such a retard
>>anyway [insert famous developer] uses floats for everything so it must be right

so yeah /g/ how do i convince this retard to use tabs instead of spaces?
>>
File: tumblr_ncvobdO06E1rw29u3o1_500.jpg (94 KB, 500x353) Image search: [Google]
tumblr_ncvobdO06E1rw29u3o1_500.jpg
94 KB, 500x353
>>
>>53593503
Doesn't floats have rounding errors when you divide, multiply, and even add?

If you really want him to see the light, he needs to fuck up first. Give him something that will fuck up if he uses floats.
>>
>>53593503
>open intel optimization book
>show him floats take 5 to 20X the amount of cycles than an integer
If you can write a program he wrote with ints and try to show him its way faster.
If he keeps using floats just unfriend him because hes clinically retarded.
>>
>>53593732
>unfriend
Underageb&.
>>
File: 1446364240723.jpg (29 KB, 500x500) Image search: [Google]
1446364240723.jpg
29 KB, 500x500
>>53593843
>having friends in the first place
>>
Nothing wrong with using floats in for statement if you need to increment/decrement by other than integer.
>>
>>53593503
Why do you care? Did you expect him to see the brilliance of your opinon and fold immediatly?
>>
>>53593503

Ahh the first year of CS is almost over.

I don't think you'll see this friend of yours at the same school next year. I hope he'll enjoy his new art major.
>>
>>53593503
You should explain him that good code is expressive code.
>>
They all get converted to 0s and 1s by the computer anyways, it doesn't matter.
>>
>>53595378
this, JavaScript numbers are floats by default.
>>
he's retarded, abandon all hope
>>
>>53595378
If the compiler/interpreter would automatically determine the appropriate number type, your argument would be valid. Most don't. Any number with more "0s and 1s" (bits) than your hardware is built for (in simple terms, whether it regards a 32- or 64-bit CPU) will take longer for your CPU to handle. Not to mention operations on simple data (ints) are much faster (in most cases) than those on formulaic representations (floats).

>>53595607
See above. JavaScript is designed for retards and shares their speed. Seriously, never use it as an example for a good language, nobody who may be able to teach you something will want to.
>>
I don't have a fucking clue what's going on in this thread but I sincerely wish I did.
>>
File: 1409287927970.png (90 KB, 700x700) Image search: [Google]
1409287927970.png
90 KB, 700x700
>>53593503
>he even uses floats as iterators in loops
>>
>>53596199

1. nice dubs

2. if dude increments by decimals I'd actually get a kek out of this

> for (float f = 0.0; f < 1.0; f+= 0.1)

fucking hilarious
>>
>>53593503
>he even uses floats as iterators in loops
kek'd
Thread replies: 18
Thread images: 4

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.