Dev Thoughts

Musings from my development journey.

Topics

How to Program - Justin Searls

large

Talk given by Justin Searls at RailsConf 2017.

Issues with learning how to program:

  • Schools do not teach flow, in other words, they don't teach you how to solve problems.
  • Learning how to program is more than syntax and even practical implementation.
  • Programming should have the goal of solving real world problems.

"Programming is a philosophical activity that occurs in our heads."

Many developers are simply imitating other programmers. Duplicating behavior.

Many developers are bad at answering how? questions:

  • How to build a method
  • How to implement best practices

A Practical Solution

Feedback Loops

The path to programmer enlightenment is being able to go through feedback loops.

Personality Traits for Developers

  • Sensitive vs Fearless
  • Inventive vs Aesthetic
  • Naive vs Leery
  • Economical vs Thorough

You can take the test here.

Discovery Testing

Works on breaking large scale problems into smaller, more manageable chunks.

Process:

  • Build out a test
  • The test should include each of the required processes that need to be true for the feature to be complete

Alternative Perspective on Programming

"Communication for the next developer to pick up."

Programs are Directed Graphs

"Programs are directed graphs, with components connected to each other."

It should be your goal to be a minimalist with the code, to remove any unnecessary coupling (aka connections) between components.

Improving Code

When it comes to optimizing code, it's vital to not sacrifice local optimization at the expense of the global optimization of the application. Such as constantly changing method signatures, causing changes to be required by other parts of the program.

Project Management

Any system can be gamed. Project management processes are not a guarantee of success.

Bugs can creep into programs due to unit complexity as projects grow and programs without scalability and readability in mind.

Complexity is always going to grow over time. However, small units can help to decrease the exponential growth of complexity (aka linear over exponential).

Design Patterns

Structuring programs like trees, with parent nodes functioning as delegators and leaf nodes being direct functionality.

Disposable Code

Change is a constant when it comes to software development. Instead of trying to slightly alter a current implementation, an alternative is to completely remove the components that need to be altered.

maintainable_code != eternal_code

Do not be afraid to completely kill components.

Approach to Open Source Libraries

Build wrapper (delegator) libraries to wrap open source components. This provides an adaptor interface that allows for more modular components and decreases coupling. Example: wrapping database query calls instead of simply relying on ActiveRecord would allow for switching to a different ORM more efficiently.