Live data from Hacker News

Modern C [pdf]

icube-icps.unistra.fr

71–80 of 396 posts

Re: Modern C [pdf]

#71
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?

For Rust? Totally usable and robust.

Re: Modern C [pdf]

#72

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.

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…

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]

#73

Earlier quoted context omitted.

Pragmatism over "Oooh Shiny", one of the reasons I have huge respect for the sqlite project ;). Rust looks pretty decent but I'm still in the wait and see stage as well.

I was trying to teach myself some Rust and found the state of the documentation to be very frustrating. The core language is decently documented with the manual, but the standard library documentation was out of date in many places, most annoyingly in the first few hits on Google. I found 5 different ways to read a file on Google, and only one of them still worked. Plus I saw the release notes on the newest version t…

What are you missing from the up-to-date API reference[1]?

[1] - https://doc.rust-lang.org/std/

Re: Modern C [pdf]

#74
post #52

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

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.

Re: Modern C [pdf]

#75

Earlier quoted context omitted.

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…

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.

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]

#76
post #52

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

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. But just like this place's obsession with Rust would lead to derisive mockery by "real" systems people, so too is C hated here.

It also doesn't help that universities, at least in the US, seem hellbent on teaching along these lines. A few years ago Eclipse was "the thing you use when you are poor or doing Java". These days? I am seeing disturbing numbers of graduates who refuse to use Visual Studio for a project on Windows and insist on boostrapping together something that is only half functional. And talking to my academia friends (and even doing a fair amount of guest lecturing for them), I know where the indoctrination is coming from.

Re: Modern C [pdf]

#77
post #61
post #48

Earlier quoted context omitted.

> We bind type modifiers and qualifiers to the left. Good idea in theory but your example shows how bad it behaves in practice.

Usually declare variables one per line, so, type is still clear when: char* var1; char var2;

C does not in anyway forbid having two definitions on the same line hence

    char var2, *var1;
is valid C while in Java this would be illegal

    char var2, [] var1;
So the syntax is correct and all you are doing is to add style rules that make it less readable.

Re: Modern C [pdf]

#78
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…

> Rust has "immutable variables". Seriously? How can an object be both variable and immutable? "Immutable variables" is frequently used, true, but the official term is "immutable bindings".

Reassuring news. Thanks.

Re: Modern C [pdf]

#79

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.

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…

Hardware is hardware, but C is not. People need to stop pretending that it is.

Re: Modern C [pdf]

#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. You should be able to understand the computer on that level but you don't need C just to prove it.

Post reply on HN