3 ms·
> Programs are written first and foremost to be read by other humans extremely bold assumption. plenty of write-only or use-once code in the wild.
by jcelerier 4y ago
> Programs are written first and foremost to be read by other humans
extremely bold assumption. plenty of write-only or use-once code in the wild.
- tialaramex 4y agoFair, lets modify that to just "humans" not "other humans" and say instead that programs should be written first and foremost with this in mind. I have never discovered a reliable way to discern whether I will re-use some code. Of course I could just delete it after first use and declare it "use-once" that way, but that's cheating, if I just have to type in the same program tomorrow we should admit that deleting it and rewriting it was a pessimisation. In the specific case of volatile parameters I can't figure out whether writing this in use-once code is more stupid or less stupid. On the one hand, you aren't misleading anybody else because the compiler knows perfectly well this doesn't do anything, on the other hand with the only human participant being yourself maybe you think it does something and whatever that is you're wrong so that's very bad.
- throwawaymaths 4y agoOther humans is fine if you include "yourself, in the future" as an "other human" in the ship of Theseus sense
- ModernMech 4y agoI think if write-only code were the norm, then APL would be more popular.
- jcelerier 4y agoBut there are APL, k, j and other array lang programs. You can't do as if those don't exist when talking about programming as a whole. Perl used to be pretty popular too.
- ModernMech 4y agoI didn't say array programming doesn't exist, I said it's not popular. How many people actually use those languages compared to e.g. Python, where readability is one of its main features. > Perl used to be pretty popular too And now it’s a meme due to how illegible it is. I’ll put it this way, there’s a reason Brainfuck is a joke lang instead of something people seriously use. Also, reading and writing are not orthogonal skills. One has to read to be able to write. I read my programs constantly as I'm writing them.
- jcelerier 4y agoand I am not writing about popularity, just saying that there are many in an absolute sense (which is honestly the only thing that matters in practice, relying on popularity of things relative to each other in a state of abundance is absolutely stupid)
- ModernMech 4y agoThen I don’t understand your point. The initial claim was that programs are written for human consumption first and foremost. To me, you seem to be replying that programming languages exist that are write only. In that case, agreed. But I don’t see how that is meant to counter the claim that programs are written for humans.
- jcelerier 4y agoI disagree with the "first and foremost" part - more precisely, I don't think it makes any sense to speak about this. There are people whose entire career will be only APL-ish or whatever funky ML-derived dialect, writing programs in a team of 1 and basically converting their thought processes directly into code, and their experience matters exactly as much as the experience of the X million developers in easier / more team/read-oriented languages matters.
- gpderetta 4y agoK is very niche, but in its niche is a extremely popular.