Author Topic: Anyone else think assembly is (mostly) useless?  (Read 32045 times)

0 Members and 1 Guest are viewing this topic.

Offline cthree

  • Frequent Contributor
  • **
  • Posts: 258
  • Country: ca
Re: Anyone else think assembly is (mostly) useless?
« Reply #125 on: May 18, 2013, 06:14:43 am »
Assembler has a narrow use case. Any more than 10 lines and it should be done in C.

Rarely can an engineer, let alone a true programmer do a better job hand stitching assembler than a modern C toolchain can. There is nothing you can do in assembler that you can't do in C, better, faster, cheaper and with fewer bugs and fewer maintenance headaches. I'll take the 0.01% inefficiency for the smallest most trivial programs in favor of the 99.99% extra efficiency in everything else.

If you reach for Assembler, you probably don't know C well enough but I would suggest, as a software guy primarily, you would gain way more by becoming a C expert than you would lose by letting Assembler go. C gives you a vast array of tried and true libraries of code, much of it runs the same on an AVR as a 8051 or a PIC or ARM. How many Assembler variants and datasheets are you going to remember?

C makes you flexible, pragmatic.
 

Offline TheWelly888

  • Frequent Contributor
  • **
  • Posts: 339
  • Country: gb
Re: Anyone else think assembly is (mostly) useless?
« Reply #126 on: May 26, 2013, 02:37:31 pm »
I don't like assembly, I just discovered this new language....  http://en.wikipedia.org/wiki/Brainfuck  >:D

...coat on and gone...
You can do anything with the right attitude and a hammer.
 

Offline gerrysweeney

  • Regular Contributor
  • *
  • Posts: 167
  • Country: gb
  • Electronics hacker and maker and taker aparter
    • gerrysweeney.com
Re: Anyone else think assembly is (mostly) useless?
« Reply #127 on: May 30, 2013, 12:44:33 pm »
For what its worth, I started my programming journey many years ago in assembler on 6502, Z80 and then X86/286/386 and very quickly got to C and then C++ after that.  I would say that assembler has a very important role but in an increasingly narrow area.  CPU's and micros are bigger and faster and cost so much less today so buying more grunt to get past the overhead of language calling conventions etc is well worth the cost in time saving which is way more expensive.  That being said, sometimes, and especially in interrupt routines where timing is critical, then hand cranked assembler can win out where it needs too - so long as the developer is competent - it takes a lot of experience and an in depth understanding of the specific architecture to make it worthwhile.  In my recent project on PIC's I have used pure C, even for the interrupt handlers because I had the headroom on the target device.  If I were to write a lernel-level hardware device driver on the X86 Windows or Linux platform I would almost certainly use some small amount of in-line assembler to guarantee precise behaviour and optimisation of the stack bashing needed to make stuff work reliably and quickly, but apart from the frame setup it would all be C after that.

I don't think you can be generic with this view, you need to be objective and look at it on a case-by-case basis.   If you are a competent assembly programmer you will by definition have a thorough understanding of the platform you are targeting. It would be no surprise to know that the people that can really drive a RealICE debugger and diagnose system level hardware or software issues with such a tool would be very proficient in understating machine code...the two things go hand in hand.

Gerry

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 892
  • Country: us
Re: Anyone else think assembly is (mostly) useless?
« Reply #128 on: May 30, 2013, 09:41:14 pm »
I don't like assembly, I just discovered this new language....  http://en.wikipedia.org/wiki/Brainfuck  >:D

...coat on and gone...
Do you one better...

http://code.kx.com/wiki/Startingkdbplus/contents

kdb+ is a proprietary language that's used every day by quants on Wall St. It's a descendant of APL with some LISP and SQL thrown in. The entire executable is *under* 500Kb, and that includes a relational database implemented in the language.

The attached image is what kdb+ code looks like. I think that's the SQL parser.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf