1,442 karma · joined October 14, 2015
this.setState({this.state: val})
which was already pushing limit of normal behavior which is
state.A = val
just to be revise
i went from having to do
state.onlineStatus = 'active'
to
const [onlineStatus, setOnlineStatus] = useState('active')
Instead of being able to get autocomplete and normal refactoring you would get from plain js.. now you need to add typescript to supplement the mess...
const obj = {
onlineStatus: 'inactive', shoppingCart: '3899x', lastActive: 1834393939 }
obj. [autocomplete anywhere in the project]
vs MORE Boilerplate
Ultimately, I think even the choice of naming something and using a single letter communicates your intentions. If you make something a single letter then you're telling the reader that do not even worry about this variable it is just passing through, but if you need something your communicating your intentions of using this variable in the future it is more permanent in a sense
// get users older than 90
a = data.results;
b = a.filter(u => u.dob > 123456)
seniorUsers = b.map(x => {name: x.name, age: x.age})
// self contained
// comes out with one final var that is named to be used later on
// other vars are obviously meant to be ignored and just placeholders
// comment explains what is happening so each var doesn't need sacrifice comprehension speed
you give investors equity
you use that money to pay for services, like a logo
you exchanged equity for logo, what's unclear there?