Is Assembly Programming Still Relevant, Today? 676
intelinsight asks: "Consider the following question given the current software development needs, and also the claims of the Assembly lovers for it being a language that gives one insights of the internal working of a computer. How relevant or useful is it to learn Assembly programming language in the current era? "
Yes. (Score:3, Insightful)
Re: (Score:2, Insightful)
Re:Yes. (Score:5, Interesting)
(For the ignorant, it takes two string pointers and copies the second one to the end of the first one; this requires zipping all the way from the start to the end of the first string to find where said end is. It then helpfully returns the pointer to the beginning of the first string, the very parameter you passed in. Never mind that the new end of the first string would be very handy for the next strcat to that same string.)
This programmer is generally good at what he does, but the idea that strcat is woefully inefficient is not obvious to him. Even after explaining it to him, yes he will avoid it, but he does not really understand why. He, and far too many other programmers, measure their program's "speed" in lines of code. Sure, they know that a subroutine call has to count those subroutine lines of codes as well, but they simply have no concept of the fact that some operations take longer than others, that there are better ways of doing simple things.
I think every beginning programmer should have to spend a semester on some funky old z80, for instance, all in assembler, debugging in machine language, before they can call themselves a good programmer. The idea is not to get them skilled in z80s, but to give them a basic idea of how computers work.
It's the equivalent of learning to drive a stick shift car without understand why there are gears at all. If you are ignorant of the very basics of internal combustion engines and can't understand the dangers of lugging or redlining an engine and the importance of using the right RPM, you will never be a good driver. It matters not whether you ever drive a stick in real life, it's just a matter of knowing how to handle your equipment.
Re:Yes. (Score:5, Insightful)
as in your example, too many people code like the only platform is the multi-GHz PC.
even a year doing tools in Graphing calculator basic will teach appreciation for not wasting cycles doing everything the lazy way, 'cause sure, you usiung strcat doesn't slow the system in a noticable way, but when half the processes running are using it, and using it in "hotspots" suddenly you need a new machine because it's just not fast enough.
Re:Yes. (Score:5, Insightful)
here is a side scroller i made written all in assembly (includes animated screen shot)
http://www.ticalc.org/archives/files/fileinfo/232
The things I learned:
1. 4mhz processor is REALLY fast!
2. How the stack works.
3. How absolute and relative jumps work.
4. How to create "objects" and implement "methods"
5. How the smallest variable, the register works.
I have to say that after making games in assembly, I am actually disappointed in how well the current consoles handle them. I would expect them to be able to crazy things with the hardware they are given. That is also why I am interested in the ps3, it forces programmers to understand the underlying hardware.
Re: (Score:3, Interesting)
Out of curiosity (i'm not trying to troll here), what about the PS3 makes programmers understand the hardware better than they need to understand the 360 or Wii hardware? I know they have the Cell Processor,
Re: (Score:3, Interesting)
Re: (Score:3, Informative)
Just have your friend write a strcat() himself using C, and he'll learn where/why its inefficient. (Or he won't and he's just dense.) Either way knowledge of assembler or lack thereof isn't the issue.
It's the equivalent of learning to drive a stick shift
Efficiency sometimes irrelevant (Score:5, Insightful)
This is particularly true for programs that
Re:Yes. (Score:5, Insightful)
Programming in a high-level language is more like doing basic maintenance on said car. You definitely need to know something about how the car works, and the more you know, the more work you can do on that car yourself. Programming in assembly is sort of like taking the engine out and repairing or modding it. You may never need or want to do that, but knowing how an engine works on a detailed level can help you diagnose and remedy things that don't actually require going to those lengths. Similarly, knowing how a microprocessor works can help you understand more about what you're doing when you program in a high-level language.
It also gets you into a mindset where you're thinking about this sort of thing, which is why assembly should still be required teaching in an undergraduate computer science curriculum.
Re: (Score:3, Insightful)
No, they can't.
In the current Standings [recmath.org] for Al Zimmerman's programming contest, you see a lot of entries that have many submissions, but aren't even close to the optimal result. Even on the smallest scale, the slowest of code would go through all 20 trillion possible cominbations - the next smallest is an order of magnitude larger, and anything larger is within don't-even-bother territory.
And yet, there's a person who has effect
Re:Yes. (Score:4, Insightful)
It's also handy for sanity checking when a quick calculation shows that your algorithm which works fine for n=10 will take something in the order of three years to complete for n=1000.
Re: (Score:3, Insightful)
Re: (Score:3, Insightful)
Re:Yes. (Score:5, Insightful)
But if you're going to program in Groovy then you should know Java and perhaps JVM IL. If you're going to program in C then you should know assembly. If you're programming in assembly then you should know about how CPUs will reorder your instructions etc. If you're building a CPU, then you'd better know physics.
I really don't think that if you're writing an app in Rails/Javascript/SQL you are going to achieve any performance or debugging benefits by understanding assembly language. It's just knee-jerk to say that every programmer, no matter what they do day-to-day should be knowledgeable about assembly. The same effort expended learning about the layer UNDER your development environment would have a much better payoff. E.g. a Javascript programmer reading the Firefox source code (or at least benchmarking FireFox and IE on important operations). With each level deeper you go, you achieve quickly diminishing returns.
Isn't it the root of all programming languages?? (Score:5, Insightful)
Unless your compiler emits C (Score:3, Interesting)
Re: (Score:3, Informative)
Re:Isn't it the root of all programming languages? (Score:5, Insightful)
Re: (Score:2)
Re:Isn't it the root of all programming languages? (Score:3, Interesting)
Now, if you were to ask "isn't knowledge of assembly language for a given microprocessor required to create a compiler capable of directly generating native code?" then the answer would be yes, because all the other possibilities have been excluded. Alternatively, if you asked "isn't q
You should not learn it.. (Score:5, Insightful)
Please continue to treat both computers and the tools you use to program as magic black boxes.
That way old dogs like me will still have a job.
Re: (Score:3, Insightful)
Anything else, is just-- pshaw... Black boxing it.
Re:You should not learn it.. (Score:5, Insightful)
Re: (Score:3, Interesting)
Well, when I was a wee lad taking 6.251 from Donovan & Madnick at MIT, they threw an IBM Assembler H manual at us and wished us good luck on the first programming task (in two weeks).
So suck it up and RTFM. Although, to be fair, the Assembler H manual is probably one of the finest computer manuals ever written, so it wasn't as bad as it sounds.
Re:You should not learn it.. (Score:4, Insightful)
Assembly _programming_? (Score:2)
Re:Assembly _programming_? (Score:5, Insightful)
That's a pretty fine line there. If you can understand asm well enough to debug such issues, I would argue that you also probably know enough to write it, or at least very nearly so.
I would say that you need to know how to program in assembly language, though it doesn't really matter much which ISA you use---MIPS, x86, PPC, ARM, whatever. What matters is the ability to understand what's really happening at a low level so that you don't do stupid things in high level code that cause your machine to have a seizure.
For example, once you understand that your CPU only has a limited number of registers, you'll understand why (on some CPU architectures) it is a good idea to limit the number of function arguments so that they can be passed via registers, and that you should put the arguments that you are most likely to use at the beginning of your prototype so that they have the best chance of already being in a register.
Re: (Score:2)
I like that example at the end, by the way. Very neatly sums up the good things about understanding low-level function.
Re: (Score:3, Interesting)
I spent 6 months recently working for a company that programmed mainly in C++ and visual basic (I'm a mac programmer, so I was a fish out of water there, which is ultimately why I left...) But the developers there didn't / couldn't / wouldn't understand assembler in any way shape or form. Without the high level debugger, they
Re:How to get started? (Score:5, Informative)
My take on how to learn x86 ASM (Score:5, Informative)
Re: (Score:3, Informative)
Windows doesn't have a flat memory model? Are you on crack, or are you running Windows 3.1?
Madness.
Re: (Score:3, Informative)
Stay the HELL away from old 16-bit code in any form. It's ugly. It's obsolete. It's just not worth your time. Of course, using the 16-bit registers is fine when they're the appropriate tools for the job, but seriously, any tutorial that mentions segmentation? Just say no. You'll thank me for this later.
I teach Assembly Language Programming, and for that reason I refuse to teach it on x86 because most available books are using 16-bit (DOS/BIOS based) x86 code. Unfortunately learning 32-bit x86 is a much bigger jump (conceptually) for newbies, I'm not sure it can be done in one semester to students who never had Assembly exposure before.
Ideally, I'd like to use ARM as the reference assembly language for teaching. It's reasonably clean, and has a sufficiently large code base (i.e., PDAs, embedded systems
easy as 1 2 3 (Score:4, Funny)
Re: (Score:2)
Re:easy as 1 2 3 (Score:4, Interesting)
Granted, PICs are much MUCH simpler than anything running a modern OS -- but learning assembler, even on a simple device like a PIC, does teach a lot about how hardware and software integrate. Also, it's kind of cool to know that (for example) exactly 1,000,000 clock cycles after the program starts up, it will be calling *this* instruction, which moves the value in the accumulator to *that* register.
I can't be the only one out there who finds this extremely refreshing after taking a course in Java (and learning about font objects, GridBagLayouts, and other things so far removed from "real" programming that they might as well call it a Fine Arts course), can I?
Anyway, I wasn't really looking forward to learning Assembler -- until I got started and saw how powerful, elegant, and just plain beautiful it really is.
PICs are cool toys -- 5MIPS ain't much compared to the latest and greatest Intel and AMD have to offer -- but when you consider that they'll run for days (weeks? months?) on a CR2032 cell, and cost under a buck apiece, they're very impressive. (Freescale MCUs, too -- although I don't yet know those quite as well.)
Depends on what you want or need to do ... (Score:2)
On the other hand I find myself needing to break into assembly once or twice a month - but I do embedded systems of one type or another
For most programmers, no. (Score:5, Insightful)
Re:For most programmers, no. (Score:5, Insightful)
I don't think that's the case. It really depends on what you want to do. Typical desktop applications don't need any assembly language, nor in-depth knowledge of how the CPU works. In fact, it's probably a bad thing to worry about things like this — premature optimisation being the root of all evil and all that. You don't want to put a lot of work into making your application 1% faster and then realise you've ruined your portability.
In fact, these days, there's a case for even doing away with languages like C for a lot of desktop applications. With the speed of today's computers, if you can write your application quicker in a scripting language, it's a worthwhile trade-off for many organisations.
Sure, if you want to work with operating systems or things like games where performance is critical, then knowing assembly will make you a better developer even if you don't end up using it. But most of the software industry is working at a level far higher than that, and if you are at that level and making your decisions based on what instructions the CPU is getting, then you're probably doing a worse job than somebody who is entirely ignorant of assembly.
Depends on what you mean by a good programmer (Score:4, Insightful)
Look at FFMpeg (Score:2)
ASM code is also especially important if you are programming for a more limited platform, such as a GBA or Nintendo DS. ASM code can often be four times the speed of C code.
Re: (Score:2)
Also, look at linear algebra libraries. They also use these short-vector instructions deep within the kernels. T
Why bother? Just ... (Score:4, Funny)
Yes (Score:5, Informative)
If you know DSP, are adept with fixed point arithmetic, know a bunch of fun tricks [hackersdelight.org], can schedule well... there are many people who would like to hire you. Including the group I work in.
Simply, compilers cannot produce code of the same quality that great hand coders can produce code, especially for complex embedded devices like DSPs. But it's not enough to know how to write assembly, you need to know all the tricks the compiler knows, all the tricks you can play with the algorithm, and all the ways in which you can tinker with the code to fit it nicely into the architecture.
Those things are still highly valueable; people need to get really optimized code for their media players. If you can squeeze 20% out of your MP3 decoder, you can get 20% lower energy usage on your programmable logic.
Re: (Score:2)
So when do I start?
Honestly... (Score:3, Insightful)
Also, a lot of embedded work is still done in assembly because with a lot of low-level industrial work having very precise clock-counts on everything is very important.
Re: (Score:3, Informative)
i'm a novice coder and people constantly bitch about how hard pointers are, so when i read what they actually are(this was quite a few years ago) I went back a few times thinking i must have missed something "....surely there is more to it than that...." i thought to myself.
Answer to "What's hard about pointers?"... (Score:5, Insightful)
There are people who cannot grasp the difference between "a thing" and "a respresentation of a thing". In fact, there was an entire century where almost the entire school of French philosophers were unable to grasp that there was a difference.
For pointers, it comes down to realizing that a pointer to memory is not the memory, it's a representation, and the real memory lives somewhere else: at the dereference of the pointer. And at that location it takes up real space. And so does the representation (but it's comparatively tiny).
The ability to make this disctinction comes naturally when you've written assembly code of any complexity, since you've had to manage the memory yourself. But if you've never done that, or, worse, you've only ever programmed in languages which eschew pointers and try to pretend that their own internal implementations don't use them, even if they won't let you use them, well, then, you've got a conceptual problem. An that conceptual problem is going to be very hard for you to overcome.
It also makes it very, very hard for someone to understand row-major vs. column major languages, or how you would link a program in one against a library in another, and be able to usefully communicate your data between the two. Or it makes it hard to understand the difference between "call by value" and "call by reference.
If I'm interviewing someone, and it becomes clear that they need a "code interview" because some things don't add up between their banter and their resume, the first thing I whip out is a pointer problem.
-- Terry
Re: (Score:3, Informative)
I hate to think of pointers as a "representation" of something. (Disclaimer : I'm a C and ARM ASM coder) When I learnt Pascal I thought that to call it a "representation" was utterly confusing. Just call it an address, because that's what a pointer is, it's as simple as that, it's an address, it's so simple.
Very relavent (Score:5, Insightful)
I would not encourage universities to start pumping out CS graduates who have never seen assembly laguage, and don't expect it to phased out of the average Electrical Engineering curriculum any time soon.
Frankly, I don't think it's a very good question. It's sort of like saying, "Given that we now have calculators and computer algebra systems that will do the math for us, is it really worth it to waste students' time learning the nuts and bolts of mathematics?" It has been my (limited) experience in software engineering that knowing how something works on a deeper level will almost always be an asset, and at the worst have no effect at all.
Re: (Score:3, Funny)
Glad I did (Score:5, Interesting)
I've worked with people with very focused high-level programming skills and found that while they could write mostly decent code, their code was also most likely to fail in production since they were completely mentally removed from concepts like disk-seek times or bandwidth constraints. Programmers with a deeper understanding of what actually happened when their code ran tended to make wiser programming choices.
Two main programmer mindsets (Score:3, Insightful)
I'm not a great programmer, but I've always had a good "sense" (for lack of a better word) about technical things. I worked a bit at a company doing mid to high level (V)FoxPro programming. They put me on the least desi
Not quite dead... I'm getting better (Score:5, Interesting)
Another question, would assembly be more popular if it wasn't such a nightmare to write for Intel's x86 architecture? If we all had nice Motorolla PCs, would assembly be really cool?
Erk (Score:3, Funny)
Now I'm picturing something like Alfred Hitchcock's The Birds, only with ZX81s.
Let's make this an ad hoc poll!!!!! (Score:2)
Yes, assembly rocks.
No, assembly is stupid, old and out-dated.
I married assembly, you insensitive clod.
WIPO: (for example, I like to wipe asses with assembly.)
Yes (Score:5, Insightful)
In other words, yes, there are good reasons for knowing assembly. Whether or not you'll actually use it is another matter entirely. Just depends on what you're working on.
Actually I wouldn't be surprised if in about 10-15 years assembly programmers are in higher demand since none of the CS schools these days ever teach assembly anymore.
Definitely (Score:2, Interesting)
Of course it's relevant. (Score:2, Insightful)
How do compilers know what to compile to? Magic? Imagine if all the assembly programmers died: who'd maintain & update compilers, embedded devices, many realtime instruments, etc. ?
Why do you need to ask? (Score:2)
YES! (Score:5, Informative)
- You can't write a compiler
- You can't debug C/C++ programs
- You don't really know why buffer overflows are bad
- You don't really understand memory management and what the heap and stack really are
- You don't really know why threads are different than processes
- You can't write a device driver
- You don't know any computer architecture at any depth that matters
- You won't ever understand garbage collection
- You don't know how your CPU works
- You won't think the movies with "hacking" in them are as funny as the rest of us do.
If not being able to do those things doesn't bother you, by all means, don't learn assembly.
The thing is, in order to be a really good programmer, you have to know how the machine works, all the way down. Once you do, you can pick up any language very easily, because you know what they're trying to do and how.
Just learn it. It's really one of the simplest languages to learn. Realize it's not a programming language, but simply the actual machine code represented by mnemonics. So you'll have to learn an architecture. Intel 386 is a great place to start, and it couldn't be easier than on Linux. You have a flat, protected memory model, GNU "as" is likely already installed, and you make system calls using interrupt 0x80 after setting up the arguments.
You should be printing stuff to the screen within minutes, and interfacing with C object files in hours. You can write the GTK "hello world" program in a combination of C and assembly fairly easily.
Get to work.
Re:YES! (Score:5, Informative)
So you'll have to learn an architecture. Intel 386 is a great place to start...
Choke. Cough. Laugh. Thanks a lot, now I have to clean soda off my keyboard.
While the rest of your comment is pretty much spot on, this advice is, frankly, absurd. x86 has one of the most convoluted, non-orthogonal, legacy-laden instruction sets and list of constraints of any architecture, ever. Introducing someone to assembly programming via x86 is sure to warp their brain, and will certainly send the vast majority of people running away, never to revisit the idea. You might as well recommend Malbolge, Intercal, Brainf*ck, or Befunge to them -- it'll result in the same reaction.
If you want to introduce yourself to assembly language programming, start with something sane and simple. To that end, you can't get much simpler than the Motorola 6800 family of processors. Then, step up to something with a richer instruction set, such as the Motorola 68000 family. After having a good grasp of those a person will have correctly oriented their brain to take on more complex but sane architectures, such as MIPS or Alpha. For a challenge after that point, I'd highly recommend IA64 (i.e. Itanium) -- which introduces some really complex ideas, but implements those ideas in a sane and consistent manner. It might be worth learning a DSP processor assembly language (such as the TI TMS320 series) before IA64, to get a handle on concerns regarding explicit parallelism.
Only after learning a number of well-designed instruction sets and architectures such as those should you even consider exposing yourself to x86 and (most likely) the PC architecture. At that point you'll have built up enough intellectual rigor in your approach to assembly programming to survive in the Lovecraftian realm of programming for this architecture. If you're lucky, you'll realize just how truly terrible the instruction set and system architecture are, and avoid programming in x86 assembly whenever possible.
Seriously, I'd even recommend IBM 360 mainframe assembly ahead of x86 for an initial learning experience. Please don't start with x86, it will rot your brain.
Brent
P.S. Yes. I have programmed and/or debugged programs in every assembly language mentioned above. x86 rates dead last.
Re: (Score:3, Insightful)
Many different ways.
Using an emulator of a legacy machine would be one way. You could also use evaluation kits for various microcontrollers ('51, ARM, PIC, AVR, whatever suits you best). They have the added bonus that you're running on actual hardware. You could also try a processor simulator, which comes with many uC/DSP development kits.
Say I would learn 68000 Assembler, would that knowledge be much useful when switching to x86?
Yes, because you have already m
Re: (Score:3, Informative)
The C Conspiracy (Score:4, Insightful)
Seriously, assembly is important for all the reasons you noted, but also for some others. If you know assembly, the chances are:
All software engineering, computer science and programming courses should start by requiring people to program a non-trivial application on an ARM processor, or something with an equally limited instruction set, in pure assembly. Why? Because then you get people who think, who program with care and forethought, who think of bloat not in terms of adding more RAM, but in terms of opportunities for bugs, glitches and gremlins. Sure, you'll get more dropouts. The computing world doesn't need more code monkeys, so it's no loss if they did. Who needs a society of half-baked, semi-literate coders?
This is not elitism, because I'm not saying that anyone should be excluded from the profession. I don't think they should. What I do think is that society needs to make damn sure that the typical coder isn't the worst coder, which is what you get if people are trained to NOT think but to let the computer do the thinking for them. Windows may act like a HAL-9000 at times, but trust me, it isn't remotely capable of anything resembling thought. A bad design or a poor implementation will not be rectified by some magical intelligence in the machine, because there isn't any.
Do you want to be a *good* programmer? (Score:2)
In general, does any programmer need to know low level details of the technologies they use given that they have high level libraries and abstractions to work with? The answer,
Very Helpfull I think (Score:2)
Also this year we've been learning VHDL those of us who worked hard l
It is relevant... (Score:2)
It you take pride in your skills and want to refine them, lear one asse
One thing... (Score:3, Informative)
I strongly recommend checking out asmutils [sourceforge.net] if you want examples of asm programs that actually do something useful. Some of these (such as ls and the basic httpd) are less than 1k in size.
You might also be interested in Menuet [menuetos.net], which is an entire (small) OS including GUI written completely in either 32 or 64 bit asm.
learn it well enough to read (Score:2, Interesting)
So, I would definitely recommend at least being acquainted enough with assembly so that you can semi understand a listing.
Ownage (Score:2)
See Reflections on Trusting Trust [acm.org]. It should be required reading of every programmer.
It's a pity about the Lisp Machines... (Score:3, Interesting)
Yes, in some lines of work (Score:5, Informative)
My experience has been that when bringing up new hardware, when you don't yet have a stable bootloader, let alone a compiler or operating system, then being able to write in assembly is very valuable.
More accurately I think I should say that being able to write in machine language is very valuable, as you might not even have a working assembler depending on what you are working on.
Being able to peek and poke a few registers, hand code a loop or two, and maybe write some sequential values across a bus can go a long way in helping you get the hardware going. Hook a logic analyzer to the bus and you're golden.
Even if you do have a whole infrastructure of compilers, device drivers, and operating systems available, none of that helps you when the first damn batch of prototypes (made of the first revision of the PCB, containing the first ever silicon of a new CPU, and the first ever silicon of the the new chipset) won't even boot, and you are trying to get to root-cause ASAP because you've got a whole army of testers ready to have at the hardware as soon as you get it running code.
In short, if you are the guy designing the raw iron that the software is going to talk to, you better be able to step up and take control of the raw iron when the software can't.
The long way (Score:5, Funny)
But writing in assembly has always given me the same feeling as eating rice with a single chopstick.
Re:The long way (Score:4, Funny)
Programming in Assembly language is kind of like.. (Score:4, Insightful)
Also, it's good to remember that Assembly language is just one more tool in a programmer's tool box. I wouldn't write throw-away scripts in Assembly language, just like I wouldn't use C. I'd probably use Perl, Python or shell script, as necessary. When you need to hand-tune that algorithm to get that last little boost in performance, being able to drop down to Assembly language can save the day. Too bad it is a dying art.
On another note, I agree with the other posters that said learning Assembly language allows you to learn the hardware better. 8086 Assembly language was my second language (after BASIC), and I used it for several years, until I started using Windows and found it was much easier to write a Windows program in C
Yes, learn it in context. (Score:5, Insightful)
Given all of that, assembly language *is* the hardware/software boundary. It's where all of the fancy abstractions from CS dissertations meet reality. Understanding computer architecture is a huge asset as a software engineer, and to properly understand how software and hardware interact, you have to learn at least one assembly language. There is no alternative. For most people, it is an unpleasant experience, but the payoff is enormous. The learning process that you undergo while learning assembly will change the way that you see your software and will help you understand why your code is so slow and how to make it fast by design.
I have one last point. When you tell a potential employer about the low-level stuff that you know or work that you've done, your assembly skills are a proxy for understanding how hardware works (at least to interviewers with half a brain). If their software needs to run fast, they'll be happy that you understand the deep magic of hardware.
(Incidentally, I think that the fraction of software jobs that require an understanding of hardware and knowledge of assembly languages, linker internals, etc., are the only fun ones and the only ones worth having. So I learned MIPS, ARM, PowerPC, and TMS320C6 assembly, and they have all served me very well because I don't have to refactor C# for a living.)
Making your own computer and assembly (Score:3, Interesting)
If you want to mess around with this sort of thing, you cannot avoid writing things in asm. I've got this far:
http://www.alioth.net/Projects/Z80/Z80-Project/Z8
- having laid out a double sided PCB, and got everything shoehorned onto a 160x100mm 'Eurocard' sized motherboard.
However, I've also retargeted the z88dk (Z88 Development Kit, originally designed for the Cambridge Z88 portable computer) to my Z80 board because while it'll be best to have all the low level stuff done in assembly language, writing things that use floating point will just be ten times faster to write in C.
But even if you never intend to hack hardware, it's still important to at least be familiar with assembly language - if only to know why unchecked buffers are bad. If you've ever written a program in asm and accidentally overwritten the stack and tromped all over your return address, you fundamentally understand why this is a bad thing. We've got into a whole world of hurt because many programmers didn't understand this.
Re:All's quiet (Score:5, Funny)
Give me a moment. I've still gotta figure out the six nested timing loops I need to toggle the speaker cone in and out in such a way that it sounds like a cricket instead of a bird.
Re:All's quiet (Score:5, Funny)
Nothing to CX here, MOV along.
Would you trust these professionals? (Score:5, Insightful)
* Would you want an astronaut to understand physics and math?
* Would you want a doctor to understand chemistry and biology?
* Should somebody studying to be a Literature teacher take their full set of liberal arts courses, including history?
* Should somebody earning a business degree take music appreciation?
Most of us probably said, "Yes" to most or all of those above. Even if the study seems irrelevant or too "low-level" or too "high-level" at the time, there are areas of coursework that help us understand things better.
I see a lot of dead wood in the IT industry. There are enormous numbers of people who either have no passion or who do not have a deep-enough or broad-enough knowledge of computer science to do their daily data processing job well. They are dependent on others around them for everything, even though they may be very skilled in one area.
By having both a broader and a deeper knowledge, people are necessarily better at troubleshooting and at understanding the areas outside their particular specialty. It makes them be better at all of IT and helps them do their specific role.
You should learn IT two ways -- deeply and broadly. You should deeply learn specific skills (Java/C#/Linux/Windows/scripting in Ruby/whatever) and you should learn broad skills (computing theory/relational databases/networking/troubleshooting/programming/
There is an enormous difference between training and education. Training is learning specific skills for specific tasks (narrow/specific), while education is broader and teaches you how to think, understand, and apply (broad/general).
While taking Assembly may not seem relevant at the time and you may never directly use it again, for every programming task, having a strong background in all of computing theory (including how the CPU handles its low-level instructions) educates you and gives you a deeper understanding. (Don't just be trained, be educated!)
My recommendation is the book My Job Went to India (And All I Got was this Lousy Book). If you can't afford it, read the sample chapters, especially the "Being a Generalist" and "Being a specialist" chapters at http://www.pragmaticprogrammer.com/titles/mjwti/i
Personally, unless you need the specific class/training, I'd say that FORTRAN or COBOL ought to be abolished as required material in all colleges and shouldn't be in the degree program. Those should be electives only. Assembly, on the other hand, should remain required, for a deeper and broader education. (Don't settle for a dumbed-down program).
The difference, again, is training (specific/skill-oriented/task-oriented) vs. education (general/broad/understanding-oriented). Education and being a generalist will reap large rewards, long term. So stick with it and take that class. Assembly is a very important foundation class that educates you, long-term....
Another rhetorical question I have is this: "Are you passionate for IT or is it just a high-paying (presumably) job?" If it isn't a passion of yours, find you passion and do it well. If it is, take Assembly and like it -- it'll help you appreciate IT, your computer, your high-level language, and give you a more educated view of the "soul" of your computer.
(They don't make you take Assembly at many/most schools for their health. It would be a crying shame to remove it from the required courses).
Re: (Score:3, Insightful)
Asking why study Assembler is a little like asking "why study Latin." It's important to have an understanding of the low level programming because it will help you understand what's going on when using something higher level like malloc(), which will in turn help you write better programs.
Just my $.02
Re:All's quiet (Score:4, Insightful)
Personally, I like higher-level languages that abstract a lot of the inner workings such as C#/.Net, Python or Java. I like to concentrate on solving problems or making things work. However without those that *DO* write in assembly, nothing I write would *RUN* anywhere.
Re: (Score:3, Funny)
Re: (Score:3, Informative)
]1 BIT $C030
]2 DEY
That'll give you one cricket-like chirp. Throw some more loops around it to make it repeat with the right cadence. :-)
(Remove the dots...they're there only to get the columns to line up.)
Re:All's quiet (Score:5, Interesting)
Here are a few reasons you might need proficiency in assembly language:
Re:All's quiet (Score:5, Insightful)
Re: (Score:3, Insightful)
But, shaders are hardly written in assembly anymore, for all the good reasons.
Re: (Score:3, Funny)
2005 [slashdot.org] called, they want their hardware [google.com] back.
--
How can you understand Life if you don't even understand what happens after Death??
Re:All's quiet (Score:5, Insightful)
I see it this way: assembly is still used today, but only in a smaller niche. But that's not the only reason it's relevant. I think it's a good knowledge to have, even if you'll never use in practice, but it's concepts help you understand the whole. Much like Math, or basic Physics.
Re:All's quiet (Score:5, Interesting)
You're writing software for any chip, on any platform, that requires direct hardware level access, e.g. device drivers, boot code, or core-features. No machine, no matter how fast can be programmed exclusively in C. For example, in C you simply cannot a DCR on a PowerPC. You need a special instruction w/o a high-level language equivalent. You can't cast a pointer to a physical address, it is not mapped to physical memory. You also cannot enable, or disable instruction cache from any C function call. The list goes on. There are a number of places it is totally impossible to use a high level language to do things.
There are a whole lot of these out there, in the consumer, enterprise, military, etc.
Re:All's quiet (Score:5, Funny)
More (Score:3, Interesting)
Re:All's quiet (Score:5, Interesting)
The GP is 100% correct in its uses and you are also correct that its current use is crap.
We have abstracted ourselves far enough away and insulated ourselves so much that I think we are in danger of losing the point of fast computers.
Anyone with visual studio can get a good example of this if you see how long the immediate window takes to calculate 1+1.
It might be great and super and empowers the developer to do more, but something has been lost that I feel Visual Basic classic is fast in comparison.
Finding a decent optimisation of the core
Every time this kind of discussion comes up I think of Mel [pbm.com].
Assemblers are a dying breed but their services are more than needed even today.
"Assemblers are a dying breed" (Score:5, Interesting)
As an asm coder I _may_ find a full time job but asm will take as little as 10% of my time. Contract asm work is out of the question and I haven't seen any in years (since I wrote a serial port driver for Win3.1). I actually like programming in assembler but for the sake of my pay packet and career I have reskilled in PHP, MySQL, CSS, XHTML, JavaScript etc simply because I can find contract work that pays well. Something that appears unachievable with asm. Maybe this is why we are a dying breed.
Lastly, you're right. This discussion crops up so frequently on BBS's, Usenet etc. It seems that the answer must be that asm coders are still needed and asm is still relevant! If they weren't why would we be discussing its relevance!
Incidentally, if anyone would like to hire an asm coder who like asm mail asm@burnttoys.net
Re:Here's another (Score:5, Insightful)
Re:Here's another (Score:4, Insightful)
Still relevant, but... (Score:5, Insightful)
But two things come to mind:
1: Handcoders can code better than good compilers?
Yeah, in some cases after a lot of refining. But it is not as easy as it once was.
Compilers have gotten much better and processors have gotten a lot more complex. It's not just "how many clock cycles does this instruction use?", you also have to take various forms of micro-parallelism (pipelining, branch prediction, etc.) and cache hierachy issues into account.
2: It's good to know what goes on under the hood, sure.
But in many, many software developer tasks, early optimization is the root of all evil.
I would actually much rather recommend a top-down approach for most problems, abstracting away low-level details, rather than going bottom-up. The teaching approach of the great "Accelerated C++" comes to mind.
A lot of developers that know a little or a lot about low-level programming write less than excellent code in other regards (algorithmic complexity, design, re-use, etc.) and they can't seem to stop focusing on performance throughout the process.
For most problems, performance isn't critical, and even when it is, it might be better to look for algorithmic enhancements (lowering complexity) rather than do low-level fiddling.
Re:Cheap hardware means less assembler. (Score:5, Interesting)
ROM and RAM comprise the largest space on the die. Die cost is about linearly proportional to area - doubling the size of the die doubles the cost. As a result, we don't have the luxury of embedding Linux, throwing a couple more MB of RAM at the problem, or increasing the clock speed. We certainly don't have the luxury of throwing this weeks latest, greatest academic language at the problem. 'C' and Assembly is the only way this product is going to survive.
I think you can be a fine Web programmer without knowing assembly or 'C'; I think you'd be a better one after one assignment to a project like mine, where every design decision is made and every line of code is written with a thought to "how fast is this going to run, how much code does this generate?", rather than "how do I get this done fastest and easiest?". There are many situations where the "throw more hardware at it" approach is valid; there are also many situations where it isn't.