5 ms·
I absolutely loathe and despise the arrogant 'your code must be bullshit' attitude that runs throughout this article. When you encounter other peoples' code an
by joosters 6y ago
I absolutely loathe and despise the arrogant 'your code must be bullshit' attitude that runs throughout this article.
When you encounter other peoples' code and it looks a bit complicated, and not the 'obvious and simple' thing, your first thought should never be 'they wrote bullshit code', but instead 'what have I missed? What did I forget to consider for this function?'
I don't know anything about the glibc authors, or their code style, but if you go through your life assuming incompetence if someone wrote a function differently to your initial thoughts, then you are an arrogant prick.
- iforgotpassword 6y agoI don't have a problem with strong language. Drew easily comes across as arrogant sometimes, and I don't agree with everything he says. But if there's something I'm sick of it's that stupid "well the spec says it's UB so let's just write code that FUCKS THE DEV as hard as possible." attitude in certain circles regarding a one letter programming language. The code in question is a classic array lookup with missing bounds check. If you write code like that and then blame people for using it wrong because the spec says so, you're just as arrogant, just in a different way.
- browserface 6y agoI actually loved it. I found it very entertaining. Tangent: surprises me how often comment people lose their shit when you utter the slightest word of criticism about some pet {language,code, tech}, but are absolutely fine, supportive and enabling when someone verbally eviscerates the living shit out of another human based on what they said, or their opinion. How is attacking a non human idea and no one in particular bad, but attacking a specific person viciously ok? I don't get that and I never did.
- Munksgaard 6y agoDidn't a human being write the glibc implementation?
- browserface 6y agoExactly. How is that the same to you?
- EliRivers 6y agoHow is attacking a non human idea and no one in particular bad, but attacking a specific person viciously ok? Well it's not an absolute, is it? There's context. Some specific people deserve to be attacked.
- browserface 6y agoAnd what you're going to attack them? Really so you think that these people who go so crazy if you attack an idea are really OK to attack a person?
- II2II 6y agoEven though I agree with what you are saying, it is also worth looking at the issue through the eyes of the author. The function that they were calling can be summarized as, "check to see if a value is in a set," only to receive an initially inexplicable segfault. They had a clear example of what that could look like, someone else's code from a common library, yet spent a considerable amount of time untangling the code in the library where the bug popped up. It is wrong to assume incompetence on the part of the glibc authors, particularly when the comparison library has a much more limited scope and can afford to avoid "bullshit code", but the source of the frustration is clear. I would hardly define them as an arrogant prick because of that.
- jerome-jh 6y agoThe Glibc code shown is really unforgiving, so I don't mind the author's humor. My opinion is that there is only one excuse for writing so unreadable code for such simple functionality (even taking account the legacy): that would be to use a language completely unfit for the task. That should not be the case here ... or is it? Why so many macros?
- rwmj 6y agoglibc is and quite probably has to be written in C (the clue is in the name), and it has to work on a great many platforms and architectures, serving an absolutely huge amount of software. Is there any other software linked with and providing vital infrastructure to tens of thousands of other programs? (Maybe Windows MSVCRT.) I've written tons and tons of software for Linux, and I believe only once have I seen a bug in glibc[1]. [1] And it was both a horrible bug, and also an extremely weird corner case: https://bugzilla.redhat.com/show_bug.cgi?id=563103#c8 https://bugzilla.redhat.com/show_bug.cgi?id=563103#c8