By using this site, you agree to our Privacy Policy and our Terms of Use. Close
NJ5 said:
JaggedSac said:
NJ5 said:

@JaggedSac: Yeah, that's my point. The optimizations you're talking about are micro-optimizations, which (on high-level languages) require knowledge about what the compiler does to the code (i.e. what low-level code it generates from it). The most important optimizations are done by changing algorithms and other stuff which requires no knowledge of Assembly or compilers.

 

 

No, you just have to read some compiler documentation.  Yes the most important speed comes from algorithms and data structures.  But, all in all, in order to get a good grasp of programming, C is a good start.  But my point is that this is probably the argument that happened when C was first introduced.  Assemblers would say that C is taking care of everything for you and programs are going to get sloppy.  It is the same thing that is happening now and will happen in the future.  Soon only systems programmers are going to really have in depth knowledge of low level functionality, especially as more and more cores are being thrown at you.  Languages that handle threading better are about to become the big thing.  I guess it doesn't really matter at this point in time but soon C will be as niche as assembly.

Maybe, but I think good and versatile programmers will always have some experience with low-level programming. The same way that a good carpenter knows how his tools are made ;)

PS: Yeah, compilers often have guidelines for simple stuff like the one you have shown, but guidelines will only get you so far in doing optimizations. A lot of stuff just can't be put into easy guidelines.

 

Agreed.