views:

2060

answers:

21

I know this might seem like a duplicate post... but precisely what I am trying to compare here is the developers getting driven by zeal to create great web apps and profitable apps... to the spirit of the retro

In the noise of web development, functional programming etc, the old art of Assembly programming, reverse engineering etc seems fading out. While earlier it used to be cool to write small and fast codes using assembly, now its more cool to learn javascript, php, ruby etc and do nice experiments with people and the web.

Somehow the question still remains in my mind, will learning assembly be fruitful? I still find it cool to be able to reverse engineer apps after learning asm,,, but will this help me in the long run of pursuing a career as a developer?

Apart from embedded systems What about jobs in Antivirus firms? will assembly/rev engg. be very essential to get into AV work?

Apart from that, whats better approach to improve asm skills--

1) getting down to details of the system I use and start programming according to my machine's architecture/os

2) use simulators... (mention some good ones please)

3) or should one try BrainF*ck to practice mind boggling puzzles of doing simple operations.. :P

+3  A: 

As just a developer, learning Assembly language may not be a very good investment for you. If you're looking at a career in enterprise programming (ie. Java Applications, .NET applications, Web applications), Assembly probably isn't for you.

However, if you are going into engineering (particularly Electrical or Computer), then, yes, you should learn it. If you're not going to bother with embedded devices, Assembly isn't for you.

apandit
Do compilers write themself? What about OSs? Antivirus software, which by the way was mentioned in the question, isn't an embedded device and ABSOLUTELY requires understanding assembly.
NoMoreZealots
+7  A: 

Core understanding of the machine and how it works is always benefical. I wouldn't worry about becoming an expert ASM developer, but some decompiling, reverse engineering, and simple tool development is always "good knowledge".

You don't have to read Aristotle to understand Eco, but it helps.

Tom Carr
you mean even a knowledge of core computer architecture is good enough... right?
Abhishek Mishra
I'd say that you'd have to read a heck of a lot more than just Aristotle to understand Eco. That guy draws on the entire canon of western thought -- plus some.
chris
+2  A: 

I have to give the standard statistical answer...it depends.

Do you plan a career working with driver level or hardware level development? If yes, then I woulds absolutely you need to learn assembly.

If you are interested in a deeper understanding of how software works with hardware, then again I say yes learn assembly.

If you want an exercise in breaking down a programming problem into very small steps, then again, I say yes learn assembly language.

If you are doing web or database development, probably no so much :-)

My $0.02 worth

Kwondri
He did mention things other than Webdevelopment.
NoMoreZealots
+4  A: 

Unless you get into reverse-engineering, kernel development, compiler development, or certain bits of embedded dev then it's unlikely it's going to help your career a lot. That said, I strongly, strongly suggest learning assembly for your architecture of choice at least. It's like Lisp -- it's not terribly useful directly but the concepts you take away from it will make you a much better developer.

Cody Brocious
What concepts can only be learned via assembly?
Chris Lively
Assembly will give you a VERY concrete understanding of the stackframe. Some higher level language books will talk about it, but in assembly you will see actually what happens. Task swapping typically doesn't have any eqivalant notation in programming languages (it's usually a in a libary/OS call not the language specification), but understanding the register map and how to store the processor state is conceptually clear in assembly.
NoMoreZealots
+1  A: 

It really depends on the path you take.

If you like working with resource limited embedded devices then assembly will be your friend.

However, if your career is going to take you into the corporate world then assembly is a waste of time.

Chris Lively
I don't believe there's any developer that will come away from learning assembly without learning valuable information. Even if you're a corporate coder, it WILL make you a better developer. Calling it a waste of time is incredibly short-sighted IMO.
Cody Brocious
err... whats the expansion of IMO?what about EMO ? and whats IMHO ?
Abhishek Mishra
IMO -- In my opinionIMHO -- In my humble opinionEMO -- not an acronym I'm familiar with
Cody Brocious
Really? How about an example? What could assembly possibly teach them that can't be learned using high level languages like java, c#, or c++?
Chris Lively
There are SO questions that address that
Artelius
IBM and Microsoft aren't valid corporations? What about Intel, I mean they WRITE compilers, and OSs. And as far as "Embedded Computing", I've heard quote that went something like: "The PC revolution was the 80s and early 90s, the 90s was the web revolution, the future is the pervasive computing revolution." Which basically means computers EVERYWHERE including your freaking Wheaties.
NoMoreZealots
+17  A: 

Yes.

High-level languages are very well and fine, but knowing what is going on under the covers is very important. Even in a world dominated by C# and Java, being able to understand the individual instructions (in IL or JVM bytecodes) and understanding how and why they work can give you insights into what's gone wrong with your application and how to fix it.

