Next Generation Emulation banner

c++ or Assembly?

2063 Views 25 Replies 11 Participants Last post by  Kraelis
I have always wanted to learn a computer language. So I learnt Visual basic. But it doesn't look as cool as C++ or assembly and I wannt to learn one of them... So I went online looking at c++ and assembly tutorials and I found two things in general: c++ was far easier than assembly which is ofcourse a plus for me but what you can do with assembly is unbelievable, and what you learn about how a computer operates through assembly is also very impressive. On the other hand it is very difficult to learn, not just because of how close it is to computer language but also because of the lack of tutorials floating roundon the internet is far less than c++.

Would it be recommended thta I start learning c++ then move down to assembly from there? Or is learning c++ not really going to aid me in learning assembly and I should just learn that?

Also I would be much obliged if I could get links to free or cheap c++ and assembly compilers (particularly assembly ones) and also some assembly tutorials
1 - 20 of 26 Posts
Assembly is dead. There is no point wasting your time writing your entire programs in ASM. The only use for it now is to speed up programs by embedding it in existing C/C++ code. I suggest you learn C++ first, then learn about the cpu architecture ( you need to understand that if you want to use ASM ) before you move on to inline ASM.

Yours,
-Elly
is it realy dead? Aren't hardware drivers, console emulators, operating systems etc written in assembly?
When I read your topic headline. I thought "Assembly? Are you insane?"

Learning assembly is one of those "nice to have features" but you don't want to program it on a daily basis.

I recommend learning C++ and the libraries so that way you can build applications.
The last applications requiring pure ASM code were games. But with today's compilers which can generate more optimised code, the need to sit days to write pure ASM code instead of finishing the job in 1 day is gone and is considered to be a waste of time. Any application using ASM is using inline like what I said before. Unless you're writing a resource demanding application or trying to learn more about computer architecture, you won't even need to learn ASM IMO.

Yours,
-Elly
I guess you are right. I'll probably learn c++ then learn about computer architecture through asm...

thanks guys :)
Well in fact you still need assembly to write the initial phases of a compiler... but then again that's only if you want to generate a new language, or to improve the existing compiler for a given language... other than that we have to follow the advise of my assembly language course teacher "Now that you have learned the basics of assembly for the x86, do yourselves a favour and never use it again" :p
In computer engineering, assembly is still a de facto standard. Of course, it won't alwys be x86... Programming those darned chips is as close to assembly as you can get.

In games programming, ASM is still used. Take it from a friend of mine who took it up in Full Sail. It's not as widely used, granted, but it's still used when you need to squueze 60 FPS.

Anyway, if you really just want to learn a good language, for heaven's sake, stick with C++ or C. Assembly is nice to know, but shellcode is as much cutting edge in the web as it can get. Try creating an enterprise app with it. I think I lost a few years from my life trying to do basic arithmetic on it on my own. The understanding you gain from learning how a system works at a low level is quite something, but not necessary.

Speaking of which, I finally got around to cracking mod-x level 4 last night :D

But you know what? The mystery and confusion of pointers in C/C++ disappeared completely when I learned Assembly. Everything made sense. :lol:
See less See more
Learning Assembly is still one of the best ways to understand computer architecture from a programmer's perspective. Anyone who seriously wants to be able to analyze performance (and write efficient code) should have some idea of how their computer goes about working on the lowest level, and assembly helps you do that.

Sure you almost won't ever use it in real life, but that doesn't mean you shouldn't learn it.

Other languages I've found to to be useful learning experiences:
  • C (maybe not if you learn assembly...)
  • Java (be sure to try jUnit)
  • Perl (mostly for the regular expressions)
  • Python (lists, tuples, and hashes built into the language?)
  • Scheme (or Common Lisp if one is the pragmatic sort)

EDIT:

@Kraelis: Yeah, quite a few things make more sense in C after learning assembly.
See less See more
Not to mention how useful knowing assembly is for debugging C code. You should learn C++ first, but if you are going to program in C++ then I would highly suggest you pick up assembly down the line. You'd be amazed at how often knowing it comes in handy.
Assembly is still used a lot with emulators - really, all assembly is is machine language with a symbol for each group of 1's and 0's. You can't write an emulator without getting down to that level (unless you're not going to another architecture).

