HACKER Q&A
📣 zwnow

Building Software with ADHD?


Hey!

It's been 4 years since I started programming. I went through the german apprenticeship system for the first 2.5 years, got my degree and am working as software developer since. Currently I am the lead developer of a small 2 man startup that is somewhat profitable. I am adding this so you can judge my experience better.

For the first years of learning I jumped from language to language (because I really like learning new languages). I mainly do web development but after a while of doing so I quickly got bored with it. At least the high level stuff of bulding API routes and frontend related functionality. I wanted to go deeper and learn more.

I am active in multiple dev communities and heard often that it's good to build stuff from scratch to see how it really ticks.

This made me want to build a HTTP server myself.

This is where my issue starts: I have read about 150 pages of RFC standards regarding the protocol and got extremely overwhelmed. I cant make out on where to even start. After 2 days of reading man pages and trying stuff in C I managed to connect to a socket and make it listen to pretty much anything that was coming my way.

This is where I lost focus. I would have to read the HTTP RFC again and again because I either already have forgotten what I have read, or distracted myself with something. Sometimes I have to read pages 3 times to even somewhat understand whats written on there.

This issue translates to pretty much any bigger project I start. I cant focus on "difficult" implementation details. I quickly lose motivation to continue a project, once I struggle or find something shinier.

In 4 years of programming, the only "big" projects I have finished were for work, because its harder to distract myself in the office and I actually get paid for working on these projects which keeps me motivated.

How are you guys, if you have ADHD, handling these things? How can you bring yourself to work on the same project for more than 2 weeks?


  👤 davydm Accepted Answer ✓
You need the effects of frequent dopamine hits from seeing your code actually do things that you want it to do. This isn't a bad thing - nor is it specific to people with ADHD or on the high-functioning autistic spectrum (like myself) - it's a side-effect of being (basically) a smart monkey.

So to progress, you need to "eat the elephant" - from the joke: Q: How do you eat an elephant? A: One piece at a time

TDD really helps here because you write a small test, implement a small bit of logic, and get the dopamine hit from your test passing. If you're resistent to (or unfamiliar with) TDD, you can get close by breaking the problem down into the smallest blocks you can and solving each one by one - though again, having some kind of test suite here will help to show your progress, and help to prevent regression.

A fully-compliant http server from scratch isn't trivial (as you know), but there are partial steps up to that point that you can take to get there, like first implementing a simple TCP server, and then implementing http, bit-by-bit, on top of that, eg with a first pass being: a query to a path on the server returns some string (which a browser will happily display, and a programmatic http client should be able to retrieve and print out - for tests!).

I've done something similar, though not in C, but in C#, so I know there's a lot of conveniences available in the runtime api that make it easier, but you can see this approach here: https://github.com/fluffynuts/PeanutButter/tree/master/sourc...

A suggestion I'd make here might be to use another language with more conveniences (JS, Python, C#, whatever you feel like, but something a little more abstracted from the metal) if you want to tighten that dopamine loop. I also love learning new programming languages and have worked with at least: - C/C++ (tbh, I wrote C++ like "C with classes" - I avoided much of the more esoteric stuff) - VB6 (don't laugh: it's quick to learn and gets a lot done with little) - .net languages: VB.NET, C#, F# - scripted languages: python, ruby, tcl, bash, lua, javascript - F# - R

I'm sure I've missed out something; and it sounds like you have an equally interesting list. Anyway, I hope this helps.


👤 lordkrandel
Simple: why don't you start with a prototype that is 1% functional and respects 1% of the specs, and commit to do 1% everyday? It's something more than 3 months. I have a colleague that has an amateur OS in c++ as a side project, she's been writing it for 4 years now.

👤 adastra22
Medication. ADHD is one of those few conditions which s eminently treatable with medication and a >90% success rate.