Am I wrong in thinking computers have more processing power than they have available RAM? When writing a program for computers, is it better to write the program assuming more memory, or more processing capabilities?
When programming there are certain tasks that need to be preformed that need the use of the processor. In many of these cases you can perform this task several times, or you can create a variable to store the information for use several times. You also have HDD limitations as well. Particularly in embedded systems.
That's my problem with these high level languages like C# and JAVA, I have no idea what's going on. They have a pre-built function for almost everything. I could import a library that has a hundred things I don't need to use one function that I could have written myself. How do you know exactly what is going on when you import a library? Where do you draw the line? How do you decide whether to import a library, or build the function yourself? How do you know when it would be better to create a new variable or keep doing the same process over and over?
I have also heard people talk about two functions that perform the same task, but one is better than the other in someway or another. How do you find these things out?
I always try to write my programs with as few variables as possible. Sometimes when I'm in school I get the chance to see other students work. I found that for every ten variables in their assignment, I have one, sometimes less.
I used to work with this guy who when programming PLCs, his goal was to do it in as few rungs as possible. I swear, he would make the program two times more complicated just to eliminate one rung, and I'm talking about fairly simple and short programs too. That's not how he saw it of course...
How do you write your programs, with respect to the above? Obviously, most of use strive for a happy medium somewhere, but which do you tend to lean to? Do you write them to be more memory efficient, more processor efficient, more space efficient, or something else like more code readable?