News for hackers. Stuff that matters.
Re:"Useless Ruby sugar": Endless (one-line) methods by kevincox on Friday December 01, 2023 @01:47PM (#38490588)
This is also my main gripe with automatic formatting. Since they don't really understand the code they almost all work based on number of characters in a line. However I really don't care about characters in a line (except for at the extremes). What is much more important is how many ideas are in the line. If I have an array with 3 very interesting elements I don't want them on the same line even if they happen to be quite short.
Re:"Useless Ruby sugar": Endless (one-line) methods by JohnFen on Friday December 01, 2023 @01:53PM (#38490649)
Good formatters do understand the code, though. They parse it much like a compiler does.
Re:"Useless Ruby sugar": Endless (one-line) methods by kevincox on Friday December 01, 2023 @01:55PM (#38490672)
They understand the syntax of the code. They may even understand the types and relationships. They don't understand meaning and can only have very rough estimates at logical complexity.
Re:"Useless Ruby sugar": Endless (one-line) methods by vidarh on Friday December 01, 2023 @03:30PM (#38491912)
I've yet to experience a good formatter.