3 ms·
> Syntax and small API gotchas can be learned by a beginner programmer in a matter of days of using the language, and are fairly irrelevant to your overall expe
by saagarjha 7y ago
> Syntax and small API gotchas can be learned by a beginner programmer in a matter of days of using the language, and are fairly irrelevant to your overall experience.
I agree with the first part but not the second. One can only write
arraylist.add(arraylist.size() - 1, arraylist.get(arraylist.size() - 1) + 1)
before wondering if there’s a better way to do this.
- kerkeslager 7y agoEven if your language doesn't support a better syntax, it probably supports functions, so you don't have to write this over and over again. Just pull out into `appendLastIncremented(ArrayList a)` and call that. You'll have forgotten the pain of writing that function within an hour. I'll never forget the pain of debugging a {bar: 1}.baz returning undefined (failing silently) and then going into a future inside a minified 0.0.2 versioned library that doesn't do any constraint checking before finally throwing an exception. Nor will I forgive JavaScript for this.
- saagarjha 7y agoI don’t want to write a random free function for one line of code. I want nice syntax: list[-1] += 1 array.last += 1 *(vector.end() - 1)++; Having reasonable syntax and a strong type system are not mutually exclusive.
- kerkeslager 7y ago> I don’t want to write a random free function for one line of code. I want nice syntax shrug Sure, me too, everybody wants nice syntax. What I'm saying is that syntax is never the most important problem with a language. People talk about problems with syntax because they're easy to understand, and the more important problems with a language are much harder to understand and talk about. If a genie told me I could wish for three problems with Python to be instantly fixed, none of them would be syntax. I can't think of a language I've used where syntax would be on the list.