Live data from Hacker News

C Questions and Answers

kukuruku.co

51–60 of 135 posts

Re: C Questions and Answers

#51

> (especially C programmers) Author needs to stop his anti-intellectual everyone-is-as-ignorant-as-me bullshit. I see that a lot re programming to justify a lot of silly positions. If you only know Javascript, that's great, I rather like having shiny things in my browser (I like it too much, even). That doesn't mean that C programming is obsolete; some of us know C. For example, I got #5 and #9 wrong, and the rest I…

> the rest I got right including the general idea of the justifications.

The majority of them can be answered correctly by someone who understands computer architecture and programming languages. E.g. #3 is about pointers which do not necessarily have only to do with C. Even JS developers implicitly deal with pointers:

    var v = {} // v is a pointer

Re: C Questions and Answers

#52

> (especially C programmers) Author needs to stop his anti-intellectual everyone-is-as-ignorant-as-me bullshit. I see that a lot re programming to justify a lot of silly positions. If you only know Javascript, that's great, I rather like having shiny things in my browser (I like it too much, even). That doesn't mean that C programming is obsolete; some of us know C. For example, I got #5 and #9 wrong, and the rest I…

I think the opinions "c is too complicated and buggy and, therefore, obsolete" and "javascript is a 'shiny' language for amateurs" are just as narrow-minded as each other.

> javascript is a [...] language for amateurs

He never said that or implied it.

Re: C Questions and Answers

#53
post #2

This reminds me of tests I took in earlier CS classes. Knowing those things are utterly useless in practice.

My CS101 prof would give 50-100 line blocks of code, and hidden in them somewhere would be something like: if(condition); { some stuff } Note the semicolon after the if-statement. The tests became games of "find the semicolon or = in place of ==". Ugh.

Thankfully, your compiler probably warns about this nowadays, making such pointlessness obsolete.

Re: C Questions and Answers

#54
post #52

Earlier quoted context omitted.

I think the opinions "c is too complicated and buggy and, therefore, obsolete" and "javascript is a 'shiny' language for amateurs" are just as narrow-minded as each other.

> javascript is a [...] language for amateurs He never said that or implied it.

"If you only know Javascript" - why even bring that up? There is no mention of Javascript in the original article at all.

Re: C Questions and Answers

#56

I think this was silly, the author clearly does know C but they are complaining about optimizing compilers which do things "behind your back" and are becoming an increasing nuisance. It's sort of a passive aggressive "I think this should be an error but it isn't an error because twisted logic that the compiler uses with respect to undefined operation." That people can teach themselves what to expect the compiler to d…

On the topic of (overly) aggressively optimising compilers:

http://blog.metaobject.com/2014/04/cc-osmartass.html

...and attempts at turning C into something a bit less programmer-hostile:

https://news.ycombinator.com/item?id=8233484

My point of view is that compilers should be optimising at the level of machine instructions, not by attempting to second-guess the programmer and remove code that it thinks invokes UB. I've looked at tons of compiler output over the years, and there's plenty of opportunity for optimisation in instruction selection and register allocation... C should be a "do what I say, not what I mean" type of language.

Re: C Questions and Answers

#58
post #51

> (especially C programmers) Author needs to stop his anti-intellectual everyone-is-as-ignorant-as-me bullshit. I see that a lot re programming to justify a lot of silly positions. If you only know Javascript, that's great, I rather like having shiny things in my browser (I like it too much, even). That doesn't mean that C programming is obsolete; some of us know C. For example, I got #5 and #9 wrong, and the rest I…

> the rest I got right including the general idea of the justifications. The majority of them can be answered correctly by someone who understands computer architecture and programming languages. E.g. #3 is about pointers which do not necessarily have only to do with C. Even JS developers implicitly deal with pointers: var v = {} // v is a pointer

That is not a pointer.

In C I can perform arithmetic on a pointer.

`v` is a symbol which references an object. It might be acceptable to refer to `v` as a reference if we're being sloppy.

JavaScript has a DataView[1] which could be used to implement what I think is a pointer, but I do not think that most JS developers have used it.

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: C Questions and Answers

#60

I think this was silly, the author clearly does know C but they are complaining about optimizing compilers which do things "behind your back" and are becoming an increasing nuisance. It's sort of a passive aggressive "I think this should be an error but it isn't an error because twisted logic that the compiler uses with respect to undefined operation." That people can teach themselves what to expect the compiler to d…

On the topic of (overly) aggressively optimising compilers: http://blog.metaobject.com/2014/04/cc-osmartass.html ...and attempts at turning C into something a bit less programmer-hostile: https://news.ycombinator.com/item?id=8233484 My point of view is that compilers should be optimising at the level of machine instructions, not by attempting to second-guess the programmer and remove code that it thinks invokes UB. I…

Meh, the problem is the preprocessor. A lot of really silly things are produced by macro expansion, so the "obviously silly" optimizations really do end up mattering.
Post reply on HN