View Single Post
Old Jun 1st, 2006, 7:03 AM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Generally speaking, a "Hello, World" program teaches you nothing about how programs work (and very little about programming). In C/C++, the source file that you write is subjected to at least three different processes. All preprocessor directives (statements beginning with #) are expanded by the preprocessor. The result of this, plus what you wrote, becomes the material submitted to the compiler. The compiler emits a certain amount of object code which is (usually) incomplete, but forms the nucleus of the program, which usually then needs to be combined with code written by others (library code). "Cout" is not just a word, it's a ton of code YOU didn't write. The linker then takes over and patches all these pieces together with the appropriate addresses. Sometimes (on some systems) this can result in directly executable code. On most machines you encounter in your early days, it results in code that can be placed somewhere in memory by the executive, polished off with actual addresses, and executed. Memory mapping from virtual to physical addresses may play a part, depending upon the system and the OS. All this still leaves a lot up to the coder, who should make at least a cursory study of how things work, as well as learning the syntax of the language and the methodology of programming. All this requires an investment on the part of the would-be programmer. The ability is not gained via osmosis.

Not all languages are compiled. Some are interpreted on the fly and others have an intermediate step involving so-called 'byte code'. Do a certain amount of homework and consider carefully what you want to ask. The results will be much more effective.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote