News for hackers. Stuff that matters.
Re:Ask HN: As a developer what are your aha moments? by jdmoreira on Monday September 07, 2020 @04:00PM (#24402267)
1. When I realized programming was hard

That’s it. For a long time I thought I was good at programming and I kept making the same mistakes over and over. All nighters, leet coding, runtime hacks, etc...

And then one day it struck me. It’s hard and my mind can’t keep up with yesterday’s cowboy coding.

Slowly I started putting defense mechanisms everywhere - good type systems, immutability, compile type instead of runtime, never overwork and sleep the best I can.

Life is much better now and I'll never go back to thinking I'm good at programming.

Re:Ask HN: As a developer what are your aha moments? by walty8 on Tuesday September 08, 2020 @03:52AM (#24406133)
I figured it out in another incidence. I was in my first year as programmer, and I believed I was a pretty good one.

I remember I was hanging around in a small computer book store, and there was a big book of 'code complete 2' there. I have totally no idea what's that, just opened it out of interest, and I remember I flipped to a chapter about how to write a good 'if else'. And I was like 'holy crap, I wasted my entire life, I never thought in that way, I must be the rookiest rookie in the entire programmer world'. I immediately purchased the book, and that indeed helped me a huge deal in the career.

Re:Ask HN: As a developer what are your aha moments? by arwhatever on Tuesday September 08, 2020 @04:39PM (#24413056)
Paraphrased famous CS quote from somewhere: "The sooner you acknowledge that you cannot fit the entire thing into your head, the sooner you can start factoring that acknowledgment into your design."
Re:Ask HN: As a developer what are your aha moments? by shoo on Tuesday September 08, 2020 @04:00AM (#24406178)
similarly: realise that i can only think about a small number of things at once. so try to structure things to separate concerns so that i get to avoid thinking about nearly all things when working on any given part of the system. a lot easier said than done.
Re:Ask HN: As a developer what are your aha moments? by greenleaf3 on Tuesday September 08, 2020 @03:48AM (#24406120)
> good type systems, immutability, compile type instead of runtime, never overwork and sleep the best I can

I agree with you on this.

Re:Ask HN: As a developer what are your aha moments? by Zecc on Tuesday September 08, 2020 @04:05AM (#24406211)
> I started putting defense mechanisms everywhere

Just weeks ago, the software I had just finished writing complained to me at first run that I had forgotten to configure a setting. Defensive coding ftw.

> never overwork and sleep the best I can

Your best work can be done while not at your desk. Don't mind taking frequent breaks.

Re:Ask HN: As a developer what are your aha moments? by quickthrower2 on Tuesday September 08, 2020 @04:59AM (#24406533)
How did this work - genuinely curious? If you work as a team did everyone else stop being a cowboy too then pay down that tech debt? Or is this solo work or perpetual greenfield work?
Re:Ask HN: As a developer what are your aha moments? by jdmoreira on Tuesday September 08, 2020 @05:08AM (#24406581)
It’s a bit more complicated than I made it look of course. My bit didn’t flip in a day and the reason why I changed my ways was also because I've worked with a few people that seemed to have figured this out already and just by observing them I could figure it out myself.

Nowadays it really depends, some people for sure get it more than others. Some just dismiss a lot of the safeguards I value as some kind of functional programming hype. Teams are hard :)