News for hackers. Stuff that matters.
Re:A critique of "How to C in 2016" by dietrichepp on Friday January 15, 2016 @06:15AM (#10908527)
This comment only fans the flames of language war, it doesn't contribute to the discussion.
Re:A critique of "How to C in 2016" by golergka on Friday January 15, 2016 @06:49AM (#10908664)
What? This comment is directly related to whether advice "don't use C if you can avoid it" is good or not.
Re:A critique of "How to C in 2016" by dietrichepp on Friday January 15, 2016 @06:58AM (#10908705)
And arguing that point is just the language war, nothing more, nothing less. I'd get as much mileage telling people that they shouldn't use Emacs unless they have to.
Re:A critique of "How to C in 2016" by humanrebar on Friday January 15, 2016 @07:10AM (#10908762)
I think you're wrong. It's valid to discuss the pros and cons of languages, and it's valid to discuss whether a language is a good tool for any job.

But your thoughts are still valid and contribute to the conversation.

Re:A critique of "How to C in 2016" by logicallee on Friday January 15, 2016 @06:45AM (#10908644)
This is simply not true. The barrier to a NEW person starting to write C code in 2016 - imagine some 20 year old college student - is "Am I ready to pick a denomination and religion and read hundreds to thousands of pages of gospel?" There is no such barrier with any other language.

You literally cannot give any examples of correct C code as a solution to a problem: literally, experts will disagree with you.

I've had experts tell me that cplusplus.com/reference gives horrific examples you should never follow. The newest addition of The C++ Programming Language says that the examples are not meant to be production code you can actually use as-is. (I can dig this up later if you want.)

C and C++ are more debates in the form of a language than languages per se.

Re:A critique of "How to C in 2016" by AnimalMuppet on Friday January 15, 2016 @01:36PM (#10911132)
> imagine some 20 year old college student - is "Am I ready to pick a denomination and religion and read hundreds to thousands of pages of gospel?" There is no such barrier with any other language.

Haskell comes to mind. There's a denomination and a religion. I'm not sure that the gospel runs to hundreds of pages, but there are many prophets who tell you that you need to know category theory, so for that sect, yes, it's hundreds or thousands of pages.

Lisp also has a denomination and a religion, but the sacred texts may be shorter.

Re:A critique of "How to C in 2016" by tome on Friday January 15, 2016 @02:13PM (#10911403)
> but there are many prophets who tell you that you need to know category theory

I challenge you to show me one!

Re:A critique of "How to C in 2016" by AnimalMuppet on Friday January 15, 2016 @06:35PM (#10913138)
If I knew of a decent search function for HN comments, I could show you several. As it is, I can only offer my memory of what I have read in the comments here.

My impression is that Haskell "experts" here say some variant of "of course all this is obvious because category theory" (implying "you have to know category theory or you're an uneducated heathen") at least three times as often as they say "you don't really need to know category theory".

Re:A critique of "How to C in 2016" by logicallee on Saturday January 16, 2016 @07:31AM (#10915106)
(not to your point but on "If I knew of a decent search function for HN comments"-- just so you know the search https://hn.algolia.com/ is fantastic - I've never failed to find a HN comment)
Re:A critique of "How to C in 2016" by onetimePete on Friday January 15, 2016 @05:33PM (#10912778)
That is the basic problem with show and tell with a low-level language. You either have a simple working example, with a dozen edge cases not caught. Or you have the usual check-hedge growth around Input and Output - which makes the Code hard to read. They chose the correct examples for the task- thus they where right, and your expert was wrong.
Re:A critique of "How to C in 2016" by dietrichepp on Friday January 15, 2016 @06:56AM (#10908698)
This is exactly my point. You're basically telling me that C is a horrible language. Why? Do you think I disagree with you? Do you think that you're giving me new information? Or are you just doing your part in the language war, perhaps repeating talking points that we're frankly a bit tired of? There are better things we could be talking about.
Re:A critique of "How to C in 2016" by logicallee on Friday January 15, 2016 @08:18AM (#10909081)
I didn't say C++ is a horrible language, and I'm sure I didn't say it because I don't really think this.

I would think you're being downvoted because there aren't really any language wars around the choice of C/C++ - it's not like PHP vs Ruby or Python or something. You're imagining a war where there really isn't one.

Usually people writing C or C++ don't have much of a choice, and usually people choose these languages due to the requirements. For example, writing embedded microcontroller code that will run on a $0.70 chip. What are you going to do, write it in Rust?

Nobody would dream of telling Linus Torvalds to refactor the Linux kernel into some other language - it's not just a ridiculous suggestion, it's like asking the United States to move to a different continent - it's a total non sequitur, it's not even in the realm of possibility.

Basically the advice "you should avoid writing C if you can" is totally uncontroversial, and for I would say 99% of people who woke up today, January 15th, 2016, a weekday, and wrote C code, the answer to "can you avoid it" is no. (Not just due to their position/employment but due to the very requirements of the project itself.)

Sure you should avoid writing C and C++ when you can, but for some classes of problems that is "never."