Gleam Style Guide #3785
Replies: 3 comments 2 replies
-
Often |
Beta Was this translation helpful? Give feedback.
-
From my point of view between the highly constrained nature of Gleam and the inclusion of a formatter there's not need for a style guide like this. The idea was that rather than having a large set of rules to nit-pick the environment should result in your writing code that would already conform to the desired style. This should overall provide a much more comfortable programming experience. That said, it's not a perfect system, so there's still things to advise, likely at a higher level than those guides. I intend to write more about how to write Gleam code next year. |
Beta Was this translation helpful? Give feedback.
-
Semi-OT: The _loop suffix seems great for people coming to FP and wondering how to loop not knowing much about vanilla recursion (or tail recursion) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, Gleam is my most favorite programing language! But while I learning it, I just fell kind of unsure if the way I write my code, the name I named values and functions are truly correct or optimal. I want to know the DO and DON'T of Gleam, it's would be nice to have a Gleam Style Guide like Ruby Style Guide, Godot Style Guide or Rust Style Guide that help newcomer to improve their skill with Gleam and also set a standard so that Gleam code across projects and teams can be more consistent.
E.g: How do you name the function that do internal recursion stuffs for a interface function that other actually call? I saw it got postfix with
_loop
in one of Gleam tour example, but is this the standard?Beta Was this translation helpful? Give feedback.
All reactions