/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?
>>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&.
>>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.
>>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