Thread: C & V Computers
View Single Post
Old 09-02-20, 02:41 PM
  #36  
Andy_K 
Senior Member
 
Andy_K's Avatar
 
Join Date: Jan 2008
Location: Beaverton, OR
Posts: 14,774

Bikes: Yes

Mentioned: 525 Post(s)
Tagged: 0 Thread(s)
Quoted: 3252 Post(s)
Liked 3,941 Times in 1,460 Posts
Originally Posted by steelbikeguy
For stuff where the processor has to read inputs from the world and respond quickly, assembler isn't too bad. I imagine C is preferred now, although that can be made to be nearly as cryptic.
The received wisdom these days is that for anything that isn't trivial you can't hand code assembly that's faster than what a good compiler will produce. I used to think that was because compiler developers were super geniuses. Then I became a compiler developer and I found out that it's really because compiler developers can spend insane amounts of time optimizing specific patterns. If most developers spent all day trying to eliminate a single instruction from a single function they be told to stop wasting time, but if I do it in the compiler and it makes 500 programs just a little bit faster it's a good bargain.

I like C because you can read it and (usually) know exactly what is going to happen at the processor level. C++ is just as efficient these days and lets you create your own abstractions to write code that says what it means instead of saying what it does. There's a certain beauty to that too.

Have I mentioned that I'm a huge nerd?

__________________
My Bikes
Andy_K is online now