News for hackers. Stuff that matters.
Re:Why Use Nim over C#? by dmitriid on Wednesday March 01, 2023 @05:51AM (#34980918)
> I didn't get why fewer lines of code is better.

There have been a few studies showing that bugs-per-line-of-code is pretty consistent from language to language. So, if you can reduce the number of lines needed, you reduce the number of bugs.

There are also surely diminishing returns

Re:Why Use Nim over C#? by shaunsingh0207 on Wednesday March 01, 2023 @06:22AM (#34981120)
I'd bet rust is an outlier in that, a lot of languages require more code to do the same things, as a result of being simpler langs (lua). a lot of langs are very easy to shoot yourself with, more lines means more oppurtinity to shoot yourself.

In rust though, that 30 line python script probably takes 45 lines to write now. But those 15 lines aren't wasted or because of longer logic, rather those lines are used to convey type information

its not "more lines = more bugs" as it is "most languages don't put more lines to good use"

Re:Why Use Nim over C#? by planetis on Wednesday March 01, 2023 @12:54PM (#34985704)
I would find it easier to believe if 1. there was a sample, 2. you claimed that the extra 15 lines are just {} indentation. Btw here is the same build script in nim https://github.com/planetis-m/raylib-game-template/blob/mast... and in python https://gist.github.com/planetis-m/a437db724185215910a59c3b3... Which is shorter/more readable?

Note I could have used f-strings for both, I just don't like how they are rendered in my editor.

Re:Why Use Nim over C#? by Ygg2 on Wednesday March 01, 2023 @07:38AM (#34981692)
Correlation is not causation.

E.g. more cells means more cancer per 100k cells, right? Incorrect. Different species have different rates of cancer.