News for hackers. Stuff that matters.
Re:Modern C [pdf] by grabcocque on Monday November 28, 2016 @08:19AM (#13055192)
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.
Re:Modern C [pdf] by quickben on Monday November 28, 2016 @08:33AM (#13055252)
Eh, no need to overreact that much. Look. Hardware is hardware, and this is where tire meets the road so people can lay the foundation for the upper levels.

It is what it is. It's not user friendly because hardware just isn't, low levels aren't, and it has to just perform.

> 'idiotically dangerous'

Well, I don't want to sound harsh, but nobody forces anybody to do systems programming if they perceive C as such. There is JavaScript, python and plethora of other safe and cozy languages, but: the low level has to be done.

Re:Modern C [pdf] by yxhuvud on Monday November 28, 2016 @08:44AM (#13055318)
Hardware is hardware, but C is not. People need to stop pretending that it is.
Re:Modern C [pdf] by nurettin on Monday November 28, 2016 @10:51AM (#13056156)
Look at all his comments in this thread. He is just fishing for an argument/attention.
Re:Modern C [pdf] by grabcocque on Monday November 28, 2016 @08:36AM (#13055272)
Oh, I see it's not that there's such a thing as a bad tool, or that C is unsafe.

Simply most of us don't have your towering intellect to appreciate it. Got it.

Re:Modern C [pdf] by quickben on Monday November 28, 2016 @08:40AM (#13055300)
Maybe I was too harsh, I apologize. But c is far less dangerous than a kitchen knife.

Tools are tools, some are used with a great amount of care: jackhammers, routers, compression hammers, chainsaws etc.

Heck: driving a vehicle is probably the single most dangerous activity we do on a daily basis.

Re:Modern C [pdf] by geezerjay on Monday November 28, 2016 @08:32AM (#13055248)
> If the handle of the hammer you're holding was a chainsaw

Except it isn't.

It's just a hammer, with a handle of a hammer.

> And also sometimes explodes killing

Except it doesn't.

At best, some people are reckless and end up causing problems due to their recklessness.

Enough with these silly hyperboles. Cushioned environments lead to less problems.

Re:Modern C [pdf] by chrisd1100 on Monday November 28, 2016 @08:57AM (#13055392)
C is utterly predictable. Maybe you're the exploding chainsaw in this metaphor.
Re:Modern C [pdf] by adamnemecek on Monday November 28, 2016 @09:24AM (#13055534)
How detailed is your knowledge of undefined behavior?
Re:Modern C [pdf] by module0000 on Monday November 28, 2016 @09:41AM (#13055639)
We know when undefined behavior will occur(the specs are written very clearly), but not what will happen when it occurs. Our job as competent C programmers is to avoid undefined behavior. C isn't hard(perhaps tedious to do correctly) - it does exactly what you tell it to.
Re:Modern C [pdf] by mathw on Monday November 28, 2016 @11:01AM (#13056226)
It does, but it's unnecessarily difficult to keep track of all the places undefined behaviour might occur and make sure you don't step into any of them under any conditions ever.

We shouldn't have to work like this anymore. C's been an amazing language, but it's getting time to gently, respectfully, move on. There's active and interesting development in alternatives which attempt to retain C's primary advantages while also allowing the compiler to keep you out of trouble as much as possible.

We have hugely powerful computers available to use as developers. We can contemplate designing and compiling languages with a complexity which would have completely defeated the systems available when C was developed. Why shouldn't we use some of that power to make our lives easier?

Re:Modern C [pdf] by adrianN on Monday November 28, 2016 @10:16AM (#13055907)
You'd be hard pressed to find a non-trivial C program that doesn't contain any undefined behavior.
Re:Modern C [pdf] by sidlls on Monday November 28, 2016 @01:32PM (#13057365)
Depends on what you mean by "non-trivial," I should think.
Re:Modern C [pdf] by pcwalton on Monday November 28, 2016 @10:55AM (#13056185)
> it does exactly what you tell it to.

This is a tautology.

What do you expect to happen on signed overflow?

Re:Modern C [pdf] by digler999 on Monday November 28, 2016 @03:09PM (#13057981)
> sometimes explodes

thought you were talking about java bloatware for a second. Oh your OS doesn't have 1.2gb for HelloWorld.class? Enjoy your OutOfMemoryException!