Hacker News new | ask | show | jobs
by zxlk21e 4370 days ago
I think there may be a mixture since your question:

> When you're coding, do you think "What's the best possible way to do this," instead of just "How can I get this code to run?"

I do both. Mostly begin with phase 2 (mentally) and then go back and look at the 'best way' and design schema and business objects around that. I end up making a lot of sacrifices and doing things that are probably not optimal due to what I think is poor real world experience and experience working with other, more seasoned developers. My knowledge of design patterns is fairly limited and I tend to churn out projects that work, are fairly reasonable but yet I think they lack the elegance of many of the open source projects or example githubs I've seen.

1 comments

Oh yeah, absolutely! I didn't mean to imply you should never ask "How can I get this code to run." I meant that you shouldn't stop there. And it sounds like you're not stopping there.

> My knowledge of design patterns is fairly limited

I'd recommend reading articles and books on that. And also reading open-source code. The latter can be very challenging, but also very rewarding. You should study it until you understand not just what design decisions were made, but why they were (most likely) made. If you can't figure it our, ask :)

> I tend to churn out projects that work

There's nothing wrong with doing that as a first step. Many programmers will make something that works, and then refactor it into something that works and is nicely architected. Have you tried that approach? Is the issue that you don't have enough time per project?

> I think they lack the elegance of many of the open source projects or example githubs I've seen.

It's a good sign that you recognize as much. That means you have an eye for good code, which is huge. What's your biggest obstacle right now? What prevents you making the jump from merely appreciating good code to writing it?