Browse Source

Merge branch 'release/20190717'

master 20190717
Julio Biason 5 years ago
parent
commit
3aed9453d0
  1. 5
      content/books/things-i-learnt/_index.md
  2. 6
      content/books/things-i-learnt/code-style/index.md
  3. 2
      content/books/things-i-learnt/config-file/index.md
  4. 2
      content/books/things-i-learnt/debuggers/index.md
  5. 2
      content/books/things-i-learnt/google-code-style/index.md
  6. 2
      content/books/things-i-learnt/integration-tests/index.md
  7. 3
      content/books/things-i-learnt/optimization/index.md
  8. 43
      content/books/things-i-learnt/specialists/index.md
  9. 24
      content/books/things-i-learnt/stupid-bugs-list/index.md
  10. 29
      content/books/things-i-learnt/units/index.md
  11. 35
      content/books/things-i-learnt/users/index.md

5
content/books/things-i-learnt/_index.md

@ -19,6 +19,7 @@ template = "section-contentless.html"
* [Learn The Basics of Functional Programming](functional-programming)
* [Shortcuts Are Nice, But Only In The Short Run](understand-shortcuts)
* [Debuggers Are Overrated](debuggers)
* [Think About The Users](users)
* Testing Software
* [Unit Tests Are Good, Integration Tests Are Gooder](integration-tests)
* [Testing Every Function Creates Dead Code](tests-dead-code)
@ -51,6 +52,7 @@ template = "section-contentless.html"
* [Always Use Timezones With Your Dates](use-timezones)
* [Always Use UTF-8 For Your Strings](use-utf8)
* [Optimization Is For Compilers](optimization)
* [Units Makes Things Clear](units)
* Making Things Go
* [The Config File Is Friend](config-file)
* [Command Line Options Are Weird, But Helpful](command-line-options)
@ -67,3 +69,6 @@ template = "section-contentless.html"
* [Code Formatting Tools Are Ok, But No Silver Bullet](code-formatters)
* [Code Style: Follow It](code-style)
* [... Unless That Code Style Is The Google Code Style](google-code-style)
* Personal
* [Companies Look For Specialists But Keep Generalists Longer](specialists)
* [Keep A List of Stupid Bugs That Took More Than 1 Hour To Solve](stupid-bugs-list)

6
content/books/things-i-learnt/code-style/index.md

