3 ms·
I think otherwise. Curly braces and semicolons do not serve a purpose. My only beef with F# is multi line expessions...indentation is sometimes weird.
by verinus 8y ago
I think otherwise.
Curly braces and semicolons do not serve a purpose.
My only beef with F# is multi line expessions...indentation is sometimes weird.
- kkarakk 8y agocurly braces enable code readability, you know where to start reading and you know where to stop reading. the situation is the same with the semicolon. programming languages are written to be read by humans and humans do better with start and stop points. if i've ever blearily looked at code at 3 in the morning,i basically run on autopilot relying on the braces and the semicolons to guide my eyes
- sparkie 8y agoIf you use VS or Monodevelop, there's are options you can enable which show indentation margins, which is even better than braces. Seems like a non-issue.
- Koshkin 8y agoBasically, you are discussing an attempt to move away from the purely textual, linear representation of program code (at least, in the way the programmer sees it). Yes, sophisticated tooling becomes very important then. But it is not always available.
- sparkie 8y agoI wouldn't say it's really sophisticated tooling. Many basic editors support visual whitespace in one form or another. Some insert a semi-opaque character in place of tabs/spaces, and others show rulers. F# is whitespace sensitive, so you need to stick to correct tab sizes anyway, and it becomes quite readable. For types, you can also add `class`, `interface`, `struct` at the start and `end` on the correct indentation after its definition to show a clear boundary. type X() = class member this.X = ... end
- phillipcarter 8y agoPretty much any modern C# editor tooling will do this as well. People want tools to show scope even if they use a brace-y language.
- verinus 8y agoas I have yet to see source code that is not properly formatted I do not agree. I also think, that formatting code should be a non issue and should be handled by editor preferences. The true problem is, that lots of devs think they write code when they truly define models that a represented by text. Bottom line is: readability is very important, but we should have tooling that helps us with that. e.g: I want coloring for a block not to parse text for a closing brace.