4 ms·
This language looks incredible. I like the code examples and was really sold when I read its point number 2 about functions and no inheritance. The only frustr
by austincheney 8y ago
This language looks incredible. I like the code examples and was really sold when I read its point number 2 about functions and no inheritance.
The only frustration I immediately notice is strong reliance on white space for syntax.
* This makes life harder in a modern world of various operating systems and high distribution. Some means of distribution mutilate white space. XML language design spent enormous effort considering for this.
* Line termination differs by OS. Now it’s largely just posix vs Windows, but there used to be even more variance and there could be more in the future.
* Parsing around white space is severely misunderstood by people who do not write parsers regularly. Just this weekend I encountered unique white space syntax added into React’s JSX to compensate for this that doesn’t exist anywhere else in either JS or XML.
* As somebody who maintains a popular code beautifier I have had to learn the hard way that people really enjoy flexibility around white space. They deliberately use my software instead of, or in addition to, the popular software coming out of Facebook because of the flexibility my software allows. The bottom line for many developers is that code beautification can be fully automated and is better performeded by computers and should never be a factor when authoring code.
* code beautification is also highly subjective. Everybody has different opinions on beauty and easy to read. Providing the means to allow developers to exercise those opinions dynamically and automatically makes people happy. So long as it’s just vanity the code stills executed and reads the same way.
- jaredklewis 8y ago> * This makes life harder in a modern world of various operating systems and high distribution. Some means of distribution mutilate white space. XML language design spent enormous effort considering for this. Distributing source code with significant white space seems like a totally solved problem to me. When has this come up for you? > Line termination differs by OS. Now it’s largely just posix vs Windows, but there used to be even more variance and there could be more in the future. Why would there by more types of line terminators in the future? We already have two ways to do it, which is one too many. Who would add another? And if they did, why would all the text editors and software out there in the world be expected to adopt it? > * code beautification is also highly subjective. Everybody has different opinions on beauty and easy to read. Providing the means to allow developers to exercise those opinions dynamically and automatically makes people happy. So long as it’s just vanity the code stills executed and reads the same way. Personally, I don't care about people's subjective opinions or what makes them happy. I just want to be able to easily understand what the code does. I find it easier to understand code when it is formatted in a way that I'm familiar with. If each programmer has their own little formatting idiolect, that makes it harder for me to read their code. So, I think it's great when standardized formatting is built into languages, either with formatters (like go and elixir have) or by having a syntax that enforces uniform formatting (as is the case here).
- austincheney 8y ago> Personally, I don't care about people's subjective opinions or what makes them happy. I just want to be able to easily understand what the code does. I read that as only caring that people are forced to do what makes you happy. To me that sounds extremely selfish, perhaps psychotic. Different things make different people happy. I try to be objective about that.
- jaredklewis 8y agoMacros make some people happy, so what, all languages should have macros? And, oh yea, consistent formatting between projects makes me happy. Different people have different preferences and they can’t all be accommodated. Not sure how me advocating the trade off of consistent formatting over allowing formatting idiolects makes me “psychotic.”
- fnord123 8y ago>* code beautification is also highly subjective. Everybody has different opinions on beauty and easy to read. Providing the means to allow developers to exercise those opinions dynamically and automatically makes people happy. So long as it’s just vanity the code stills executed and reads the same way. No. Formatters have won. All code should be run through a formatter that contains zero options. The result is the how the code looks. Obviously languages with significant whitespace are more limited in what their formatters can do, but the point about it being subjective is irrelevant.
- bauerd 8y agoYou forgot to mention why formatters would be superior. I do share your opinion, and the two reasons I can think of are (1) consistency and (2) short-circuits style discussions in code review.
- gigatexal 8y agoI agree. Gofmt is an opinionated know-it-all jerk but a fair and consistent one at that.
- austincheney 8y ago> a formatter that contains zero options Why must the formatter be opinionated? Why should a single form of vanity be forced on users? If my software were so opinionated nobody would use it.
- nickmqb 8y agoThanks! See my comment re: whitespace here: https://news.ycombinator.com/item?id=19599908 https://news.ycombinator.com/item?id=19599908