TypeScript tip:
If you don't know the type of something, use `unknown` instead of `any`
any basically means I don't care about this type, just let me do anything on it. That's bad
unknown, however, means I don't know this type and I'm not really using it. That's much better
Learning React or Node today?
Retweet and follow, and I'll DM you a 100% coupon code for my 2 books, React beyond the basics and Node beyond the basics.
Note: The books are still a WIP so any feedback will be greatly appreciated.
Happy Father's Day to all dads and single moms!
If you have to review commits that have mixed whitespace changes, you can use the --color-words diff option to ignore the whitespaces changes.
git diff --color-words
Git tip:
Put any non-significant changes that do not affect the code in separate commits.
Examples: trailing whitespaces/eol, code formatting
Don't mix them with other code changes because it makes reviewing a lot harder.
REST is great for resources that are independent of each other.
When you introduce relationships, things become a graph.
Querying a graph with a REST API is like eating a salad one vegetable at a time.
Learning GraphQL is learning 2 languages:
The language used by services to describe schemas: object types, scalars, lists, enums, unions, interfaces
The language used by consumers to describe data needs: queries, mutations, subscriptions, fragments, fields, aliases, directives
Command line tip:
The $_ bash command variable holds the most recent used parameter.
For example, you can:
mkdir ~/some/path
Then:
cd $_
to get into that new directory.
Coding Tip: When you need to take a long break, or at the end of the day, leave your code in a problem state (red test, error on screen, ...)
This makes it easier for you to resume and remember exactly where you left things off.