
How I learned to program - deafcalculus
https://danluu.com/learning-to-program/
======
bluedino
His 'ineffective fumbling' and 'high school' seem to mirror my experiences.
Using a bunch of mismatched books and computers with no real goals, no mentor,
and no real results.

However, it's amazing when you read about <insert famous programmer>. They
grew up with Apple II's and Commodore 64's, but they _mastered_ them. Or at
least that's the narrative from the author of the articles that talk about
them.

They don't just write silly BASIC programs like the rest of us, they started
using assembler and learn the machine like the back of their hand. They learn
how to optimize the living crap out of their code. Maybe their schools just
had better books in their libraries or they subscribed to the good magazines
of the day. Or they were just that much better at programming and smarter and
more focused, one of the above, or all three.

~~~
tluyben2
The timeline seems to match my experience, but the fumbling does not; I
started reading books and magazines before I had access to computers in begin
80s. Those where mostly Basic but some asm (esp for the c64 and spectrum the
basic code had fair amounts of data which was asm). When I had access to
computers after that, I wrote monsters of Basic programs. I remember writing a
music composition program for the MSX which, after I got it all typed in on a
PC (I had only partly access to an MSX and part PC), it was too large for the
MSX memory. It was too slow too, so I started replacing parts with z80 asm
typed in hex. I still remember most opcodes in hex: it was much faster and
more efficient to type than assembler.

I guess I was lucky to have access to the books: I went to a (monthly?)
Philips ‘old crap’ sale. If I remember it was in the bottom of the PSV stadium
and they had old electronics and mags and books for sale for cheap. It was so
lovely; we took a car full of old circuitboards to get components off, books,
printed papers etc home and spent the next month working on them (this was
summervacation usually as it was close to my grandparents).

~~~
jacobush
Sounds like heaven

------
cabaalis
> We were exposed to some kind of lego-related programming, uhhh, thing in
> school, but none of us had any idea how to do anything beyond what was in
> the instructions. While it was fun, it was no more educational than a video
> game and had a similar impact.

I wonder how many of these "teach your kid STEM" toys have this result. I
learned to program when my mom got me a vtech precomputer 1000 for Christmas
when I was a kid. But becoming a "developer" took many years of effort.
Hopefully more kids will be set on the path like I was.

~~~
mlinksva
I misread "lego" as "logo" when reading the post, because that was my
experience. Before having a computer at home took an extracurricular BASIC
class which in hindsight I learned almost nothing from but it whet my
appetite. The intermediate class had us draw stuff with Logo, which I felt was
stupid, and turned me off of programming for awhile. Probably my fault, now
Logo looks like an interesting language.

~~~
coupdejarnac
I just finished creating a LOGO class, and I feel it's best for elementary
school aged children. If you took LOGO over the age of say 12, it probably
seemed childish and useless. But for younger kids, I think they can get
interested in computing with LOGO.

You can do some cool stuff with LOGO like create state machines, implement
sorting algorithms, and create simple games.

~~~
jacobolus
Logo is a great tool to use to learn visually about basic shapes and their
properties (circles, polygons, conic sections, spirals, various sorts of
roulettes, ...), logic, graphs of data and functions, fractals, cellular
automata, synthetic geometry including projective geometry, transformation
geometry and symmetry, basic number theory, complex arithmetic, polar
coordinates, trigonometry, the logarithm/exponential functions, matrix
algebra, linear regression and other statistical tools (Kalman filters!),
optimization, basic probability, dynamical systems, lattices, group theory,
graph theory, vector calculus, mechanics, optics, electric circuits, special
relativity, 3d vector graphics, searching and sorting, trees, mazes, robot
planning, game AI, ....

Or really anything you want, though after several years of experience students
might find other tools more convenient for some types of modeling.

------
mattfrommars
Looking back in my life when I was born a year after Tavish Armstrong, I just
feel so, disappointed how my life turned out to be. I had similar dreams and
hope but they didn't work out in the end.

Only if I told my younger self to actually go through the Macromedia Flash
book I borrowed once in high school, I would have had my first glimpse in
computing. But during my early days, I never had anyone who was remotely
interested in computers. I wasn't great at socializing either which would have
lead me to people who were in machines. There was AP CS course at my
university but I never took it only because I thought it was too hard and
instead took AP Calc.

Without any concept of computing or the power of programming, how can a kid
get into life of software development? All the random success stories I've
read of popular programmers these days, all of their younger days began with
someone giving them a gift or some 'assembly' language computer and started
from there.

