3 ms·
> and I will absolutely attest to how much mental work is saved by ordering things this way. As you yourself noted, personal anecdotes are really not an argume
by dntbnmpls 6y ago
> and I will absolutely attest to how much mental work is saved by ordering things this way.
As you yourself noted, personal anecdotes are really not an argument. Someone could say they find Java easier to skim than Rust and we'd be nowhere. Like arguing which end of a boiled egg to crack first.
> As other posters have stated, this order makes parsing easier.
Programming languages don't exist to make itself easier to parse. They exist to make it easier for programmers to program. Otherwise, we wouldn't have such things like syntactic sugar. Hell we would just write in machine code and do away with assembly and higher level programming language. And parsing is a simple and superficial one time step. Being a tad bit more difficult is not a convincing argument.
> But I also suggest this benefit extends to your own brain's parsing ability as well.
Based on what evidence?
This is the problem with tech evangelism. It has the same problems as religions, lots of claims, no evidence.
- kelnos 6y ago> As you yourself noted, personal anecdotes are really not an argument. Then what is? If you're looking for a randomized sampling of programmers with sufficient sample size, you're not going to find it here. > Programming languages don't exist to make itself easier to parse. No, but a fine example is that of C++: the difficulty in parsing means that if you make a typo, the error message you get might be bizarre and confusing. A compiler for a language that's easier to parse will have a much better idea of the programmer's intent and can provide a much better error message. I find it astounding how often rustc can figure out exactly what I wanted to do and suggest it as a note after the error message. I would think that more-useful error messages pass your test of "make it easier for programmers to program". While we're talking about making it easier to program, "name: Type" make it possible to avoid typing out "Type" at all, and letting the compiler infer it (no, this isn't good and readable to do in all situations, but often it's fine). If you have "Type name" style, and try to add the ability to infer types, you end up with Java's "var" abomination. Regardless, I'm in agreement: I find "name: Type = blah" much easier to read. I read it as "name is a Type that is equal to blah". This also is an improvement in parameter lists, when they're lined up vertically: def foo(bar: String, baz: Int, quux: Foo) I find that much easier to mentally parse to determine parameter order than void foo(String bar, int baz, Foo quux) Worse, imagine that all three parameters were of the same type, requiring a scan to the right to read the names. The important information to me at a glance is the name of the parameter, not its type. As someone who cut his teeth on C and later Java, much later learning Scala and Rust, I immediately liked the style of the latter two much better. Lately I've been doing a lot of Java and get constantly annoyed at the "backwards" order. > This is the problem with tech evangelism. It has the same problems as religions, lots of claims, no evidence. I suppose you could argue that what I've written above is just personal preference, but I see it as a bit stronger than that.
- dntbnmpls 6y ago> Then what is? If you're looking for a randomized sampling of programmers with sufficient sample size, you're not going to find it here. Evidence. Maybe a study showing programmers have a natural preference? Or scientific evidence? Anything more convincing than "Rust evangelist" anecdotes. > No, but a fine example is that of C++: the difficulty in parsing means that if you make a typo, the error message you get might be bizarre and confusing. Difficulty parsing? If it didn't parse and found an error, then it means it didn't have any difficulty parsing. That has more to do with the complexity of the language itself than parsing. Parsing is a very simple matter. Or maybe the compiler for one language is better? Also, I thought we were comparing Rust to Java? > I would think that more-useful error messages pass your test of "make it easier for programmers to program". It does, but once again all you've done is provide anecdotes without any examples or evidence. > Regardless, I'm in agreement: I find "name: Type = blah" much easier to read. I don't. The most important part of "name: Type = blah" is the Type. So it's nice to have it first. But then again, there are people who love dynamic programming languages. So once again personal preferences and personal anecdotes aren't convincing arguments. > As someone who cut his teeth on C and later Java, much later learning Scala and Rust Yeah, I too fanboy over new languages I learn. But then I get over it and move on with my life. My guess is you just wrote toy programs in scala and rust and nothing substantive. > I immediately liked the style of the latter two much better. Lately I've been doing a lot of Java and get constantly annoyed at the "backwards" order. So then use Rust? Why are you using Java? > I suppose you could argue that what I've written above is just personal preference, but I see it as a bit stronger than that. I don't have to argue it. All you've provided is personal preference. "I find "name: Type = blah" much easier to read. " is personal preference. It's no more a convincing argument of anything than you prefering chocolate over vanilla shows that chocolate is better than vanilla.