It's also valuable to learn different debuggers (such as gdb and WinDbg) sooner rather than later, so that you don't have to learn them while you're trying to chase down the root cause of a crashing bug. Know your tools and how to use them.

Stephen Deken
Learning Java assembly code is not as hard-core as real assembly, but funtions in a similar way and I imagine would be an easier thing to learn. I think there are tools for stepping through java assembly code as you're working with it, and that would be a good place to start.
Jon
Besides, C# and Java only dominate certain market segments.
NoMoreZealots
+1  A: 

Learning assembly for your platform of choice will help you understand what goes on behind the scenes in your applications. It will give you a better understanding of things like the pipeline and cache. It is also a fun skill to list on a resume, especially for moderately obscure platforms.

Sparr
+1  A: 

The question is duplicated with this one!

m_pGladiator
It's simalar, I wouldn't say it was the same. He provides considerably more context for the question.
NoMoreZealots
+1  A: 

If you are using C or C++, then yes, I think knowing how things work will benefit you. Otherwise, it's probably not worth the effort.

Michael Myers
I was trying not to make any assumptions; the part about antivirus software was apparently added after I posted this.
Michael Myers
+8  A: 

Yes, but not because you will ever write code in assembly.

You do it for the same reason you should study philosophy -- It will make you a better thinker. Assembly will make you understand what is going on beneath the covers, and make you a better programmer.

You don't even need a real assembly language. There are plenty of simulators out there that can teach you the ideas involved.

There are several Little Man Computer applets on the web that can get you started, then you can look at either x86 or Mips flavours.

chris
+1  A: 

If you are a .NET developer there is a lot you can gain from learning to program in IL (the assembly language for the CLR). The tools for doing so ship with .NET itself (ilasm, ildasm etc...) and there are lots of good articles and books on the subject (e.g. CIL Programming: Under the Hood of .NET - by Jason Bock)

Garth Gilmour
hmmm this sounds something new n cool to me :)
Abhishek Mishra
+1  A: 

I would say, use the right tool for the right job. There definitely will be cases where Assembly language will still be required, but I think most parts of modern software development is focused on higher-level-languages, simply because you need tools to cope with evolving complexity. If you think you will ever be towards hardware-near development, I'd say yes, go for Assembly.

Learning a language out of curiosity is a nice thing and it will never hurt to know a language.

Martin C.
+2  A: 

While assembly isn't required in most high level development, different variations are still in use. As an example the company Zilog which produces the Z-80 chip is still churning out chips to be used in embedded devices. Most of these utilize Z80 Assembly to actually add functionality to these embedded devices.

Also, at a lower level, I think it helps to gain more understanding of the underlying technologies.

To answer the question, it probably won't be very helpful to learn in most cases. If you will be doing maintaining web based applications, you won't be seeing much asm level or machine code, since everything is so extracted from the hardware level in today's programming. Though, if you ever plan in getting into more of the computer science industry, or doing things like embedded chip programming, then learning Assembly might be a bit more useful.

I've done programming with MASM and with Z80 Assembly and A86/D86 back in the day, just because I have had a passion in such things. And just for fun, created simple .NET applications with a hex editor using straight IL.

stephenbayer
The debugger is your friend. Understanding assembly helps things make sense with regard to variable scope and the stackframe. Even if you are only doing desktop development.
NoMoreZealots
+2  A: 

The basics of assembly is often vital for debugging, especially for C/C++ developement.

Aardvark
I wouldn't say "often", "sometimes" seems closer to the truth. But it will often help you with debugging!
Ludvig A Norin
Like programs "sometimes" use stackframes? Pretty every C program I've written used the stack to pass variables. That's the sort of basic concept that is made painfully clear in assembly.
NoMoreZealots
+5  A: 

If you enjoy learning it you should. You will always be better off knowing something than not knowing it, so take the chance to learn anything when it catches your attention, and makes you go "wow, cool!". You'll never regret it, because it gets harder every year ;-)

Ludvig A Norin
exactly. well said. i feel i should have born a little before so that i would have been developed a my computer dos utility like win 3.1 (mimicking) more effeciently than what i did after completing college. i still wanted to write a protected mode dos 32bit program but started dealing with windows and web.
Jayapal Chandran
+2  A: 

Every programmer should know how a CPU works. Assembly programming is the basic art. Once you have done assembly programming you can do any other programming language. So yes: learn it. It makes you a better software engineer. It will give you an fundamental insight in what can and what cannot be done with a computer.

Frans
Bravo, Assembly is required for fundamental computer science topics such as OS design and compiler design.
NoMoreZealots
+3  A: 

Yes - once you know assembly then you know how the machine really works. It probably won't get you a better job, you probably won't ever use it professionally - but the understanding that you derive from that knowledge will make you a better programmer.

