John Leacox (@johnlcox) profile picture

Software Engineer and Philosopher. I think deeply about code quality, abstractions, and how to teach and learn high level programming skill.

Overland Park, KS
Joined February 2009
Photo by John Leacox (@johnlcox)Photo by John Leacox (@johnlcox)Photo by John Leacox (@johnlcox)Photo by John Leacox (@johnlcox)Photo by John Leacox (@johnlcox)Photo by John Leacox (@johnlcox)
I've been thinking a lot about @karlicoss's personal infra page: beepb00p.xyz/myinfra.html and how I've accidentally started building something similar for extracting my book highlights from @BookFusionHQ and reformatting them into my @RoamResearch knowledge base.
1
I've also been building a custom text expansion app to help me with my common snippets across multiple operating systems.
1
This is great advice. Writing Architecture Decision Records (ADRs) and storing them with the system is a good way to track why a particular approach was taken. The ADR can be referred back to, to recall why a decision was made rather than second-guessing it due to forgetting.
"How do I get better at designing systems?" Next time you design something, architect it two different ways. Choose the better approach and explain the tradeoffs. WHY did you not choose the other design? Even better, write all of this down and share with your team.
3
While the SOLID programming principles are largely defined in terms of Object-oriented programming, they can often also be applied in other programming paradigms. For example, the Open-Closed Principle can be implemented via higher order functions / anonymous function params.
2
I think a key skill in programming is being able to operate at two (or more) levels of abstraction simultaneously. 1. The consumer of the code - what the code does 2. The owner of the code - how it does it
This quoted post is unavailable.
1
Two Astronauts are launching to space from US soil (Kennedy Space Center) for the first time since the Space Shuttle was retired in 2011, today at 4:33 EDT, weather permitting.
I suspect that abstraction is the core programming skill beyond language syntax. We don't (yet) have a good way of talking about abstraction skill or measuring the quality of the resulting abstractions created in using the skill.
1
Programming principles and patterns are nice heuristics that often result in higher quality abstractions and code, but they don't get at the root of the issue of good/bad abstractions and the skill required in creating them.
1
The Single-Responsibility Principle is a guiding principle that can help to create more cohesive code.
1
Code that has high cohesion is usually considered to be better than code with low cohesion, but this is a property of code rather than a guide on how to reach it.
The DRY principle -- Don't Repeat Yourself -- says "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." Here is an overview of what that means (a thread)
1
1
Note that the DRY principle -- as with all programming principles -- is a guideline rather than a hard and fast rule. Value judgements are required when using it, and there is a lot of grey area.
1
A simple (but not easy) way to improve your code quality is to only call it done when you fully understand the code you have written; only merge it or open a pull request after you understand it.
1
2
1
3
Simple because it does not require specific knowledge of broad programming principles and patterns or other technical jargon, but not easy because it requires effort on your part to learn or make additional changes to the code.
1
For @MisfitLabsDev projects we really like the open source project ecsrx for use with @unity3d. Today we are starting an open source plugin for authoring ecsrx components in the Unity Editor similarly to the Unity.Entities preview package. github.com/misfitlabsdev/ecs…
2
1
I enjoy reading the relevant RFCs for code I'm implementing or reviewing, but I've found there are often ambiguities left for interpretation. For example, @boogaard_b and I often interpret aspects of a particular RFC in wildly different ways.
2
Sometimes this ambiguity can be narrowed or removed by reading other RFCs and interpreting things in one RFC the same as they are explain in the other RFCs even when it isn't explicitly called out.
The DRY principle isn't about code duplication it is about knowledge duplication. Duplicate code is okay when it's coincidentally duplicated as part of 2 or more different pieces of knowledge.
I added a Now Page, with what I'm currently doing and thinking about, to my website based on the idea from @sivers. john.leacox.com/now/
1
Naming things well is more important than any programming principles. Good naming builds understanding due to the shared natural language, without requiring any special technical knowledge.
1
1
2
Naming in programming is done with a natural language (e.g. English), so when both the author and readers know English, for example, that shared context enhances code understanding regardless of the technical details.
1
I wrote a short blog post about how I implemented a simple feature for a game and how I refactored it in three passes to increase code readability. john.leacox.com/posts/refact… #gamedev #codequality #refactoring
1
2
What's the thought process behind writing and merging code that you don't understand but "just works"?
1
I was pleasantly surprised to discover the new album Eupnea from @PRR_official. I've been enjoying it all week.
I really like the concept of coming to terms with an author as defined in the book How to Read a Book. In addition to books, this also applies to reading code, as in code reviews, refactoring or fixing code, and reading open source code.
You cannot truly understand a book or code until you have come to terms with the author. Words have ambiguous meanings, so you must identify the important words and also come to understand the meaning intended by the author.
1
@Sparrowhawk81 and I have been working on a new idle physics game with @unity3d with the eventual intent to open source it as an example of clean game code.
1
2
2
If you run out of toilet paper and all the stores are out, you could go to CVS and buy something and the receipt should suffice for a while.
2