Wish the pursuit of programming caught me much earlier in life than right now,
went into wrong major and always thought about programming, programming.
Having friends and family who aren't into computers didn't help either until
last year. So much life was wasted.

~~~
spraak
How old are you? If you are less =< 25, it's not too late. I started self
studying CS then after many aimless years. Then I got my first junior position
at 48k and after 3 years of raises and job changes I'm at 100k+

~~~
rewgs
I'm 27. That's too late?

~~~
yawaramin
Not at all. But you need to specialise and master a chosen sub-field. Like, I
consider myself a programming languages guy because I love type theory. Others
love exploring functional programming, OOP, Rust, or whatever. Whatever you
like, just get into it and explore, and try to build and ship cool stuff if
you can.

Everyone has periods of low productivity, you just need to roll with the
punches and keep learning and building whenever you can.

------
robocat

      "but that’s so obvious that it’s not even worth stating"
    

Intelligent people I know say this or something similar. What is obvious to a
smart person for something they are skilled at, is not obvious to the rest of
us!

~~~
Sinidir
God i absolutely hated this kind of "this should be obvious" statement made by
professors in lectures.

It absolutely poisens the learning atmosphere. And after 20 minutes of
lecturing on a difficult topic they ask if anyone has any questions and wonder
why noone raises their hand or says anything.

~~~
mikebenfield
FWIW, at least in mathematics "obvious" doesn't mean "you're an idiot if you
don't instantly understand this." It means, "this isn't deep. If you're
thinking about really deep, complicated things beyond what we've been talking
about, you're missing the point."

I have on multiple occasions sat down and worked with another mathematician on
a problem for an hour+, only for us to find the solution and both conclude
that the answer was "obvious."

~~~
paultopia
As a professor in a non-math subject, I agree with this and think it
generalizes. I often say "this is obvious" as a way to communicate to students
"you're overthinking this like woah."

------
mooreds
> hear a lot of stories like that, and I’m happy to listen because I like
> stories, but I don’t know that there’s anything actionable here. Avoid
> managers who prefer doling out punishments to helping their employees?
> Obvious but not actionable.

Actually, the advice to avoid managers who are not helping employees is
eminently actionable. It's just that the actions are either tedious or
radical.

Tedious steps to take, before you are in the situation: find other current and
former team members on linked in and do backchannel references on the
position.

Radical steps to take, after you are in the situation: quit your job and find
another one.

~~~
jetcata
Re tedious steps, I had multiple job offers and reached out to people on
LinkedIn who used to work on the teams I had offers for and got some great
honest info that helped me make a decision.

~~~
KKKKkkkk1
What kind of info did you look for?

~~~
jetcata
I just asked questions like what's the team like, would you recommend working
there etc.

------
crispytx
"I ended up at a little chip company called Centaur. I was hesitant about
taking the job because the interview was the easiest interview I had at any
company4, which made me wonder if they had a low hiring bar, and therefore
relatively weak engineers. It turns out that, on average, that’s the best
group of people I’ve ever worked with. I didn’t realize it at the time, but
this would later teach me that companies that claim to have brilliant
engineers because they have super hard interviews are full of it, and that the
interview difficulty one-upmanship a lot of companies promote is more of a
prestige play than anything else."

------
vinn124
as an aside, i think dan luu's writings are some of the best on interweb:
articulate, methodical, concise.

~~~
senatorobama
on the contrary, I think he is a braggart who has a tendency to show off his
alpha nerd credentials.

~~~
jacques_chester
We had dinner once at his suggestion. He wanted to pick my brains about where
I work.

He speaks a lot faster than I do, which is not something I'm used to. We
exchanged Flandersian fusillades of words (including some about the relative
speed of talking in different places, languages and scenarios).

He's legit. We'd struggle as a programming pair, though. Both too keen to hold
the lock on the talkbit.

------
tomxor
> In conclusion, life is messy and I don’t have any advice.

That _is_ the advice :P seriously. Most advice is far too subjective to likely
be applicable to yourself (because life is so messy).

With one exception: "leave bad roles more quickly and stay in good roles
longer", as the author mentions, it seems far too obvious, but it's not...
because "bad" is actually subjective, so "not working well enough" is perhaps
more accurate.

Some "successful people" have never had a "not working well enough" part of
their career because they are crazy lucky, and others have simply been
perceptive enough to recognise it and move on. Some label this as "luck" but
luck implies some objective "good", it's about chance, the chance of landing
in a well fitting scenario.

