ultramancool
Joined 14 years ago
Joined 14 years ago
getDescription simply needs to return a Description object while getTitle returns a Title object. Duh.
Only in the final rendering should it get turned into a string and there it should only accept a Title type for doing so.
Okay, I'm kind of joking, but this is seriously the solution if you really want to get down to it - primitive overuse is the problem, so wrap it in a type that makes it explicit. You need cheap and easy types to take full advantage of this sort of thing.
EDIT: And even with those reading code developed in such a way may go overboard at some point. I'm not sure as I haven't really seen it done to the fullest extent possible. Typically even when taking a fairly strong advantage of such a type system, unit tests and stuff are still used, but theoretically you could enforce their parameters entirely in the type system. Of course, that enforcement can also be incorrect, but it does make it clearer in many cases.
I run devops though for a small business and we've avoided the issue entirely using runit for our software.
I can get a device like a OnePlus 3 for about 60% of the price and it has better hardware to boot. In terms of storage, RAM and CPU it's more comparable to a OnePlus 2 which is about 40% of its price.
Keyboard is nice, but not double the price and lose features I rely upon like AdAway and XPrivacy kind of nice.
https://f-droid.org/repository/browse/?fdid=org.schabi.newpi...
Of course, just doing this would be illegal on most proprietary operating systems.