5

I've been actively programming with assembly but now I'm losing motivation. My productivity is simply ridiculously low compared to what others seem to have with high level languages.

I know I should start using high level languages but I always return to assembly for some reason. How could I get used to higher level languages and finally become productive? I'd really want to master at least one.

0xHenry
  • 289
  • 2
  • 8
  • 3
    What kind of software are you developing? This would help with suggestions for another language. For example if you work on drivers for hardware then C would be a good choice. The other thing we need to know is what kind of platform? – Jeff Jan 17 '11 at 13:06
  • 5
    If can program in assembly, then High Level Language will be a delight: you want to add two numbers? "x = a+b" then you can say **"Look Ma! no registers!"** :P – Darknight Jan 17 '11 at 14:08
  • Do you have anything against interpreted languages, or will you be looking to move into a higher-level compiled language? – Craige Jan 17 '11 at 14:34
  • @Craige, nothing against interpreted languages. Actually I just checked Python and I might give it a go because I don't know it and it would be kind of "a fresh start". – 0xHenry Jan 17 '11 at 20:34

7 Answers7

13

Maybe start with C. C is known for being "closer to the hardware" than other higher level languages, so this would be like dipping your toe in the water to get used to it without jumping in.

Edit:

Another point to note, is that C also allows In-line assembly. So that you can still code in assembly only were it is required.

Darknight
  • 12,209
  • 1
  • 38
  • 58
jmort253
  • 9,317
  • 2
  • 35
  • 63
  • C is a low level language with compare to Java, C#, etc. – Abimaran Kugathasan Jan 17 '11 at 12:11
  • 3
    @Abimaran: And Java, C# are low-level languages compared to languages like Haskell, Lisp, OCaml, Prolog. Forth can be both low- and high-level. – LennyProgrammers Jan 17 '11 at 13:00
  • @Lenny222 : In which ways, I don't heard it before, and I'm little bit familiar with Prolog and Lisp. – Abimaran Kugathasan Jan 17 '11 at 13:59
  • @Abimaran - Correct. This is exactly why I suggested C. The OP is trying to find a middle ground to ease into higher level languages. C is higher level than Assembly but lower level than other higher level languages that are full of abstractions. – jmort253 Jan 17 '11 at 14:18
  • @Lenny222 - http://www.joelonsoftware.com/articles/CollegeAdvice.html is old advice from Joel, but C hasn't changed much over the years. – jmort253 Jan 17 '11 at 14:19
  • @Abimaran: As in declarative vs imperative programming. – LennyProgrammers Jan 17 '11 at 14:53
  • @jmort253: Yes, why not. My point is that "high/low-level" is relative. A shade of grays opposed to black/white. – LennyProgrammers Jan 17 '11 at 14:55
  • As a hardware engineer who only knew assembly in the past, I agree that C would be the best step. – Rob Jan 17 '11 at 15:32
  • Does the inline assembly matter except in rare cases where you have to squeeze everything out of some hot loop doing something unusual? –  Jan 17 '11 at 21:13
2

Pick a language and then follow the 11 step plan.

Overall, a high level language will provide you with a lot of productivity simply because it provides such a high level of abstraction. This allows you to leverage the work of others in a more efficient manner than you're likely to find in the lower level languages.

The downside of this is that you apparently sacrifice runtime performance to gain developer productivity (see Ruby as an example). However, in these days of extremely powerful machines that argument is almost entirely invalid. I'll allow certain extreme edge cases (high frequency trading algorithms, massively parallel supercomputing architectures etc) to remain since they don't represent the usual applications that developers encounter.

Having the low-level language knowledge will be extremely helpful to you in the high-level language domain because you'll be much more careful about selecting the appropriate storage mechanism for the data you'll be working with. Knowing your hardware is an important requirement for developers.

Gary
  • 24,420
  • 9
  • 63
  • 108
1

