3 ms·
On, no! Yet another "fun" language, i.e. a language that uses "fun" instead of the more standard "fn" or "func", just because it's 3-letters long and aligns bet
by nikolay 10y ago
On, no! Yet another "fun" language, i.e. a language that uses "fun" instead of the more standard "fn" or "func", just because it's 3-letters long and aligns better than 2- or 4-letter keywords (if you use 4-space indentation)! In fact, 2-letter indents are better - especially when your language suggests lines being less than 80-characters long!
- samuellb 10y agoThe Linux kernel has a code style with 8 spaces and still has the 80 characters maximum. The coding style says "if you need more than 3 levels of indentation, you're screwed anyway, and should fix your program.". So not everybody agrees that you need deep indentation. https://www.kernel.org/doc/Documentation/CodingStyle https://www.kernel.org/doc/Documentation/CodingStyle
- nikolay 10y agoThe kernel is in C. In OOP, there's at least one level coming from class declarations. 3 levels are more than normal in OOP!
- samuellb 10y agoThat's true. And in the OOP case you usually have exception handling (i.e. try/catch blocks) as well, instead of "goto error" style error handling which is common in C.