Rolling the dice can be painful, and knowing when it's good not always
obvious. Perhaps at least knowing to look out for this even though you don't
know what it will look like for you, is the only general advice?

------
petra
Anybody knows how to solve that third meta skill, of "solving hard problems"?

~~~
drdrey
Some tools that can help:

* break the hard problem into smaller problems (e.g. "make a car that drives itself" would really benefit from considering smaller components)

* reframe the problem. Sometimes changing the perspective on a problem lets you leverage tools or techniques from related fields. For instance, there isn't much good literature on techniques for understanding obfuscated programs, much of it gets bogged down in low-level details and has a very short shelf life. But there is one field that has a lot of good literature on understanding and transforming programs: compilers. Realizing that was transformative in my own research.

* go bottom-up: are there special cases that are easier to solve than the whole? Can you generalize from there?

* go top-down: pretend that you could use some off-the-shelf components that would automagically solve parts of the problem. See if you can compose them into something that looks like a solution, then see how to implement them.

~~~
smaddox
Great response! Reframing the problem is an especially important and well-
known technique in applied mathematics and physics. And the others can
arguably be generalized into "solve the easiest part first". If the easiest
part is at the bottom, start at the bottom; if it's at the top, start at the
top. Keep solving the easiest part remaining until there's nothing left to
solve. This inherently requires breaking the problem into achievable sub
problems.

------
copper_think
My recollection is that Dan was working at Microsoft during "Third real job
(2015-2017)." (He has a couple of posts in this timeframe where he refers
vaguely to his employer. "Hiring Lemons" is one.)

I would be interested to know what teams Dan worked on while he was at
Microsoft. He says that team #1 couldn't build their source code on most days,
and that while team #2 was better, they still often had broken builds in
origin/master.

~~~
KKKKkkkk1
I love the section he wrote on Microsoft. He is clearly a master of the
backhanded compliment:

> However, I can already tell that this experience broadened my horizons. Two
> examples I got out of the experience are a better understanding of how sales
> worked and I have a better idea of the range of processes that exist across
> different teams.

> To the first point, the company produced some decent products backed by a
> world class sales team. Watching the sales team work was a revelation. The
> sales people would regularly go in and create sales even when the product
> wasn’t the best thing for customers. I’d always known that sales was at
> least as important as engineering, but seeing this in action was different
> from knowing in the abstract.

> To the second point, I once wrote a blog post on build uptime where I looked
> at uptime data that seemed surprisingly bad to me and said

> at every place I’ve worked, two 9s of reliability (99% uptime) on the build
> would be considered bad. That would mean that the build is failing for over
> three and a half days a year, or seven hours per month. Even three 9s (99.9%
> uptime) is about forty-five minutes of downtime a month. That’s kinda ok if
> there isn’t a hard system in place to prevent people from checking in bad
> code, but it’s quite bad for a place that’s serious about having working
> builds.

> A number of people responded with comments like “lololol that guy has been
> pretty lucky in the team’s he’s worked on”. I didn’t think much of those
> comments until this job. At my first team on this company, we couldn’t build
> on most days for most of the time I was there! My second team was better,
> but I would regularly get broken builds when I fetched and merged from
> origin/master. I had no idea that companies that considered themselves
> serious about development could have practices like this and it’s good to
> have this new information.

------
kebman
Pretty anecdotal, but it seems to strike a chord with a few people in here,
like anecdotes tend to do... I like the HTML/CSS approach, and then tack on
some JavaScript. No stupid assembler to keep track of. I've taught about 300
kids web design, and around 150 programming (rough estimate), and that's what
stuck the best with the kids. Java, not so much. From JavaScript the sky's the
limit. Personally I tried BASIC, but I really learned programming by going the
PHP route, and onwards to Perl and Java. But the first thing I learned was
HTML/CSS. If I could choose again, I'd go JavaScript first, and perhaps Python
- another lovely language.

~~~
hackcrafter
> Personally I tried BASIC...

JavaScript is the new BASIC, in the sense that it is universally available and
a great first language to pick up.

It is easy to forget that self-taught programming is motivated by that
intrinsic discovery factor, and JS feeds the dopamine loop!

------
bikitan
> My class had a couple of kids who already knew how to program and were
> making good money doing programming competitions on topcoder

> High school (1996 - 2000)

This does't seem right. What sorts of competitive programming sites were
around that early?

