|
Jeremy Falcon wrote: just as soon as computers get faster, we want to make the languages more bloated. That way we never enjoy the new speed, we simply keep things the same and have a new cool shiny layer that sounds technical to toss on top of it
The assembly guys said the same thing of C. I'd be willing to bet the patch-cable guys said the same thing of assembly.
Do you really want to program your current applications using patch cables? How about assembler? It isn't (or shouldn't) be about adding cool-sounding technical layers, each language evolution allows the computer to do more of the mechanical grunt work, freeing us to spend more time doing the creative part. I don't know about you, but I really appreciate that.
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
patbob wrote: It isn't (or shouldn't) be about adding cool-sounding technical layers, each language evolution allows the computer to do more of the mechanical grunt work, freeing us to spend more time doing the creative part. I don't know about you, but I really appreciate that.
I totally agree with this, but only if the evolution gives us a real gain. Something like sugar coating at the price of performance I don't agree with. A legitimate paradigm shift I could understand.
Jeremy Falcon
|
|
|
|
|
Jeremy Falcon wrote: sugar coating at the price of performance I don't agree with Often, what has appeared to me at first as a sugar coating, turns out to be a paradigm shift in thinking that I didn't grasp. Not always, but a lot of times.
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
It's a good language, but in the modern world it's a bit...outclassed.
If you want small tight code for embedded work, then assembler is probably a good bet - though C is very useful there, it does tend to generate bloated code compared to that produced by a good assembler programmer. The C code will be produced faster, but it'll need more RAM, more processor, more...in embedded work you don't always have the luxury!
If you want desktop work, then C# or C++ have so many massive advantages in terms of OOPs design that there really isn't any comparison. It'll take you a lot longer to write the same app in C, and it'll almost certainly be harder to maintain.
If you want to write a website, then good luck doing it in C...
It's a product of it's time: it was designed to be "better than COBOL and FORTRAN". But the world has moved on, and the "competition" is a lot more sophisticated now.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
OriginalGriff wrote: If you want small tight code for embedded work, then assembler is probably a good bet - though C is very useful there, it does tend to generate bloated code compared to that produced by a good assembler programmer. The C code will be produced faster, but it'll need more RAM, more processor, more...in embedded work you don't always have the luxury!
This depends a lot on the Compiler and IDE used. While it is still true for a lot of Compilers, nowadays there are Compilers out there which make C code as efficient as Assembler code (at really high licence cost, of course - You are probably still cheaper off with Assemble).
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
The console is a black place [taken from Q&A]
How to ask a question
|
|
|
|
|
I agree that compilers do produce good code: but they can't interpret what the author is trying to get the hardware to do and that means what they generate can be spectacularly inefficient.
I had this problem with the ARM development kit (which was stupid money) - I needed to generate a specific wave output with my data to match the hardware it was interfacing to - and the C / Embedded C++ code just wouldn't do it no matter what I tried. In assembler it was trivial (but I eventually fitted a second PIC processor just to handle the interface - and coded that in C )
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
OriginalGriff wrote: but they can't interpret what the author is trying to get the hardware to do and that means what they generate can be spectacularly inefficient.
I agree, I love programming in Assembly, but I'm not sure I would beat the compiler, I'm just an enthusiast, don't program in it professionally. I also love C/C++ and was wondering if the ARM compiler you used support mixing up C and Assembly, like:
__asm
{
INC [EAX]
MOV EBX, [EAX]
...
}
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
----
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
|
Awesome, thanks
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
----
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
Right tool for the right job.
Not a lot of people use assembler in embedded work mostly C and a lot of them just because they've used it for so long it has become the language of choice.
As embedded hardware evolves and memory and speed less of a problem higher level languages will eventually replace C.
Here today gone to Maui...
|
|
|
|
|
OriginalGriff wrote: It's a good language, but in the modern world it's a bit...outclassed.
Agreed.
OriginalGriff wrote: If you want small tight code for embedded work, then assembler is probably a good bet - though C is very useful there, it does tend to generate bloated code compared to that produced by a good assembler programmer. The C code will be produced faster, but it'll need more RAM, more processor, more...in embedded work you don't always have the luxury!
I agree with this too, except my take on it is if I don't know ASM that well, then I'm better off just using C and hoping the compiler will optimize it well enough.
OriginalGriff wrote: It'll take you a lot longer to write the same app in C, and it'll almost certainly be harder to maintain.
If you want to write a website, then good luck doing it in C...
Agree-ish with this too, except I can write a large scale maintainable app in C. To me that's more to do with the programmer than the language.
OriginalGriff wrote: If you want to write a website, then good luck doing it in C...
Or as Marc Clifton would say, good luck doing it in any language.
Jeremy Falcon
modified 29-May-14 17:03pm.
|
|
|
|
|
You can write large scale, maintainable code in any language - even assembler!
Conversely, you can also write small scale unreadable cr@p in any language (look at QA if you don't believe me)
But...as the scale increases, it becomes easier to produce better code in an OOPs language, and harder in a non-OOps languages. It's like designing a car: you need to use powerful tools on a computer these days just to fit everything into the engine bay - you couldn't do it in a reasonable time frame using clay and palette knives!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
OriginalGriff wrote: ut...as the scale increases, it becomes easier to produce better code in an OOPs language, and harder in a non-OOps languages
It should be easier, but I've found it often gets much more difficult. Relatively recently I worked on a massive code base in OOP. There was nothing wrong with any single class or even the design, but as a whole, it was almost impossible to follow the whole thing. However, the sections that were pure procedural code or extremely lightweight classes were very easy to follow.
|
|
|
|
|
Joe Woodbury wrote: However, the sections that were pure procedural code or extremely lightweight classes were very easy to follow.
I gotta agree with you there. OOP is nice, I like it. But on a massive scale it's like it almost adds too much complexity to track what goes where and really does what. Got nothing against OOP, it helps with clean code. But, I can still write a C program in large scale that's just as maintainable.
Jeremy Falcon
|
|
|
|
|
Hardly I need to write assembly code for PIC24 microcontrollers.
Veni, vidi, vici.
|
|
|
|
|
Quote: "better than COBOL and FORTRAN". Everything is better than COBOL but nothing is better than FORTRAN! Well... for maths stuff anyway! I wrote an expert system in FORTRAN-77, I thought it was so advanced now that I didn't have to pack characters two at a time into integers (FORTRAN IV).
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
OriginalGriff wrote: If you want small tight code for embedded work, then assembler is probably a good bet - though C is very useful there, it does tend to generate bloated code compared to that produced by a good assembler programmer.
Agree if you're code is WOUF (Write Once, Use Forever).
The choice depends on what the engineering constraints are. If I want to accommodate the hardware people having an upgrade path, going from an 8051 to an 80186 say (to use an archaic example), then portability and reusability are the constraints and C makes much more sense.
I really don't want to do the SSDD shuffle for the rest of my egregiously unnatural life.
("bloated code" used in reference to "C", Gracie? Oh! I get it. It's a pesky relativity thing.)
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
|
|
|
|
|
Assembler.
regards,
Kate
|
|
|
|
|
That article is all wrong. The guy assumes that just because a feature exists you are forced to use it. Most expercienced c++ programers are only using a small subset of the language.
|
|
|
|
|
And even then, there are 4 sub-languages to C++:
- C backward compatibility
- C++
- STL
- Template meta-programming
How you use C++ primarily depends on which one of the sub-languages you are using for that portion of the program.
|
|
|
|
|
A language where simple integer addition is allowed to cause nasal daemons is immediately disqualified for the title "best language".
|
|
|
|
|
|
"Someone who gambles"
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Isn't that "bettor"?
/ravi
|
|
|
|
|
You bet.
Government is not reason; it is not eloquent; it is force. Like fire, it is a dangerous servant and a fearful master. ~ George Washington
|
|
|
|
|