9 ms·
> Attempts to force good behavior invariably fail. Except this isn't forcing good behavior, it is forcing being explicit. Go ahead and use `!` it will work lik
by Guvante 12y ago
> Attempts to force good behavior invariably fail.
Except this isn't forcing good behavior, it is forcing being explicit. Go ahead and use `!` it will work like you are used to.
> No, annoying is not good. Annoying is annoying.
Different strokes for different folks. I for one think avoiding ambiguity is good given the ratio of code written to code read that most developers experience in their day to day lives.
> I once saw someone write that the 1st and foremost goal of a language was to disallow mistakes.
You are misinterpreting that requirement. What you are doing is you are forcing the choice to be made when you write the code. More flexible compilers make the choice when designing the language.
Many people believe that you know best when writing the code so stopping you there to correct it makes you avoid problems in the future, that is what "disallow mistakes" means.
As I said it is perfectly valid to instead say "I think the writers of the compiler have good enough defaults for these situations" but I for one don't trust them that much.
- mpweiher 12y ago>Except this isn't forcing good behavior, it is forcing being explicit. Go ahead and use `!` it will work like you are used to. That's not correct. `!` will crash without recourse where ObjC simply ignores the message and Java raises a catchable NPE.
- Guvante 12y agoIf you actually do a null check all of the languages work the same. Since in all but the prototype cases you will be doing a null check does it really matter? > ObjC simply ignores the message Don't quote this like a benefit please, it is a horrendous design. > Java raises a catchable NPE Only difference between this and a crash is in theory you can log. In the majority of cases a NPE is bringing you down anyway.
- mpweiher 12y ago>> ObjC simply ignores the message >Don't quote this like a benefit please, it is a horrendous design. Hmm..so the ? operator for optionals should removed from Swift?