3 ms·
Is writing X in Y lines of code having any real meaning? I'm not trying to be negative, just genuinely asking. For example, in 1-line-of-code I can write "hell
by alberth 4y ago
Is writing X in Y lines of code having any real meaning? I'm not trying to be negative, just genuinely asking.
For example, in 1-line-of-code I can write "hello world". This hello world is physically lighting up individual pixels on my display. It's rendering the letters to be the shape "hello world" should be. It has antialiasing applied. All in 1 line of code!!!
- qsort 4y agoIt has some merit when you are comparing different solutions. For example (and I know people loathe python on here, I'm just using it for the sake of example, please bear with me), writing a simple web service in python takes fewer lines of code than doing the same in say, Rust. This doesn't imply that a language is better than another, it's just an objective fact one might find useful to keep in mind. The article's usage is admittedly clickbait, another recent article that popped up on the home page was titled something to the effect of "Speech Recognition in 100 lines of C++". Predictably, it turned out that they depend on a multi-million-line library.
- alberth 4y agoBut if you're importing in a library that might have 100,000 LoC just so that you can say you "wrote X in 12 LoC" ... is that really a far representation?
- eliasffyksen 4y agoI wrote more for the fun of it than anything else. The challenge was just getting it as small as possible, just for the sake of it
- ratg13 4y agohttps://en.wikipedia.org/wiki/Code_golf https://en.wikipedia.org/wiki/Code_golf
- auraham 4y agoI think that if someone can condense an algorithm using just a bunch of lines of code, that reflects a deep understanding of the problem domain. A lot of people can code an algorithm using a lot of lines of code. But it requires practice and experience to write short and expressive code. For example, Karpathy is famous for this, you can check his implementation of evolution strategies [1]. [1] https://openai.com/blog/evolution-strategies/ https://openai.com/blog/evolution-strategies/