I think this is very true, what it says literally is that popularity and attracting ire are correlated.
However, my interpretation is that the reason why this is true is that (1) all languages involve design trade-offs, (2) every trade-off pisses someone off for at least a moment, and (3) popularity attracts eyeballs, therefore more popular languages have more people pissed off.
I am not suggesting you say this, but I have heard the (strawman?) argument that it is possible to design a nice, pure language that is above reproach but that it can't be popular, and thus his quote expresses the thought that there is an inverse relationship between elegance and popularity. I don't think this is the case.
However, I agree that his main point is more that you will never be able to design a language that is useful to a large number of people without making compromises, and with any compromise there will be at least one person for which it is not the optimal solution.
I don't want to say the relationship between elegance and popularity is strict though. There is simply a good correlation.
For my money, developers are better off knowing two tools (c + some very high level language) rather than the spork which is C++.
If 'C' would have had a decent native string type I think C++ might not have happened ;)
std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*,
const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>,
_Alloc = std::allocator<char>]
is an improvement? :-)I can see why they chose to omit it, but in retrospect I think it was a mistake. The problem they were faced with was that the language didn't include any 'runtime' at all the way they wrote it, a string package would have made it a must to have some runtime.
Everything that is 'runtime' in C is in libraries, and everything that is 'core' is in the compiler.
This constructor lets you customize the way the string class allocates memory. Now I would like to see the equivalent constructor in your favorite language :)
It is funny how everybody really seems to have their own favorite subset of C++.
I'd say the justification for all of the large languages (like C++ and Common Lisp) is the same. You may not need all of it, but the features you do need will at least be standardized, compared to using a small language with ad-hoc extensions to achieve the same.
[ I here include the standard library as part of the language, for languages with extensive meta-programming support like C++ and Common Lisp, it makes little sense to distinguish. ]
I think Objective C is a better object oriented C than C++. It's simpler, makes a syntactic distinction between message passing and "traditional" C, and has a more dynamic run time. I'm surprised no one else has brought up Objective C as a better solution to the "make C object oriented" problem.
Aside from C compatibility, C++ also allows one to create simple structures and procedures when such simple beasts are appropriate.
I currently suspect one should have either "full" object orientation plus weak typing OR weak object orientation plus strong typing. Strong typing plus full OO = Bondage and Discipline language, where the size of the code itself starts to really drag your development and debugging time down.
While Ruby or Python allows compact but slow code, Java and C#, among other excesses, force one to create a full class for every two-field data-structure. Thus C++ is more compact than C# and Java and faster than Python and Ruby, winning for race for a desktop application language (oddly enough, desktop apps need a fast language because they must compensate for desktop windowing systems being more bloated and users expect more from their machine each).
I'm sure Haskell or Lisp are excellent for some things but I don't think their paradigm is very compatible with GUI programming - I'd be interested if someone has a counter-example.
AutoLisp is just a thin scripting layer.
See <a href="http://www.fourmilab.ch/autofile/www/autofile.html>the autodesk file</a>.
Anyway, some more examples then:
Yes, I've seen people work wonders with AutoLisp. There was - probably still is - an application used for designing clothes. The designer creates, I think, a "size 8" and a lisp script generates the other sizes.
AutoLisp being lisp-like is really a happy accident. The Autodeskers chose Xlisp IIRC because it was free and embeddable. If they could have embedded a C-like language interpreter, they would have.
In fact later, AutoDesk introduced other languages and tried to push users onto them. But AutoLisp already had huge momentum.
var simple = new { Field1 = "foo", Field2 = "bar" };You're missing a crucial part of the equation: type inference. OCaml does what you want :-)
I someone is coming up with a type-infering variant of Ruby called Juby which could do the trick once it is work.
Now, has anyone coded a GUI with Ocaml?
Now, whether the types should be dynamic or static, is entirely up to the situation and what kind of system you are building.
* You have to actually run the dynamic runtime, which even OS X's XNU doesn't do.
* The dynamic runtime also obscures what's going on with the hardware, which can be a problem in embedded environments.
I like Objective C but it's always felt like voodoo to me. I'm always more comfortable in Ruby+C than I am in ObjC.
To the degree that C represents this reality, it is through exploits: e.g. buffer overflows, overwriting the stack and return address, and executing arbitrary code supplied by attackers. C itself does not represent the reality very well, since it does not lend itself to writing code that writes code at runtime.
The ones that do not are actually pretty rare.
Most of those use the 'harvard architecture' and are DSP style machines.
And then there are vector processors and SIMDs, but even those can be seen as many von Neumann machines running in lock-step.
i don't even know on what kind of hardware my java or python programs run. neither google (appengine) nor our IT apartment tell me.
so for most app developers "a computer" is not really something they work with. of course someone must write those abstractions (python, etc), and they do it in C/C++ :)
That's exactly the point, if your machine is anywhere near 'standard' (as in not a SIMD or something exotic) then C is as close as you can get to it without going to assembler.
Not any longer. I don't know how C models the kind of massive parallelism that is becoming mainstream right now.
The only reason you know what the C you write will end up doing on the machine is because you are generally not doing much when you're working in C.
If you want to get productive work done, you'll be leveraging lots of libraries written by third parties, and you have no more insight into how they are working when you're invoking them with C than Ruby, Python, Java, C#, or any other language.
A C program that accesses the memory will do so in an extremely predictable way, if I lay out a memory structure, a piece of code and an access pattern then I can be very sure about how that will interact with things like the caches.
In other languages where there is more 'under the hood' that is a lot harder.
Libraries don't enter in to the problem, that's another level altogether.
While it's true that library code written by third parties might be less (or more) efficient than the code you wrote, even those libraries will have the luggage of the underlying implementation of the language.
In C there is no implementation underneath, it is a 1:1 correspondence with machine instructions.
That is the reason that kernel code tends to be written in C.
In C, you deal with so many trees, it sure feels like you're right there in the woods. But actually, if you're dealing with things on a tree by tree basis, you're not getting much done. And you can pretty lose your way by focusing on navigating territory efficiently at that level, but not keeping track of the overall goal.
As to whether kernel code should be written in C, that is a different matter. C is not a good map to von Neumann architectures because it doesn't model shared code and data in memory - C doesn't have a good representation for writing code at runtime. Most code written in C will not be the most efficient possible code for this reason.
Modern developers have gotten so used to the fact that C is "low level" that they tend to forget how low really low level coding is. There's a ton of "high level" language features in every 3GL, and that includes C. The abstractive distance from machine code to a language like C or Pascal is far, far higher than it is between C and Python.
[1]: http://yosefk.com/c++fqa/
The answer then is obvious : we should change the hardware, so it is not C/C++ optimized, but Lisp/Python/Haskell optimized. Then, these languages are easier and more practical.
But I didn't start this: "Lovely languages like lisp, python, haskell" (sic).
However, even that is dying -- it is being replaced by the thumbEE, which is a more generic instruction set designed for efficient code generation from intermediate dynamic code.
http://en.wikipedia.org/wiki/Azul_Systems
I don't know how successful they are economically though.
edit: found it:
I think the strategy of objective-C is much cleaner, since they better separate the concerns of "writing fast code" and "writing high level OO abstractions".
I think C++ totally failed at being high level. So, this "success" being highly controversial doesn't surprise me.
C (the PDP-11 assembler that thinks it's a language)
C++ (the PDP-11 assembler that thinks it's an object system)
C isn't really a portable assembler. It was designed to be sufficiently efficient on a specific processor (the PDP11, a register based CPU), while providing basic abstractions (function, structures…).
C was an overwhelming success. And so were CPUs fast at running compiled C programs. As far as hardware optimization is concerned, the main characteristics of C are pointer arithmetic, manual memory management, and a relatively low ratio of function calls (in C programs). These are pretty big constraints. So, we ended up with C optimized CPUs. Now what if Unix has been implemented in Forth? All mainstream processors would have been stack based, and optimized for a very high ration of function calls.
C++, by extending C, also have this "portable assembler" nature. It also have a number of incredibly low-level mechanisms which can be used to build pretty high-level abstractions, but it's still an extension of C.
C++ is C, except that it doesn't completely suck for higher-level projects.
a.) you get direct access to your linear address space
b.) gcc targets so many instruction sets that you don't have to worry about your backend unless you have a custom platform.
C++ is the thing that screams "__gxx_personality_v0" at me because I always start off using gcc instead of g++.
C changed that dramatically and helped to cut down on porting effort tremendously.
And then C++ implements several programming paradigms (object oriented, generic, etc) without compromising that machine model.
Plus Bjarne was truly correct when he said: "there are languages people complain about, and there are languages nobody uses."