3 ms·
Once you get used to it it’s not that bad. Editors make a macro of it so you hardly ever type it out.
by gigatexal 7y ago
Once you get used to it it’s not that bad. Editors make a macro of it so you hardly ever type it out.
- erik_seaberg 7y agoGenerating boilerplate is easier than reading it over and over. We need an IDE than can at least hide it and focus on the 1/4 of the lines that do something.
- convolvatron 7y agoits a bit of a drag. one niggling thing is that if, should it return a zero value along with the nil, means you have to be explicit about which zero value you are using..so refactoring function return types involves touching each of these. not the end of the world, just sad. i do wish there were a type-unified zero value, or that "" and 0 were the same as nil, or some other solution here
- gigatexal 7y agoYeah I have a function like this: return a *struct, err where a nil struct could be the result of a empty result from the database query that was just run or an error if the query had an error. And then the logic of that function is if a job was returned quit early (I’m preventing two things from happening on the DB side). But then there’s an annoying dance of checking if the job is nil and the error is nil that’s the happy path... you can see how this makes the just if the check err is nil usual path welcome