~~~
jldugger

        whois topcoder.com | grep Creation
        Creation Date: 1998-12-30T05:00:00Z`
    

archive.org sample:
[http://web.archive.org/web/20010401182116/http://www.topcode...](http://web.archive.org/web/20010401182116/http://www.topcoder.com:80/)

So plausible, but extremely early adopter. More likely would be craigslist,
IMO.

------
sdwqer
[https://i.imgur.com/vBhtqtE.png](https://i.imgur.com/vBhtqtE.png) [2]

next step - CSS for dummies, because this is awful[1]

[1] [https://i.imgur.com/vBhtqtE.png](https://i.imgur.com/vBhtqtE.png)

[2] [https://i.imgur.com/vBhtqtE.png](https://i.imgur.com/vBhtqtE.png)

------
xchip
What is your github account? I am curious to see some of your code.

------
chefandy
Ironically, my high school expelled me for truancy. My guidance counselor, in
what I think was a hamfisted attempt to scare me straight, told me that I'd
never get into college without As and Bs, so I took her word for it. Why
study, or taking the SATs if my existing marks would keep me out of good
4-year colleges anyway? I had two years of terrible grades behind me, I was
quickly moving up in the ranks in a food service job anyway, and I wasn't
planning on going into the military, so what was the point?

During school hours, I'd just sit in the computer lab learning Photoshop 2.0,
HTML, and the new cutting edge thing called CSS. I'd have loved to take one of
the BASIC classes because I had already worked with it a bit on my TRS-80, but
they were only offered to kids who had taken AP Algebra 2. One pleasant spring
day I was coming back onto campus after smoking a butt across the street, and
the vice principal told me I wasn't allowed back onto school property because
I was no longer a student. After a few months of just working, I went back and
finished high school in a part-time night school program while working full
time. Oddly, I've always thought of this as a somewhat pleasant time in my
life despite my negative feelings about high school in general.

A year or two after graduation, around 2000, I took a few classes in a UNIX
undergrad certificate course at Northeastern. Not only did I ace the classes,
but I ended up teaching my classmates more than the instructor did in the
Linux class. (That was way less cool than it sounds though; he recommended
everybody drop the course and ask for a full refund because he was under-
qualified and knew it.) Also, the second-level C class teacher— a hardcore
windows guy— emailed me asking questions about developing in a Linux
environment for a few months after the class ended.

It was a confidence boost which SHOULD have pushed me towards college, but I
still assumed that no 4-year college would have me, and the thought of
essentially trudging through two more years of high school in the form of
community college was... unpalatable. I stopped taking classes before I
finished the certificate because they didn't offer me anything I couldn't
learn on my own— even if I did enjoy learning little-unexpected things like
C-shell scripting, and advanced awk— and it wasn't going to lead to a real
degree. I was much more interested in working in bars and living in shitty
apartments with a million roommates with only discount pizza and malt liquor
for sustenance. (wait, maybe I did go to college...)

I was lucky enough to get a $10/hr job as a university library IT assistant
where the systems administrator gave me a bit of flexibility with what I
worked on, a bit of leeway for solving those problems, all of the tech books I
wanted, and all of the scrap hardware I could muster up. I ended up learning
how to use Perl, first as a systems language and then for CGI programming,
honed my shell scripting skills, built a few slightly more involved internal
web applications using PHP, learned how bigger networks worked, good IT
practices, and lots of other cool stuff. From there I bounced around to a few
higher-level support type jobs and then got my first regular software
development job after that. Since then, I've tackled problems with increasing
complexity and managed a few projects.

Though the more 'vocational' path I took to coding instilled some good
practices and a rock-solid work ethic, I feel like there's a bit of whiteboard
swag that people who took a math-first, comp-sci-heavy path to coding have
that I lack. As the level of complexity with my work projects increases, I
sometimes struggle because I picked up a lot of the math and comp-sci
knowledge magpie style without having the solid theoretical foundation to tie
it all together. I thought learning a programming language without a real-
world problem to solve, and no real deadlines was a slog; doing that with
things like discrete math is much worse. (though I do think it's super neat.)

It's pretty funny that the primary difference between me and him is that I
believed a guidance counselor who told me it was impossible. Approaching 40, I
realize how full of shit she was.

~~~
Someone
_”My guidance counselor […] told me that I 'd never get into college without
As and Bs

[…]

I went back and finished high school in a part-time night school program while
working full time.

[…]

I believed a guidance counselor who told me it was impossible. Approaching 40,
I realize how full of shit she was. ”_

So, what were your grades at that night school program?

~~~
chefandy
Pass/Fail

------
fiatjaf
You may think this website is old-fashioned, but it uses FLEXBOX when it
should be using table layouts.

