Live data from Hacker News

How can C Programs be so Reliable?

tratt.net

31–40 of 105 posts

Re: How can C Programs be so Reliable?

#31
The problem with C is they left too many things completely on the wild. Strings and memory management are all laissez-faire and everybody does whatever they think is right.

A typical performance issue is calling malloc/free all the time, it can be avoided but there are no standard ways.

I hope some great features of C++ get some day backported to C. But don't bet money on that :(

Re: How can C Programs be so Reliable?

#32
post #30

Earlier quoted context omitted.

that was my experience when I went from ASM - to functional and then C when wrangling hardware. I am still surprised at how reliable C apps can be (linux kernel) - hats off to the genii involved in making things stable.

I use Linux, but I am still surprised it is really stable. At low level it's quite messed up and shows the cons of being a pseudo-bazaar ecosystem. Lately it's changing to a cathedral with a handful of core developers acting quite dictatorial and perhaps that will clean up things a bit. I'm not advocating any of both camps, just bringing up it is far from perfect. In particular I've spent last week trying to figure o…

The stability of any system is roughly proportional to how much automated testing is done against it.

Re: How can C Programs be so Reliable?

#33
post #5

People often write in higher level languages because they want lots of bad code fast. Almost all business applications are CRUD apps (create/retrieve/update/destroy) with some business logic, and they're generally written in C#. The app may crash when you click the wrong button, but the app is cheap to develop and the programmers are easily replaceable. Of course I'm generalizing, and a lot of C# programmers write gr…

I am not sure why are you bringing enterprise software into the discussion. Despite being the most popular form of employment for "programmers" it has always been the absolutely lowest form of life in a software ecosystem and, therefore, should be ignored and left out of any intelligent discussion about programming.

In the 90s it was Visual Basic, now it's Java and C#, but it has absolutely nothing to do with what most of us consider to be discussion worthy.

Re: How can C Programs be so Reliable?

#34
post #33
post #5

People often write in higher level languages because they want lots of bad code fast. Almost all business applications are CRUD apps (create/retrieve/update/destroy) with some business logic, and they're generally written in C#. The app may crash when you click the wrong button, but the app is cheap to develop and the programmers are easily replaceable. Of course I'm generalizing, and a lot of C# programmers write gr…

I am not sure why are you bringing enterprise software into the discussion. Despite being the most popular form of employment for "programmers" it has always been the absolutely lowest form of life in a software ecosystem and, therefore, should be ignored and left out of any intelligent discussion about programming. In the 90s it was Visual Basic, now it's Java and C#, but it has absolutely nothing to do with what mo…

> Despite being the most popular form of employment for "programmers" it has always been the absolutely lowest form of life in a software ecosystem

It just runs our banks, hospitals, governments... Much better to solely focus on those that write kernels, device drivers and filesystems?

Re: How can C Programs be so Reliable?

#35
post #31

The problem with C is they left too many things completely on the wild. Strings and memory management are all laissez-faire and everybody does whatever they think is right. A typical performance issue is calling malloc/free all the time, it can be avoided but there are no standard ways. I hope some great features of C++ get some day backported to C. But don't bet money on that :(

C believes that programmer doesn't make mistakes. About memory management, I don't think it should be a language feature because there are some good implemented libraries out there.

Re: How can C Programs be so Reliable?

#36
post #30

Earlier quoted context omitted.

that was my experience when I went from ASM - to functional and then C when wrangling hardware. I am still surprised at how reliable C apps can be (linux kernel) - hats off to the genii involved in making things stable.

I use Linux, but I am still surprised it is really stable. At low level it's quite messed up and shows the cons of being a pseudo-bazaar ecosystem. Lately it's changing to a cathedral with a handful of core developers acting quite dictatorial and perhaps that will clean up things a bit. I'm not advocating any of both camps, just bringing up it is far from perfect. In particular I've spent last week trying to figure o…

In contrast, I consider the Linux kernel code clear and clean. I have mostly looked through the scheduling and file system code; I can't speak for TCP/IP port management.

Re: How can C Programs be so Reliable?

#37
post #33

Earlier quoted context omitted.

I am not sure why are you bringing enterprise software into the discussion. Despite being the most popular form of employment for "programmers" it has always been the absolutely lowest form of life in a software ecosystem and, therefore, should be ignored and left out of any intelligent discussion about programming. In the 90s it was Visual Basic, now it's Java and C#, but it has absolutely nothing to do with what mo…

> Despite being the most popular form of employment for "programmers" it has always been the absolutely lowest form of life in a software ecosystem It just runs our banks, hospitals, governments... Much better to solely focus on those that write kernels, device drivers and filesystems?

So? Despite being useful, what's so interesting about CRUD programming for the enterprise? I've been there, I've had my share of dealing with coworkers that openly admit that they haven't touched a single book since graduation 10 years ago and they see no reason why would they want to.

That's the kind of programmers this industry attracts, and that's the kind of software it builds. What's so interesting about it? Why even bother mentioning these numerous java/C# jobs? My ex-wife with zero programming experience has trained herself in less than a month to run a simple SQL queries in Visual basic and blast results in a grid control on a form, so did thousands of ex-taxi drivers in late 90s. So?

Re: How can C Programs be so Reliable?

#38
post #31

The problem with C is they left too many things completely on the wild. Strings and memory management are all laissez-faire and everybody does whatever they think is right. A typical performance issue is calling malloc/free all the time, it can be avoided but there are no standard ways. I hope some great features of C++ get some day backported to C. But don't bet money on that :(

The later C standards add additional features. However, I'd argue that there is no such thing as a "great feature" in C++: almost everything in the language is a mistake, either intrinsically or in combination with other 'feature's.

It's a blind pig with fifteen legs, trying to put on its own lipstick while riding a unicycle.

Re: How can C Programs be so Reliable?

#39
post #31

The problem with C is they left too many things completely on the wild. Strings and memory management are all laissez-faire and everybody does whatever they think is right. A typical performance issue is calling malloc/free all the time, it can be avoided but there are no standard ways. I hope some great features of C++ get some day backported to C. But don't bet money on that :(

The later C standards add additional features. However, I'd argue that there is no such thing as a "great feature" in C++: almost everything in the language is a mistake, either intrinsically or in combination with other 'feature's. It's a blind pig with fifteen legs, trying to put on its own lipstick while riding a unicycle.

Spoken like someone who truly doesn't understand C. You even managed to confuse it with C++ (you might as well have said "Java" in the place of C++, it's about as close to C as C++ is)

Well done.

edit: Ignore this post. I misread. I'm an idiot. Sorry about that

Re: How can C Programs be so Reliable?

#40
post #37

Earlier quoted context omitted.

> Despite being the most popular form of employment for "programmers" it has always been the absolutely lowest form of life in a software ecosystem It just runs our banks, hospitals, governments... Much better to solely focus on those that write kernels, device drivers and filesystems?

So? Despite being useful, what's so interesting about CRUD programming for the enterprise? I've been there, I've had my share of dealing with coworkers that openly admit that they haven't touched a single book since graduation 10 years ago and they see no reason why would they want to. That's the kind of programmers this industry attracts, and that's the kind of software it builds. What's so interesting about it? Why…

I think how interesting it is depends on your interest.

If you are heavily into programming, as it seems you are, I can understand that SQL queries seem trivial and boring. If your interest is elsewhere programming is often just a tool used to create the interesting stuff. Whether that is usability, design, getting people to interact in new ways, launching rockets or automatically turning off your garden lights when your computer powers down.

Believe it or not there are interesting discussions to be had about other things than programming.

Post reply on HN