Simon Knights
Microsoft? IBM? Intel? You wouldn't consider working for one of them a "better job?"
NoMoreZealots
+10  A: 

but will this help me in the long run of pursuing a career as a developer?

As a primary skill, I would say no because you typically won't see assembly on a job description for a web developer. However, it will have side-benefits by knowing the basics of assembly, like registers, stacks, arithmetic, etc. Being knowledgeable of the underlying technology in your environment can't hurt you.

If you enjoyed assembler, you may consider it a career path since someone has to do it; low supply, high demand could give you a very lucrative opportunity! :)

If your question's underlying meaning was how to make yourself a marketable web-developer, I would say you should look into:

  • Object-Orientation
  • Data Structures (Arrays, Linked Lists) and Algorithms (Big O notation)
  • Relational Database concepts (Normalization, Foreign Keys)
  • Scripting - i.e. Perl, Python and know how to use regular expressions. good tool in the toolbox to have

Without knowing your technology 'stack', like WAMP, LAMP, Java, or .NET, I would suggest that you google for your environment and keywords like interview questions, resume, hired, or even check the job boards for skills employers are seeking.

Also note that there are many popular bloggers that try to summarize what a good programmer should know, examples: Steve Yegge or Joel Spolsky

Tony R
"If your question's underlying meaning was how to make yourself a marketable web-developer," that WASN'T his question.
NoMoreZealots
+2  A: 

If you're going to get a job doing java or c# then no, don't bother with assembly. If you're going to do anything even slightly low level, its worth learning some simpler assembly just so you can understand what's going on way deep down. It makes you appreciate things like "x++" actually compiling down to a 2 cycle instruction.

stu
"Byte code" = Mythical CPU Machine Code
NoMoreZealots
A: 

Well, I'm not some expert to the extent that you should really weigh my suggestions but the general idea that I'm getting from all of the info that I've taken input is that:

If if makes you feel great that you know so deep about the working of Programs with Hardware then You, and for me, I should learn Assembly [ I've already started it in my home myself apart from my Varsity courses].

If it's about jobs then be practical is the best code to understand why you should not learn it and waste time on it. But I think if you have some time then it's still no harm as no knowledge ever goes to waste.

And finally, from a totally impractical side, every CS student in my opinion should try everything that lies before them. C'mon, what's left in our lives except these? We should grab all that we can of this beautiful world of Codes and Wires.

"If it's about jobs then be practical is the best code to understand why you should not learn it and waste time on it." -- So you are saying assembly language has no practical applications and the computer industry as a whole is done developing both compilers and Operating Systems?
NoMoreZealots
+3  A: 

Learning is never a unfruitful effort. If you consider X86 has instructions to count leading zeros, calculate a 32bit CRC, instruction to let you specifically control the "rounding mode" from floating point to integer. Then there are definitely common cases for using these instructions. The rounding one alone can save alot extra math that would be done to do the equivalant in C. And a CRC is a non trival function that has applications in everything from network protocols to file formats. Leading zeros is a useful way to approximate a log based 2 function, and typically when I used the log base 2 function all I was trying to do was calculate the bit size and had to round it anyway.

Assembly can be the shortest answer to certain problems, and C code to do things like counting leading zeros or calculating a CRC is significantly more complex than issueing a single instruction to do the same thing.

Also you indicate other applications BESIDES WEB DEVELOPMENT, (For all those folks who keep saying you don't need it for web development, please read the question.) OS development, Linux Kernel Hacking, Driver Development, Bootloaders, and Compiler Design definitely have need of ASM coders. Apart from that, GPU code is very size/speed critical and has practical "ASM" like programming concerns, IBM's Cell processors used in Blade servers for high performance computing and simulation work could use hand coded assembly better than most systems. Library development is typically something where you want an optimal solution so the end user (programmer) doesn't need to worry about those details so again some assembly may be required.

As far as learning Assembly, get a book such as the "Art of Assembly." One of the exercises you could do once you have a handle on the basics is to write C functions, and then try to implement the same functions using assembly, compare the compiled results to the hand coded version to see where you could optimize your code. Most compilers will give you a "don't delete generated assembly" type option so you can retain the file. You can also start with compiler generated assembly and make modifications from there to attempt to improve performance or perform operations which are not easily represented in C. The point being looking at assembly and working out how it corresponds to your C code will aid in your understanding.

One clear example of assembly that has no C construct to represent it is an atomic operations such as "test and set" operation, used for mutitasking primitive such as semaphores. And before someone says "but I can do that from C," there maybe library calls to do so, or compiler extentions/processor intrincics, but at some level someone has to put assembly code down on paper (or monitor in this case) to perform these operations.

NoMoreZealots