I suggest you give Ruby a shot. It is one of the popular languages, that has gotten the furthest away from the machine. I find it highly enjoyable and the book I linked proved a very good introduction.

High level languages are often frowned upon and some people claim, you should start with low level languages and work your way up.
I am quite convinced, you should do this the other way round. Low level languages teach you how computers work. They teach you to provide solutions expressed in a way they actually work in the computer.
High level languages deal with far more abstract concepts, trying to be closer to human thought patterns. Thus they allow you to focus on modelling a given problem and creating simple, elegant solutions.
A problem is defined in terms of constraints and abstracting those away, that are given by the hardware results in reducing the problem to its actual essence.

I am saying this, because when I first started with higher languages, it took me a while to wrap my head around many popular concepts. I tried to understand them in terms of what I had learnt before. But when I looked at them from the opposite side, they seemed quite natural. So if you start with a high language, try not to classify everything you learn in terms of what you know. Consider this a fresh start.

At some point, you will realize, that you need to get beneath the present level of abstraction (usually because you lack control or speed or both). This is the right place to use the knowledge you have from low level languages.

back2dos
  • 29,980
  • 3
  • 73
  • 114
  • Though I have no real evidence to support it, I believe beings he is moving up from Assembly, he is likely looking for a compiled language. This is really just a guess though. – Craige Jan 17 '11 at 14:33
  • 1
    @Craige: There are currently five production-ready Ruby implementations. Four of those have a compiler. There are another two that are likely to be released in 2011. Both of those have a compiler. And there's another four or so currently in development. All of *those* have a compiler. There isn't any widely accepted definition of the word "compiled language" (in fact, that word doesn't even make *sense*, since compilation is a trait of an execution engine, not a language), but I can't think of any definition you can come up with that doesn't include Ruby. – Jörg W Mittag Jan 17 '11 at 15:06
  • I was not aware that Ruby offered ahead-of-time compilation. Also, perhaps the meaning of 'compiled language' has been skewed in recent years due to the popularity of interpreted and JIT compiled languages, but to me 'compiled language' has always meant 'compiled to machine code' – Craige Jan 17 '11 at 19:33
  • @Craige: Is Java a compiled language then? – back2dos Jan 17 '11 at 20:39
  • @back2dos - technically, no; Java is interpreted. While there is some compilation done to byte-code, if an app has to sit on top of a runtime/interpreter, it is not completely compiled. See also: http://java.sun.com/docs/white/langenv/Intro.doc2.html#528 – Craige Jan 17 '11 at 21:34
  • @Craige: Java bytecode can be run on hardware (http://tinyurl.com/66uovc) and can be crosscompiled to native machine code (http://gcc.gnu.org/java/). Java can be compiled to JavaScript using GWT which can be JITted to machine code when executed on the V8 (http://tinyurl.com/66yvddq), that you could retain. There's probably many other ways to run Java without a software interpreter and there's little reason, why this shouldn't be working with other languages. The definition 'compiled' is actually quite blurry, because it has become rather outdated. – back2dos Jan 17 '11 at 23:28
  • @back2dos - Very interesting reading in those links. I would have to say I stand corrected on the Java statement considering that Java can be compiled to native machine code. – Craige Jan 18 '11 at 01:34
  • @Craige: Ruby *doesn't* offer ahead-of-time compilation. Ruby is a programming language. Programming languages don't offer compilation, compilers do. As I said, there are several implementations of Ruby. Some offer interpretation, some dynamic runtime compilation, some static ahead-of-time compilation, some offer both interpretation and dynamic compilation, some offer interpretation and dynamic compilation and static compilation. Just like every other programming language, by the way. For example, there are interpreters for C and compilers for Python, PHP, ECMAScript, Smalltalk. – Jörg W Mittag Jan 26 '11 at 14:27
  • @Craige: the meaning of "compiled language" hasn't been skewed, because that term doesn't *have* a meaning. It doesn't make sense. If English were a typed language, it would be a type error. Saying that Java is an interpreted language or C is a compiled language is more than *wrong*, because merely being wrong would imply that the term makes sense. Compilation and interpretation are traits of execution engines not languages. A language is a set of abstract mathematical rules. A language isn't compiled or interpreted. A language just *is*. Every language can be implemented by an interpreter, – Jörg W Mittag Jan 26 '11 at 14:33
  • ... a compiler, both, or anything in between. And most languages *are*. There are compilers that compile Java source to (optimized) Java source, Java source to native, Java source to ECMAScript, Java source to C source, Java source to CIL bytecode, Java source to JVM bytecode, JVM bytecode to Java source, JVM bytecode to CIL bytecode, JVM bytecode to native. Some JVMs interpret JVM bytecode, some compile it to native code, most interpret it a couple of times and then compile it using profiling information gathered during interpretation. There's a C compiler which compiles C to Perl, Lua, Lisp. – Jörg W Mittag Jan 26 '11 at 14:36
  • ... There's a C interpreter. (Several, actually.) Using the second Futamura Projection, you can even automatically transform an intepreter into a compiler. And none of this has absolutely anything to do with the language. Whether a language implementation uses an interpreter, a compiler, or prints out the instructions and sends them to China to be hand-evaluated in a labor camp is a private, internal implementation detail of that particular language implementation and has absolutely nothing whatsoever to do with the language. Heck, there are even languages which have never been implemented! – Jörg W Mittag Jan 26 '11 at 14:40
0

Comparing your productivity on assembly versus a higher level language is like comparing a roller and a corner paintbrush. They are very different purposes. Assembly should not typically be used whenever a higher language is available.

Not sure what your main draw to assembly is, but I know the lower the language the more I dislike it because you have to repeat more mundane coding. With a higher level language you can actually focus on solving the problem at hand instead of spending your time adding values together. I would suggest you start learning something like Python, Ruby or Java and even if it seems strange at first go ahead and push through. I think once you get a better understanding of what you can do in a higher level language your desire for assembly will stop.

jzd
  • 4,166
  • 25
  • 28
0

I have picked up a few Higher level languages in the last few years and found it slightly irritating initially because things were very complicated and difficult to read, since I was used to sequential code that was very much like a mathematical proof. After continually pushing myself things have clicked and the concepts which make higher level languages now seem intuitive and things have become very easy to understand. I strongly recommend the tutorials for java provided by Oracle as they dont ask you to trust them on unsupported concepts (ie. introducing a concept whilst talking about another and saying "don't worry about that til later") for the most part they restrict the scope of things. That being said accepting things on faith is annoying but critical for many types of learning.

0

I would recommend Ruby for a few reasons. First, it's my Weapon of Choice, so I'm completely biased towards Ruby as a language. Second, Ruby has very consistent syntax, it was designed according to "the principle of least surprise". I have found it, by and large, to be free of surprises. Third, you can write procedural, step by step code in Ruby if you want to, and gradually get comfortable working in different ways. I think this is one of the strongest selling points of Ruby: it's a very deep language with a very shallow learning curve.

philosodad
  • 1,775
  • 10
  • 14
-1

First learn a language like C or C++ that will really help you in learning some high level language and work as a bridge between assembly and language like C# If you are interested in Microsoft technology

Fraz Sundal
  • 769
  • 5
  • 14
  • Please Leave a comment for down vote? – Fraz Sundal Jan 17 '11 at 15:34
  • 2
    I didn't downvote, but I'd suspect it was because the answer had nothing to do with the OP's specific problem, and provided no reasons. What about C# would make it a natural transition from assembly? – David Thornley Jan 17 '11 at 16:16
  • Not my downvote, but why would one punish himself with C# when he can learn a more Microsoftless language like C? –  Jan 17 '11 at 18:40
  • 2
    It was my down-vote, and it was indeed because your answer did not answer the ops specific question. Especially before your edit - it was simply a statement of the language you preferred. – Craige Jan 17 '11 at 19:21