Live data from Hacker News

Modern C [pdf]

icube-icps.unistra.fr

81–90 of 396 posts

Re: Modern C [pdf]

#81

Earlier quoted context omitted.

Yeah, again and again. it's like blaming a hammer for the potential of breaking your finger when you use it, and proposing the use of a spoon, instead.

This C apologism is holding the industry back. Software development has changed many times over since C came out and it just isn't a good tool for tackling a lot of the issues that we have today. Just about every software project written in C has some serious bugs. I personally judge a language by how well it lets you to define abstractions. In C's case, it doesn't let you do that very well.

Your criticism lacks constructivity. What do you propose we replace C with?

Re: Modern C [pdf]

#82
post #62

The author has also been involved in development of "musl", a modern C11 compliant standard library implementation: http://www.musl-libc.org https://gustedt.wordpress.com/2014/10/14/musl-1-1-5-with-ful...

complaint

yeah I hear that often when talking about C11 :]

Re: Modern C [pdf]

#83

Earlier quoted context omitted.

This C apologism is holding the industry back. Software development has changed many times over since C came out and it just isn't a good tool for tackling a lot of the issues that we have today. Just about every software project written in C has some serious bugs. I personally judge a language by how well it lets you to define abstractions. In C's case, it doesn't let you do that very well.

Your criticism lacks constructivity. What do you propose we replace C with?

Depends on what you are writing. C isn't 100 percent replaceable right now but the more people bitch about it and support the alternatives, the better for the future.

Re: Modern C [pdf]

#84
post #36

Earlier quoted context omitted.

Go has chosen to omit assert(), because assert() is frequently misused they say. Antibiotics are also frequently misused, but that is not a good reason to prohibit them. The omission of assert() makes Go a non-starter. Rust seems more promising, but it is still not to the point where I am interested in rewriting SQLite in Rust, though I may revisit this decision in future years. Some current reasons to continue to pr…

>The omission of assert() makes Go a non-starter. A small syntactic sugar you can trivially implement yourself makes Go a non-starter? Go doesn't include assert in the language because you're supposed to do better than assert. Assert easily allows lazy programmers to let their programs freely crash without properly handling error conditions. Go prevents you from compiling with unused variables, and that combined with…

>Go prevents you from compiling with unused variables, and that combined with the Go documentation goes a long way towards teaching new Go programmers how they're expected to work.

Things like this make me not want to use a language. Want to comment a=b; to a=3;//b temporarily? Too bad, either assign b to 3 or comment out b too, and if b was the only variable to make use of c, same for c, and so on. Same obnoxious nonsense as Java not letting unreachable code exist, making me have to comment out the rest of the function body if I want to put in a return in the start to test something, which happens often enough that it's a pain.

Re: Modern C [pdf]

#86
post #67

What alternatives there are for C/C++ if you want to write library that you can call from Python, R, Matlab, Java, Rust, Lua, node.js ... and have good performance? Old ones like Ada and Fortran of course. There are newcomers like Rust and Go. Are their C api's mature and portable?

> Old ones like Ada and Fortran of course.

Modula-2, FreePascal, D

Re: Modern C [pdf]

#87
post #80
post #52

Another day for the HN crowd to express their distaste for C :)

With modern day computing power and compilers there are better ways to tell the computer and explain your fellow programmer what you want the computer to do. In the end giving in the same (or even more efficient) CPU instructions. Sniper rifles are improving every year. Yet a rifle from the 40's can kill people too. Both deadly in the hands of an expert and dangerous in the hands of an amateur. It's the same with C.…

In the end giving in the same (or even more efficient) CPU instructions.

We both know that is not always true and heavily depends on the type of software though.. Take https://github.com/micropython/micropython for instance: what higher level language but C would allow that to run with the same performance as it has now, on as much different devices? C++ would be a viable answer, but when used e.g. as C + templates it's basically still a form of C and anyway your complaints have been raised in nearly the exact same wordings about C++ laguage as well..

Re: Modern C [pdf]

#88
post #80
post #52

Another day for the HN crowd to express their distaste for C :)

With modern day computing power and compilers there are better ways to tell the computer and explain your fellow programmer what you want the computer to do. In the end giving in the same (or even more efficient) CPU instructions. Sniper rifles are improving every year. Yet a rifle from the 40's can kill people too. Both deadly in the hands of an expert and dangerous in the hands of an amateur. It's the same with C.…

> With modern day computing power and compilers there are better ways to tell the computer and explain your fellow programmer what you want the computer to do. In the end giving in the same (or even more efficient) CPU instructions.

It was already like that 10 years before C was invented, but their authors didn't want to invest too much resources creating an Extended Algol, PL/I or similar compiler.

ESPOL and NEWP were already available in the 60's.

Re: Modern C [pdf]

#89

It strikes me as odd you'd even go to the lengths of producing such a book. If you really wanted to protect people from the worst vagaries C the book should simply say "don't".

C is still the lingua franca of computing, like it or not.

Re: Modern C [pdf]

#90
post #87
post #80

Earlier quoted context omitted.

With modern day computing power and compilers there are better ways to tell the computer and explain your fellow programmer what you want the computer to do. In the end giving in the same (or even more efficient) CPU instructions. Sniper rifles are improving every year. Yet a rifle from the 40's can kill people too. Both deadly in the hands of an expert and dangerous in the hands of an amateur. It's the same with C.…

In the end giving in the same (or even more efficient) CPU instructions. We both know that is not always true and heavily depends on the type of software though.. Take https://github.com/micropython/micropython for instance: what higher level language but C would allow that to run with the same performance as it has now, on as much different devices? C++ would be a viable answer, but when used e.g. as C + templates i…

Turbo Pascal, Think Pascal, Quick Pascal, FreePascal, Modula-2, Ada, Delphi, MikroElektronika Pascal

The availability of compilers for a specific architecture is orthogonal to the language.

Post reply on HN