6 ms·
"You can write bad code in any language" is fairly proven. Can you write good code in any language, though? At least, good enough? It's quite hard to study obj
by kerkeslager 7y ago
"You can write bad code in any language" is fairly proven.
Can you write good code in any language, though? At least, good enough? It's quite hard to study objectively, but my subjective opinion is "no". Trivially, brainfuck certainly doesn't cut it, but even if you're only looking at serious languages geared toward general, production-quality programming, there's a lot of programming languages that are much easier to make mistakes in or abuse than others.
- akira2501 7y ago> Can you write good code in any language, though? Yes, absolutely. > At least, good enough? I think the better question is, can you write good code in a particular language and still make deadline?
- kerkeslager 7y agoI'd say you can't write good enough code in any language. The most high-profile, extensively tested C networking code still has security vulnerabilities, for example--the best C code isn't good enough. And broadly speaking, I'd say good code meets deadlines, but I guess that's a bit of semantics on my part.
- akira2501 7y ago> extensively tested C networking code still has security vulnerabilities Are you familiar with Daniel J Bernstein? > the best C code isn't good enough Are you sure _you've_ seen the _best_ code? Are you sure you understood the constraints of those writing that code when you evaluated it? > I'd say good code meets deadlines I'm trying to say there's an obvious compromise between the two, which explains the wide spectrum of code quality.
- mantap 7y agoIf you have to be DJB or Bellard to write good code in a programming language, that programming language probably has a problem. I used to write a lot of C back in the day, but I have to admit that C++ code is far more reliable and maintainable, which is a damning thing to say about any programming language.
- kerkeslager 7y agoI am somewhat familiar with Daniel J. Bernstein, but you'll have to enlighten me on why you've brought him up. If you're referencing programs where half the source code is written in a theorem proving language like CoQ, that's not really "written in C", now is it?
- ncmncm 7y agoDonald Knuth is quite fond of C. He writes checks to people who find bugs in his code. They are quite valuable, because they are very rare.
- ahhhhhhhhhhb 7y agoso rare, industry defining geniuses can avoid fucking up too much with unquantified effort and no real deadlines or pressure to produce. got it
- ncmncm 7y agoIf you were as productive as Donald Knuth, you would have reason to be very proud.
- pjmlp 7y agoTex was implemented in Pascal and uses web2c to generate C code. https://en.wikipedia.org/wiki/TeX https://en.wikipedia.org/wiki/TeX Had he implemented it directly in C he would be sending checks every day.
- deleted 7y ago[deleted]
- jstimpfle 7y ago> Had he implemented it directly in C he would be sending checks every day. He used Pascal maybe not for the reasons you think. Remember it was the early 70s. If you actually look at the TeX source code, I'm pretty sure you won't find the kind of Pascal you envision. Nowadays, Knuth does use C directly. (FWIW)
- kerkeslager 7y agoNot networking code.
- fgonzag 7y agoI don't see how anything written in brainfuck could ever be called good code.
- coldtea 7y agoThat's because you focus on surface syntax. In the end brainfuck is just a fancy assembler. You could very well write nicely formatted, structured etc brainfuck. It will just look weird because the (otherwise very simple operations) have a weird sigil syntax.
- jstimpfle 7y agoCome on, that's as objectively false as it gets. Brainfuck doesn't give you macros, function calls, function structures. It doesn't have names for anything. In other words there is zero syntactic and physical abstraction. The programmer must assemble everything on their own, with extreme repetition, making it extremely hard to see structure, or to change it. You can't even write efficient code in it since basic arithmetic operations (like addition, indexing) are O(n).