@ -23,4 +23,10 @@ And remember that even your stupid code is [part of the ecosystem of the
language](/books/things-i-learnt/languages-are-more) and the better you
interact with the ecosystem, the better citizen in the ecosystem you are.
**TIP**: If you don't have a code style yet, and you're using a language
that's derived from C or C++, use [K&R
Style](https://en.wikipedia.org/wiki/Indentation_style#K&R_style); if you're
working with Python, there is only one style:
[PEP8](https://www.python.org/dev/peps/pep-0008/).
{{ chapters(prev_chapter_link="/books/things-i-learnt/code-formatters", prev_chapter_title="Code Formatting Tools Are Ok, But No Silver Bullet", next_chapter_link="/books/things-i-learnt/google-code-style", next_chapter_title="... Unless That Code Style Is The Google Code Style") }}

2
content/books/things-i-learnt/config-file/index.md

@ -52,4 +52,4 @@ you'll find that you're half-way through it.
[^1]: In other words, they have a [time to
live](https://en.wikipedia.org/wiki/Time_to_live).
{{ chapters(prev_chapter_link="/books/things-i-learnt/optimization", prev_chapter_title="Optimization Is For Compilers", next_chapter_link="/books/things-i-learnt/command-line-options", next_chapter_title="Command Line Options Are Weird, But Helpful") }}
{{ chapters(prev_chapter_link="/books/things-i-learnt/units", prev_chapter_title="Units Makes Things Clear", next_chapter_link="/books/things-i-learnt/command-line-options", next_chapter_title="Command Line Options Are Weird, But Helpful") }}

2
content/books/things-i-learnt/debuggers/index.md

@ -37,4 +37,4 @@ Again, I'm not taking the merits of debuggers, but in the long run, they are
mostly useless and actually point missing surrounding support to actually
understand what's going on.
{{ chapters(prev_chapter_link="/books/things-i-learnt/understand-shortcuts", prev_chapter_title="Shortcuts Are Nice, But Only In The Short Run", next_chapter_link="/books/things-i-learnt/integration-tests", next_chapter_title="Unit Tests Are Good, Integration Tests Are Gooder") }}
{{ chapters(prev_chapter_link="/books/things-i-learnt/understand-shortcuts", prev_chapter_title="Shortcuts Are Nice, But Only In The Short Run", next_chapter_link="/books/things-i-learnt/users", next_chapter_title="Think About The Users") }}

2
content/books/things-i-learnt/google-code-style/index.md

@ -16,4 +16,4 @@ The only reason to use Google Code Style is in case someone less smart than
you decided it would be a good idea to use it. Then, I feel sorry for you, but
you'll have to follow Google Code Style.
{{ chapters(prev_chapter_link="/books/things-i-learnt/code-style", prev_chapter_title="Code Style: Follow It") }}
{{ chapters(prev_chapter_link="/books/things-i-learnt/code-style", prev_chapter_title="Code Style: Follow It", next_chapter_link="/books/things-i-learnt/google-code-style", next_chapter_title="... Unless That Code Style Is The Google Code Style") }}

2
content/books/things-i-learnt/integration-tests/index.md

@ -72,4 +72,4 @@ of moving parts.
[^2]: Again, it's pure feeling from my experience. I have no data to back that
affirmation up, so take it with a grain of salt.
{{ chapters(prev_chapter_link="/books/things-i-learnt/debuggers", prev_chapter_title="Debuggers Are Overrated", next_chapter_title="Testing Every Function Creates Dead Code", next_chapter_link="/books/things-i-learnt/tests-dead-code") }}
{{ chapters(prev_chapter_link="/books/things-i-learnt/users", prev_chapter_title="Think About The Users", next_chapter_title="Testing Every Function Creates Dead Code", next_chapter_link="/books/things-i-learnt/tests-dead-code") }}

3
content/books/things-i-learnt/optimization/index.md

@ -35,5 +35,4 @@ Code is written for humans to read. _ALWAYS_. Optimization is what compilers
do. So find a smarter way to explain what you're trying to do instead of using
shorter words or messing with that your code is saying.
{{ chapters(prev_chapter_link="/books/things-i-learnt/use-utf8", prev_chapter_title="Always Use UTF-8 For Your Strings", next_chapter_link="/books/things-i-learnt/config-file", next_chapter_title="The Config File Is Friend") }}
{{ chapters(prev_chapter_link="/books/things-i-learnt/use-utf8", prev_chapter_title="Always Use UTF-8 For Your Strings", next_chapter_link="/books/things-i-learnt/units", next_chapter_title="Units Makes Things Clear") }}

43
content/books/things-i-learnt/specialists/index.md

@ -0,0 +1,43 @@
+++
title = "Things I Learnt The Hard Way - Companies Look For Specialists But Keep Generalists Longer"
date = 2019-07-17
[taxonomies]
tags = ["en-au", "books", "things i learnt", "jobs", "specialists", "generalists"]
+++
If you know a lot about one single language, it may make it easier to get a
job, but in the long run, language usage dies or loses its charms and you'll
need to find something else. Knowing a bit about a lot of other languages
helps in the long run, not to mention that may help you think of better
solutions.
<!-- more -->
Even if you're in a shop that is mainly in one single language, that's no
excuse to not check other languages. But, then again, learning languages that
are just small changes on the current language would not help you either.
Alan Perlis, author of the ALGOL language, has one excellent phrase: "A
language that doesn't affect the way you think about programming, is not worth
knowing."
I still maintain one single rule for programming languages: The language I use
at work must not be the same language I use outside it[^1]. That simple rule
made sure I was always learning something new.
Learning a new language can also help you understand things in some language
you used before: Rust help me understand how generics works in Java; seeing
how to do dependency injection in C++ help me understand how Spring does it in
Java.
On top of that, because I was always learning something new, moving between
projects was something that happened a lot. At one point, I was hired to work
with Python, but the contract was taking too long to be signed, and my manager
asked if I could help some other team with their iOS application. Because I
did learn a bit about Objective-C, surely I could help. Later, another project
in C show up and guess who also knew C?
[^1]: ... which led me into some sad times when I was working with Python.
{{ chapters(prev_chapter_link="/books/things-i-learnt/google-code-style", prev_chapter_title="... Unless That Code Style Is The Google Code Style", next_chapter_link="/books/things-i-learnt/stupid-bugs-list", next_chapter_title="Keep A List of Stupid Bugs That Took More Than 1 Hour To Solve") }}

24
content/books/things-i-learnt/stupid-bugs-list/index.md

@ -0,0 +1,24 @@
+++
title = "Things I Learnt The Hard Way - Keep A List of Stupid Bugs That Took More Than 1 Hour To Solve"
date = 2019-07-17
[taxonomies]
tags = ["en-au", "books", "things i learnt", "lists", "stupid bugs"]
+++
If it took you more than one hour for you to figure out what went wrong, it is
a good idea to put it on list, 'cause these things have the tendency to appear
again.
<!-- more -->
I must admit that this is one thing that I should be doing, but I keep
forgetting. The worst part: It usually takes me about an hour to figure out
what went wrong, only to realize by the solution that I had the same problem
(with the same solution) before and it took me about one hour to figure out
what went wrong.
If I just had a list of stupid bugs that took me about 1 hour or more to
solve, I wouldn't be stuck for another hour figuring out what went wrong.
{{ chapters(prev_chapter_link="/books/things-i-learnt/specialists", prev_chapter_title="Companies Look For Specialists But Keep Generalists Longer") }}

29
content/books/things-i-learnt/units/index.md

@ -0,0 +1,29 @@
+++
title = "Things I Learnt The Hard Way - Units Makes Things Clear"
date = 2019-07-17
[taxonomies]
tags = ["en-au", "books", "things i learnt", "units", "explicit"]
+++
You know what's one of the worst function names ever? `sleep()`.
Sleep for how long? It is seconds or milliseconds?
<!-- more -->
Now let me ask you this: Would it clearer if the function was called
`sleepForMs()`? Would you understand that the function would make the
application sleep for a number of milliseconds?
What about `sleepForSecs()`? Do you understand that this will force your
application to sleep for a number of seconds?
What if, instead of using the function name, you could use `sleep("10s")`? Does
it make clear that you want it to sleep for 10 seconds?
That's why adding units to the function or parameters make sense. It removes
the ambiguity of what it means and doesn't rely on some specialized IDE/Editor
that display the parameter names.
{{ chapters(prev_chapter_link="/books/things-i-learnt/optimization", prev_chapter_title="Optimization Is For Compilers", next_chapter_link="/books/things-i-learnt/config-file", next_chapter_title="The Config File Is Friend") }}

35
content/books/things-i-learnt/users/index.md

@ -0,0 +1,35 @@
+++
title = "Things I Learnt The Hard Way - Think About The Users"
date = 2019-07-17
[taxonomies]
tags = ["en-au", "books", "things i learnt", "privacy"]
+++
Think how the data you're collecting from your users will be used -- this is
more prevalent on these days, where "privacy" is a premium.
<!-- more -->
I once had a discussion with a CTO about collecting the user IMEI on our
mobile app. Basically, there was no use case for capturing that information
yet but, as he put at the time, "We may want to know if one user uses two
phones, or if two users use the same phone". I raised the fact that we didn't
need this information and, besides that, it felt like we were invading the
users privacy. He still decided to go ahead. My answer: "I'll do it, but I
want to point that I'm not happy with it."
In the end, the store blocked the app... because we were capturing the IMEI.
But there are cases and cases. If you really _really_ need to capture user
information, be sure to protect it against unauthorized use, be it by external
forces (someone found a way to attack your data) or internal (some disgruntled
colleague decided to take the data from your users with them).
And be sure, there _will_ be a leak at some point, it's just a matter of time.
If you can, the best way to protect your users data is to never capture it.
When a flaw on your system is found or when some colleague leaves the company
in bad terms, there will be no data to expose to the world, anyway. You can't
be more secure than this.
{{ chapters(prev_chapter_link="/books/things-i-learnt/debuggers", prev_chapter_title="Debuggers Are Overrated", next_chapter_link="/books/things-i-learnt/integration-tests", next_chapter_title="Unit Tests Are Good, Integration Tests Are Gooder") }}
Loading…
Cancel
Save