> so why would one need to know assembly?
Curiosity mostly.
Being able to follow the code the compiler generates, and very rarely writing very small snippets works for me.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
A native compiler never compiles to assembly it compiles to machincode (zeros and ones). Assembly language is just a bunch of "mnemonics" so that we can get a grasp at what all those zeros and ones mean. It's interesting and instructive to know what it does, but I would not like fact that from tomorrow on I would have to program in an assembly language. Give me C++, C# or Java!
With C or C++ you can get close to what an assembly language does(if you want to)
Personally I rather like C# for the moment, just for the fact that it releaves me from bothering with basic memory, register, pointer, adressing and other things you have to take into consideration otherwise.
ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
i dabbled in it as part of my CS course and it was good for learning how the computer actually works.
in general though no i dont think its a good starter language.
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
Knowing how the internal combustion engine works doesn't necessarily mean you're a better driver.
I've seen many experienced asm programmers turn out the most abominable C you're ever likely to set eyes on.
> that learning assembly is important because it makes you a more efficient coder?
Speaking from personal experience, I'm not thinking about asm when I'm writing C code.
Picking the right algorithm is what really wins big, not worrying about whether a 'for' loop is 5nS quicker than a 'while' loop.
For example, your carefully crafted bubble sort in asm will still suck.
> so that when you move up to C or C++ you take those skills and learn to be more efficient with your code?
Except you have no control over instruction choice. Good compilers' already know this, so you don't have to.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
> since asm is basically ALL about algorithms?
And every other language isn't?
Algorithms and data structures are abstract, they don't need a programming language in order to understand them, study their efficiency, compare with other algorithms etc.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Programs themselves are algorithms
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601