Post things you autisticly practice in your code that helps optimize it and explain why it's better.
I'll start: Using ++i is better than i++ since i++ takes 4-5 steps whereas ++i only takes two and i++ creates a local value that gets thrown away if your compiler is too retarded to optimize it
I always initialize everything to zero first, everywhere
James Rogers
0 == i because you can never do 0 = i
Thomas Gutierrez
You're glowing in the dark pretty hard right now...
Josiah Wilson
>if your compiler is too retarded to optimize it If your compiler is too retarded to optimize i++ then you've got bigger problems than microptimizations of your code.
Christopher Stewart
Hi, any recommendation for good textbook to learn C?
Christopher Nelson
My favorite practice is using a different language that isn't horribly outdated, like python. It really cleans up and optimizes my code.
Carter Perry
i can be a different type, like a class and ++ can be overloaded. so ++ may use a copy, and that might not be optimized
Grayson Perry
God i cant fucking tell if that's the letter O or the number 0. Wouldn't you just want to do if(!i)
I completely feel you. I always make sure to do that whenever I use malloc since it picks fragmented space and doesn't allocate contiguously
>Hi, any recommendation for good textbook to learn C? O'Reilley Web Assembly
>God i cant fucking tell if that's the letter O or the number 0. Wouldn't you just want to do if(!i) Install normal fonts And that was an example, I could write 4 == chan
as well
Aiden Cox
just as a general rule after every free() i set the pointer to NULL
same
just don't be dumb and type the right thing. i have no idea why all of these preventative measures exist for typing, i'm consistent 99% of the time and would rather not make my code look shittier because i can't type
zoomer detected >p-p-python is better you use the best tool for the job, sorry to say but python is slow as molasses. imagine if AAA games were written in python instead of C or C++ lmfao
use a modern compiler. use a modern compiler. use a modern compiler.
wow addressed those issues so easily.
William Roberts
>using raw pointers in C++ >using NULL in C++ for anything other than interfacing with C crap friend...
Adam Gutierrez
You don't get the point of 0 == i; it is simply that you can not assign to a constant, so it's safer to have the constant on the left in a comparison.
Dominic Wood
Lul. But my dudes. Explain please.
Thomas Allen
i get the point you idiot; use a modern compiler. it will warn you when you appear to be assigning in that context.
William Rogers
Well ok, I was thinking that no compiler will give you an error. Warnings are good too but easier to overlook, still a fair point.
Wyatt Sullivan
>warnings are good but easy to overlook if you're developing anything remotely seriously, and it's not a case of "write 10,000 lines of code or your daughter gets it", there is no reason for you to be overlooking warnings unless you've discovered a compiler bug or you're intentionally doing something very weird for a very good reason.
>t. not a real programmer some python libraries do things very well, much more quickly than even many experience C programmers could do
Leo Murphy
I think you're missing the part where c code has to be interpreted into python nigger.
Isaac Turner
>I think you're missing the part where c code has to be interpreted into python nigger. can you give me a basic gestalt?
Ethan Carter
>i++ creates a local value that gets thrown away if your >compiler is too retarded to optimize it compilers stopped being this retarded back in the 80s, this is a complete non problem
Jonathan Lewis
do you realize that time you wasted writing your post is infinitely bigger than processor time you saved using ++i instead of i++?
Hudson Clark
i think you're missing the part where none of that interpetation is visible to you and the libraries are much more accessible than any comparable C libraries >hurr python sucks except for where it doesn't but that isn't "python" according to my arbitrary and convenient definition of "python"
Carter Rodriguez
>optimizes my code
If you really apply yourself you can optimize to go from 100x slower than C++ to 50x slower only.
>pre-ANSI parameter declaration and loop unrolling I'm so glad #pragma unroll exists these days.
Juan Perry
BASED
Connor Flores
>the libraries are much more accessible than any comparable C libraries oh booohoohoo pointers are too hard mommy help me pls
Matthew Green
>what are sequence points
There is literally no reason do the choice between prefix and postfix to be dictated by anything other than semantics. If you really do this to save three machine instructions then you're fucking retarded.
Good luck with the second half of K&R Mr leet haxor, don't give up!
Bentley Gutierrez
*For, not do. Dammit.
Tyler Mitchell
i dont use raw pointers usually but if I need to that's what I do idk why I hate nullptr
Justin Ward
>C/C++ thread >Talk about Python
You Python fags are insufferable. Go be a brainlet somewhere else.
Logan Lopez
That's a great thing to do if you don't know what instruction cache is.
Lucas Sanders
Stop writing C in C++. Your code doesn't even work as intended.