Forgot your password?
typodupeerror

Comment Re:C Advocacy (Score 3, Offtopic) 221

C is widely used because it allows the programmer to do exactly what he or she wants with (except in a few cases) the ability to be able to predict how the resultant binary will 'look'.

For example, the in-memory layout of a 'struct' is exactly how the programmer decided it should be - with the exception of padding, which has a well-defined behaviour anyway.

Similarly, the same applies to calling conventions, and to a certain extent, the raw machine code that gets generated.

C++, on the other hand, I hate, becuase it doesn't give you this fine-grained control (for example, the in-memory layout of a class containing virtual methods is largely implementation-defined, I believe).

The majority of the 'other' languages (with the exception of those such as Pascal, FORTRAN and COBOL) generally execute within a VM, which as well as letting you do lots of neat stuff (most of which you can do in C with a little bit of effort and a decent dynamic linker API), it also adds a layer of abstraction which means it's difficult to see how corresponds to assembler output. You're constrained by the VM, meaning that if you want to optimise for a particular CPU or architecture, you need to rebuild the compiler/interpreter/whatever and optimise the VM itself.

My two cents.

Slashdot Top Deals

"It ain't so much the things we don't know that get us in trouble. It's the things we know that ain't so." -- Artemus Ward aka Charles Farrar Brown

Working...