I heartily agree that learning assembly greatly helps your understanding of pointers. In fact, I recommend that you learn C/C++ first, and when you get to pointers, STOP. Start learning assembly. Then after some time with that, go back to pointers. You'll probably never be in the cloud of confusion most people get into when they see pointers. You don't ever have to learn x86 assembly, try a simple 8 bit machine (maybe an intel 8051) so you're not drowning in commands. Alternatively, go a little (not much) harder and grab a Motorolla MC68000. Both are easy to master, and both are widely used and documented.

Programming games in assembly? Probably not a good idea.

Optimizing in assembly? Only if you know exactly where to do so, and have (and know how to use) the tools to locate these choke points. Otherwise, don't waste your time.

Writing an OS kernel in assembly? Hell yeah. Writing an OS kernel in C/C++? Probably not a good idea.

Device drivers? Could actually go either way, depending on the device.

Any computer engineer who doesn't know assembly is not a computer engineer. They are probably just a glorified wannabe computer scientist who has not taken the requisite courses for that profession either.
See less See more
KillerShots said:
You'll probably never be in the cloud of confusion most people get into when they see pointers.
Primarly because you understand fully the concept of memory addresses and the like. :)

KillerShots said:
They are probably just a glorified wannabe computer scientist who has not taken the requisite courses for that profession either.
[/QUOTE]

So if a computer engineer minus assembly is a com sci wannabe (thereby implying lower status), then why is it that Computer Engineers get the title of "Engineer" while Computer Scientists do not? Assembly? :lol:
IF you want to learn something before moving to assembly, I'd suggest C instead of C++ since C++ takes you futher away from the assembly. C/C++ compilers requires a lot of directives to generate good assembly ( it's hard to know which ones you should set if you don't know assembly in the first place ), if you want to write a program that's as fast as possible without using assembly the language to use acctually Fortran.
ChankastRules said:
IF you want to learn something before moving to assembly, I'd suggest C instead of C++ since C++ takes you futher away from the assembly. C/C++ compilers requires a lot of directives to generate good assembly ( it's hard to know which ones you should set if you don't know assembly in the first place ), if you want to write a program that's as fast as possible without using assembly the language to use acctually Fortran.
very true, compilers these days are good, but not perfect, but as he said learn C first, you will find yourself using a lot of C anyway in C++ programming. May i suggest using the tutorial on www.cplusplus.com its really good, got me started!

Once you get to a decent level with C/C++ then think about using assembly as well, but only if you find your programs struggling in places, as i said compilers are good but not perfect, so sometimes you find that hand optimised assembly can be better than the generated code, but in most cases the compiler will make best use of your processor.
so what you are saying is, learn c/c++ and when you get to that degree of killer programming were every little line counts learn assembly?
culubalo said:
so what you are saying is, learn c/c++ and when you get to that degree of killer programming were every little line counts learn assembly?
not really, im saying when you reach a pretty confident level in C/C++ when youve done all you can to speed things up, learning assembly to speed bits up that you cant squeeze anymore out of in C/C++ can help.
I don't only want to learn to program for the sake of programming. I also want to learn to program so I can better understand how computers work (just for a hobby...)
ok then learn to program some stuff in C/C++ so you know what the program does, then try dissassembling it and looking through the code using an assembly guide to take you through it so you can understand what the computer does with the code and why it does it.
hmm, so that can actually be done eh? cool.

anyways I'll start reading tutorials on cplusplus.com and work my way from there...
and when you meen some stuff, to what level of stuff should I be able to do?
Hmm... maybe it's just a crazy idea... but once we had a round table we some doctors from our uni and the students as to which language would make the best option as a first language, and we ended reaching the conclusion with Python. Not only it is inmensely simple and quick to write, (so much that it is there with Visual Basic in RAD), but it also applies the theorics of object oriented programming at a quite nice level, not to mention it is quite easy to learn.

Java came in in a close second though...
1 - 20 of 26 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top