Live data from Hacker News

Modern C [pdf]

icube-icps.unistra.fr

111–120 of 396 posts

Re: Modern C [pdf]

#111

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.

While I am all about C/C++ (even if I hate it), it makes sense HN is probably something like 99% web and app developers (I would argue that all are the former, but my definition may be a bit old). In those cases, you actively don't want to ever use C and anyone who does is kind of an idiot. It is the logic by which "systems project" means "script to run on a server" for a lot of people around here. And that is fine.…

> While I am all about C/C++ (even if I hate it), it makes sense

There's no such thing as "C/C++". They're two totally different languages. (C++ actually has more in common with something like Haskell than C.)

Re: Modern C [pdf]

#113

Earlier quoted context omitted.

If the handle of the hammer you're holding was a chainsaw that randomly turns on and off. And also sometimes explodes killing your entire family and pet dog. Don't blame the explodey-chainsaw-hammer, it's just a tool . Okay an idiotically dangerous too that nobody in their right mind should use, but still just a tool.

C is utterly predictable. Maybe you're the exploding chainsaw in this metaphor.

How detailed is your knowledge of undefined behavior?

Re: Modern C [pdf]

#114
I'm really surprised by the "hate" for C that is appearing in these comments. What ever happened to actually enjoying the danger of getting low level? Is assembly also useless because it isn't readable?

There is a lot of great code written in C, and a lot of crappy code written in C. Because C doesn't protect you from yourself, it exacerbates any design flaws your code may have, and makes logical errors ever more insidious. So in this sense, the quality of the C you write is really a reflection of you as a C programmer, not the shortcomings of the language. Maybe you've been badly burned by C in the past, but keep an open mind and understand that C can be beautiful.

Re: Modern C [pdf]

#115
post #70
post #51

I personally prefer Prehistoric C, which only has the two language keywords "ugh" and "grunt". Modern C has too many keywords for my taste.

> "grunt" I'm sorry, you cannot use this keyword as it will cause a conflict with Javascript tools.

Most people use gulp now -- the reimplementation of the reimplementation of make in JavaScript because reasons.

Re: Modern C [pdf]

#116
post #104

For someone who studied basic C/C++ in university and is interested in hacking around in C, should I read this over K&R?

Don't skip K&R. Probably read both. They're both pretty short.

A really, really good one is Advanced Programming in the Unix Environment. But, it's pretty expensive.

Re: Modern C [pdf]

#117
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.…

Modern day CPUs are improving 3% a generation, and modern day compilers capped off looooong time ago. Better programming practices will return simply because people will want more and won't be able to get it.

This CPU power galore is just a short lived period before people want full phone VR on a battery for two hours or what have you. You can sort of see what's in demand now for $200k jobs and the tools there don't appear to be very high level or user friendly. If anything they all require few heavy courses in statistics.

Re: Modern C [pdf]

#118

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.

"Just about every software project written has some serious bugs" There, fixed it for you. Seriously, vulnerabilities and bugs are found everywhere not just in C. I've been programming for 35 years, in so many languages I lost count, and every time I've seen the 'let's not use C because it'll lead to bugs' it was to be replaced by another thing that was ALSO leading to bugs, and/or become so bloated it was in itself.…

The big problem with C is the memory safety issues. It is extremely difficult to write C code and be safe from malicious input. If you use a memory safe language these difficult issues are erased.

I realise the compiler/runtime can't stop all bugs but fixing these simple errors goes a long way to producing robust secure software.

Re: Modern C [pdf]

#119
post #97

Earlier quoted context omitted.

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.

Just curious, what are us C apologists supposed to be apologizing for: - A lack of suitable replacement for C? - C is too ubiquitous? - C has been an integral part of most of the best software ever written?

Agree with the first two but the last isn't saying much. C has been an integral part of most software ever written, best, worst, and everything in between.

Re: Modern C [pdf]

#120

I'm really surprised by the "hate" for C that is appearing in these comments. What ever happened to actually enjoying the danger of getting low level? Is assembly also useless because it isn't readable? There is a lot of great code written in C, and a lot of crappy code written in C. Because C doesn't protect you from yourself, it exacerbates any design flaws your code may have, and makes logical errors ever more ins…

People have strong feelings about C because C is far from being perfect by modern standards and yet it continues to be the single most important programming language of our time. There is nothing wrong or surprising with people being frustrated about this fact. I only wish that there was less irrational hate on this forum in this regard.
Post reply on HN