Question

So my problem may be relatively rare, at least the majority of the "how to learn to code" questions I've come across deal with a lack of fundamental understanding of computers or languages. I'm fluent in Linux, repairing PC's to an extent, learning new languages is not a problem for me (learned a bit of Scheme to hand in lab assignments in a single day), etc. I've been in the KDE open source project and fixed bugs and segfaults successfully, though the latter required some assistance since I lacked the necessary OS knowledge. But, there's a huge problem.

I can't write code from scratch, especially in my favorite C++ language.I understand the language itself, no problems. Whenever I have to design a set of classes for my program (a very simple one), to break down responsibilities between functions, to choose a language or a library feature to use among the ones available, I come to a stall and spend days starting at the damn screen. I have a great PC, display, and soon a new keyboard. I have a lot of time, yet it's wasted wandering around, unable to make a choice or design decision. The essence of the problem is probably that I don't know what is more correct or appropriate, and, importantly, what is the "common" way to do this or that - I don't want to reinvent the wheel or take the wrong aproach - see the last paragraph for why it is so.

The root as I feel it is here: I'm in a dire need of input on my ideas, for them to be validated or rejected, or at least discussed. My university, and no Russian university for that matter (or no Uni in the world? how is it done in the West?) doesn't offer such a "consulting" service, and no one actually cares for the actual code I write. Yesterday I learn that once a course is over, I'm not allowed to ask that professor for help on projects, which is understandable since they have finite amount of free time and students are many. I learned English with a very, very great teacher, who taught me to actually speak instead of just knowing the grammar. Maybe I can or should find a mentor to get me through the stalls in the beginning?

How can I solve this? How do all those people who post code on GitHub write it in the first place, obviously there's no validation or review for personal projects?

In case you wonder where it stems from, in my mathematical school we were taught to act on probems in a "literate fashion" and areceive feedback, as well as follow the established rules and practices. However, I still managed to find my own solutions, and they were of course accepted. But with this programming problem I'm describing, I feel I simply don't know enough rules or examples to follow..

Was it helpful?

Solution

Blogs and podcasts are your mentors. Books are your mentors. Videos are your mentors. The Internet has made it possible to have these things in abundance. Pursue them with vigor.

I know this is going to make me sound like an old-timer, but when I was your age I didn't have any mentors. There were no mentors, because they didn't exist. The Internet didn't exist. Good programming classes didn't exist. All that was available to me was my intellect and a computer. I knew more than anyone else around me at the time. That's not a boast; it's just the way it was. The only possible mentors would have been Bill Gates, Steve Jobs or Steve Wozniak, but I'm pretty sure none of those guys was going to come over to my house and teach me how to program.

So here's the deal. Until you've written, tested, debugged,refactored and rewritten, say, a hundred thousand lines of code in an actual application, your code is going to suck. You have to figure out what works and what doesn't, in the moment, while you're writing code. In that way, it's no different than learning a musical instrument; you have to put in the practice.

Certainly, I do encourage you to read books, listen to podcasts and watch videos. They will teach you the basic principles. But none of those tools are going to teach you how to program until you practice programming by writing lots of good code. And here's the rub: nobody is going to mentor you until you know the fundamentals, which you can get without supervised instruction, if you happen to be talented enough to be a programmer.

A cautionary note: don't get too wrapped up in rules, "best practices" or software patterns until you understand the fundamentals of programming well enough to understand why these maxims exist. If you've never written any code, it's too soon to study the Single Responsibility Principle, because you're not going to understand it and you're going to misapply it. Don't get sucked into the "software patterns" craze too early. If you have to ask "which hammer should I use to fix this roof," then you don't know enough yet to fix the roof.

And finally, a warning: If you're getting into programming for any reason other than to love it and be the best you can possibly be at it (reasons such as money, lifestyle, etc.), you will be miserable and you will make everyone around you miserable. Programming is aggravating enough without it being a calling, and there are too many marginal programmers out there already. Do the world a favor and be good at it, or don't do it at all.

Licensed under: CC-BY-SA with attribution
scroll top