Skip to content

Instantly share code, notes, and snippets.

@liamzebedee
Last active May 11, 2023 02:36
Show Gist options
  • Save liamzebedee/f37a2e0d6ad5b2207be103def495a1aa to your computer and use it in GitHub Desktop.
Save liamzebedee/f37a2e0d6ad5b2207be103def495a1aa to your computer and use it in GitHub Desktop.
High-leverage skills for hackers
  • Terminal.
    • Master the Terminal.
    • Use zsh.
    • Show current git branch.
    • Reverse search your command history using Ctrl+R.
    • Quickly autocomplete commands by pressing up (again reverse search).
    • Delete+move quickly with cursor - use Alt+Left and Alt+Right to jump words. Alt+Del to delete a word.
  • Coding.
    • Use CoPilot and/or other coding AI.
    • Google things, ask ChatGPT for sample code, ask questions on StackOverflow and Twitter.
    • Repeat yourself twice before refactoring.
    • There are two modes in software design - divergent (exploring the problem) and convergent (narrowing down the solution).
    • During divergence, write all your code in one massive file.
    • During convergence, refactor and split into different files.
    • Use comments a lot -
      • Document and structure your code using headings. Imagine a military recipe. Use the comment to repeat what the code is doing, but in terms which are faster to understand.
      • Provide sample data and variables inside comments. This is helpful when explaining code that parses things.
    • Source control.
      • Git is a microblogging network for coders.
      • When there is only one user in your social network, you are writing to your future self.
      • Commit when you have achieved something. Commits are designed to be checkpoints for progress.
      • During divergent design, I find source control to be mainly useful as a backup mechanism. I do not bother with commit messages, they are overhead. Simply git commit -m .
  • Learning how to code.
    • Find a problem you have, and figure out how to solve it.
    • The most important skill in coding is the meta-skill - how fast can you learn?
    • Software engineering is generally a small set of ideas, expressed in 500 different ways. Greenspun's tenth rule - "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp."
    • The best tools:
      • Python - for data-related apps (ML, data science, data analysis, crawling), and basic scripting (files). Use with Numpy and Jupyter notebooks.
      • Javascript - for API's and bots. NPM package ecosystem is one of the best. Use with Typescript's compiler, tsc, to reap the benefits.
      • Docker and Docker Compose - for devops. Containerise your build environment so that other people can use it.
      • Next.js/React.js - for building modern web apps.
      • SQLite - for simple databases.
      • Django - for simple backends.
      • Go - for simple systems programming that uses concurrency.
      • Rust - for complex systems programming (browser engines).
      • Nix - a package manager for CLI tools. Much better than brew.
      • Markdown - simplest language to express formatted text in.
  • Software engineering.
    • Practice the MIT approach. "Worse is better".
      • Strive for completeness. Your software should address as much of the problem it solves as possible.
      • The interface should be simple, it is more important for the interface to be simple than the implementation.
      • Correctness - the design must be correct in all observable aspects. Incorrectness is simply not allowed.
      • Consistency - the design must not be inconsistent. A design is allowed to be slightly less simple and less complete to avoid inconsistency.
    • Learn functional programming.
      • Practice writing code which is functional - map, reduce, filter.
      • Remember that FP is a complement to imperative, procedural programming.
      • Writing using the FP paradigm will naturally produce reusable functions.
      • A parallel to this is the Linus Torvalds quote: "Bad programmers worry about the code. Good programmers worry about data structures and their relationships."
    • Document your process for later. Always. Whether it's in bash_history or in random markdown docs.
    • When working in teams, remember that software is principally a social process:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment