Skip to content

Latest commit

 

History

History
63 lines (38 loc) · 3.4 KB

writing-code.md

File metadata and controls

63 lines (38 loc) · 3.4 KB

Readability

Reader should be able to figure out in a minute what a function does

Functions

What does the function do? Should be as long as it needs to be.

Refactoring

Cycle of reorganzing and rewriting to improve readabiity & testability

dwmkerr/hacker-laws - Laws, Theories, Principles and Patterns that developers will find useful

Learn more programming languages, even if you won't use them

Languages shape the way we think*, each in their own peculiar way. That’s true for programming languages as well. Each language contains a different mental model, a different perspective for thinking about computation and how to write programs.

Linux kernel coding style

Things I was wrong about when I started programming

Less code is not always better

  • I am now very eager to extend a function’s body by a line or two if I can introduce more clarity to the code to help me and my teammates understand it.

Some technical debt is OK

  • Bad code isn’t bad code because it’s written badly; it’s bad code if it slows you down, causes bugs for users, or constantly breaks. That’s the code you need to fix.

Software development is all about tradeoffs

  • The single most important skill for a developer in my opinion is to be humble, willing to admit that you made a mistake, but be eager to understand why your choice was wrong, how you could have realised that sooner, and learn from it

7 absolute truths I unlearned as junior developer

Not all experience is created equal

  • that’s why mentors are so important, and the team you work with is worth so much more than a couple bucks in your paycheck

Loads of companies and startups have little or no tests.

  • no company has a perfect tech setup.
  • being overly opinionated on topics you lack real-world experience with is pretty arrogant.
  • good enough is good enough.

Documentation lies sometimes.

  • focus on automation over documentation where appropriate.

Disorganized or messy code isn’t the same as technical debt.

  • Having some technical debt is healthy
  • If you think your codebase is free of technical debt, there is a good chance you’re over-emphasizing polish instead of delivery. And boy did I do that!

Applying the Gestalt Principles to your code

The Gestalt principles concern themselves with how we visually perceive groups of objects

(the) principles exist because the mind has an innate disposition to perceive patterns in the stimulus based on certain rules. These principles are organized into five categories: Proximity, Similarity, Continuity, Closure, and Connectedness.

  1. Similarity - group variables together
  2. Good form - if you have a well formed object you won’t notice the parts it’s made up of
  3. Proximity - the space between objects (close to similarity) -
  4. Closure - group formed if they appear to form a whole
  5. Continuation - intersection of two objects appears to the eye as one single object

Things I Learnt The Hard Way (in 30 Years of Software Development)