SanguineumCaelum wrote:
In ECE they actually have discussed optimization but thats low level(MIPS,SPARC,IA32,BASIC), and programming projects for some of those classes stipulate solving a problem in a certain number of instructions, which does directly correlate with efficiency most of the time.
CSC courses you only get direct assistance with code if you cant get it working, no regards to optimizing. If thats the state of the industry i feel a good deal better although real optimization in anything high level is on the list of things i wish i knew.
Instead of learning to "optimize" high-level code, what you'll learn in your CS courses is to select the right algorithm(s) and data structure(s) to solve a problem. This is far more significant than learning to optimize a given piece of code. Analogy: We've been given the task of digging up 100 yards of pipe in a backyard. You decide to "micro-optimize" by practicing with a shovel and increasing your aerobic capacity. You're able to dig at 3x the rate of me. OTOH, I "macro-optimize" and work on techniques for locating the pipe within the yard. On average, I am able to reduce the area dug to less than 10% of the total. [I would also add that I decided to use a back-hoe... but that isn't necessary]
Who will complete the task first? Well, it is going to depend on the yard, right? If it is long and narrow, then you're likely win because you'll be digging faster and in the correct spot. In the best case, you'll finish 3x faster (ie when my search-space reduction techniques don't help). However, if the yard is say 10 acres, my reduction of the "search-space" is much more significant than your fast shovel.
The real-world is full of both types of problems. Sometimes you need to do something fairly straight-forward and simple in a small search space. This might be a good candidate for some "micro-optimizations". Sometimes you'll be working in a large search space like chess or whether a complicated circuit is SAT, these will require "macro-optimizations" and sometimes approximations because the optimum answer would take too long to complete.