Linear code is more readable

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Box2D

    Box2D is a 2D physics engine for games

  • Why is 600 lines too long? How are you able to make that judgment call without first knowing what the algorithm is even doing? People setting arbitrary limits like this is what leads to convoluted spaghetti, instead of just taking things on a case by case basis. Here’s a function from the Box2D code running a particularly complex algorithm for solving contact velocities https://github.com/erincatto/box2d/blob/411acc32eb6d4f2e96fc... .

    It’s 310 lines long. It reads very well, and it looks very maintainable. It has very clear comments explaining the reasoning behind the harder parts of the code. Would you reject this code because it’s pretty long? I wouldn’t.

    There is no such thing as too long or too short. There’s overengineered and there’s underengineered and there’s a sweet spot in the middle that has the perfect amount of engineering with the least amount of complexity (preferably no additional complexity than the original problem warranted). Sometimes, the problem at hand is inherently a large algorithm and requires many lines of code. Don’t split it up! It just makes it harder for future maintainers who now have to figure out if the additional functions are actually being used elsewhere or if they’re just there to make the code “pretty”.

  • advent-of-code-jq

    Solving Advent of Code with jq

  • I realize this is tongue in cheek, but really: Read code!

    If you ever start plateauing in your code skills, start digging into the code of your favorite open source project. Accept that things have been done in another way than you would for a reason and try to understand that reason.

    Try joining advent of code[0], and make sure to spend half you time block on reading and understanding alternative solutions.

    [0]: https://adventofcode.com/

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • putty

    Discontinued mirror of git://git.tartarus.org/simon/putty.git, used for client testing

  • https://github.com/github/putty/blob/master/terminal.c#L3281

    This function is 1830 lines long. It's reasonably well structured I think. Although the #if 0 are maybe not so good.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts