r/learnpython • u/taladan • Apr 11 '18
Here's a way you can become a better programmer!
How do I become a better programmer?
I see this question on reddit quite a lot. In fact, I usually see something like it every time I open up r/learnpython or r/learnprogramming. There is always someone wanting to know how to become a better programmer, what magic pill or secret incantation that others do that instantly make them a better programmer. Invariably, there is never a simple answer to their question - often the answer boils down to 'Here's a bunch of tutorials, do them until you know the syntax then work on a project that interests you.'
This often leads to some consternation on the part of the OP as they often wonder 'What project can I possibly work on if I don't know any programming?!?' Often it seems as if they tentatively accept the advice and wander off into the wilderness to see if they can find this mystical project to work on. Sometimes you even hear back from them. Well. Today I wanted to take a moment from my own project and tell you: This is the absolute best advice anyone can give you.
All the practice tutorials out there are wonderful. Most of them, with the exception of a few that are looked down on by communities as a whole, are fairly well suited to the purpose for which they were created: Teaching the syntax of a language. See, that's the thing that most new programmers don't realize. You're not learning how to program when you're doing these tutorials, you're simply learning how to speak the language. Most people learn a few words in the language of python and want to write the next big Facebook or go to work for Google. Well, let me tell you brothers and sisters, that's the equivalent of learning how to say 'Parlez vous frances?' and wanting to immediately set off to write the next big french literary masterpiece. It's technically possible, but so unlikely as to be completely improbable.
Find a project.
So...why learn all that language (syntax) from tutorials then squander them in trying to flop around doing /MORE TUTORIALS/? There comes a point where you're just learning things that don't seem very useful to you at all - but you keep plugging through them thinking 'everyone says do this tutorial, it's GOT to make me a better programmer, right? Dave? Right??' Well, let me give you an example of why it's important to move past tutorials and go on to working on a project that you find interesting. Now, no lie, this is code that I produced in August of 2017. Nothing special, nothing fantastic. In fact, it was probably copied directly from a tutorial somewhere with very little understanding on my part until I began tweaking and moving it around. Now, this level of code was where I stayed until the end of December when I started to get interested in an opensource python project (Evennia. When I started on that it was the end of Christmas break, the kids were going back to school and since I'm a disabled stay at home dad looking for a way to become a better programmer and maybe start earning a little money to bring into the house, I figured 'What the hell...I used to love playing on Muds/Mushes/Moo's back in the day, why not take this out for a spin?' That ended up plunging me headlong into a project that I felt ill-prepared for...but after the first couple of sessions of flailing around, not knowing where anything was and asking a bunch of questions on the (friendly!) irc chat the project uses, I settled down and started going through /their/ tutorials and working on implementing my own ideas.
It's been not quite four months...and this is the code I'm producing now. Granted, there's probably a /lot/ wrong with it, and I'm still nailing down how to implement unittests into my code effectively, but...it's a hell of a lot more useful code that actually /does/ something. I know that it's messy and not as good as some of the other stuff folks are doing, but in the last four months, I've learned (on my own) about Python, git, how to set up a development environment, how important standards are and why they exist. And along the way, I've been working on different things and I'll ocassionally have a little flash of deja vu. I'll go back and look at a project and realize - hey, I've done something very like this in a tutorial! These are the moments when all the seemingly pointless how-to's and automating everything with the kitchen sink tutorials start to actually pay off.
Don't forget the secret sauce.
Here's the secret that a lot of people don't think to tell you until you've been working at programming for a while: You're going to have a hard time of it. You're going to spend a whole day on one method, trying to figure out why it returns a list of tuples instead of just a straight list because something else is doing something you didn't account for. See...that is how you become a better programmer. By sucking at it. Not being satisfied with sucking at it, you google the shit out of your problem, ask on reddit, ask in IRC, post on git or stackoverflow....That's when you become better - when you have something that you're working on that is more important to you to get working than worrying about why the syntax of ','.join(string) and string.split(',') look like that. So...keep plugging along. Find something you want to work on...something that you get up thinking about in the mornings...some puzzle you really want to solve more than you want to watch that last episode of Dr. Who. Do that and you'll become a better programmer. Just be careful or the next time you're on Reddit, you'll see someone asking 'how do I be a better programmer?' and you'll invariably answer 'Do the tutorials, then find a project to work on'.
I hope this helps some of the newer folks some. The folks who are better programmers already, I only ask that you not giggle too badly at my code...I am afterall, still learning :D
Edit
I've had several people ask me how they can contribute to the project, or how to get started. I've created a channel on Freenode
I've also started some contribution guidelines here
6
Apr 11 '18
I'm a disabled stay at home dad looking for a way to become a better programmer and maybe start earning a little money to bring into the house
Check out VIPKID and Palfish.
About your point of finding a project. I tried that but it seems very confusing. I have a degree in IT and I am somewhat confident in my coding skills, but I am embarrassed to admit that I can't figure out how github works. I don't know what to edit or how to edit something.
I also lack motivation because I am not convinced that it will ever pay off. There is a lot of competition coming from overseas.
6
u/taladan Apr 11 '18
Honestly, at this point, I'm a 40+ year old guy that worked for 20 years as a networking/desktop repair guy in a small town. I'm hurting for mental stimulation because...well...let's just say south GA ain't exactly the silicon valley of the east coast. So, this project is giving me that sense of victory over little things that I miss from working days with some of the more intricate business equipment...don't get me started on old hardware :D.
So, I don't mind about the competition, I don't mind about the github - I'm learning how it works because I /need/ a collaboration suite to work with other people because coding alone sucks. So, I stay in touch with a few people, giving me a social circle I wouldn't otherwise have access to. Learning github facilitates that and the enjoyment I'm drawing from doing something like getting a bit of my code that I made up as a convenience tool for myself included in the project that I'm using as a framework to develop from. That's a huge victory to someone who was just doing heavy if/then statements and too scared to dip his toes into OOP just four or five months ago. It's those victories that make me want to be better....not the money. I'm broke already. But I can be broke AND KNOW HOW TO TURN LAMPS ON WITH A SINGLE STRING!!
I mean...c'mon. At least it's worth putting an hour a day into learning /one/ thing about github. The more comfortable you are with your tools, the better you'll feel about using them.
Also, thanks for the vipkid and palfish things, I'll look into that.
5
Apr 11 '18
Maybe, I will give github another try.
7
3
u/Freudenschade Apr 11 '18
Honestly, I felt the same way about github until my first internship where I had some github wizards on my team who seemed to know absolutely everything about it.
You may have seen this already, but in case you haven't, this is the github tutorial they directed me to when I needed to learn, and I thought it was fantastic.
1
u/dented_brain Apr 11 '18
Honestly. This got me starting to understand the basics of git (all that I needed)
9
u/wheedwhackerjones Apr 11 '18
My problem is finding a project to work on.
8
u/buuhuu Apr 11 '18
Genuine question: Why do you (and a lot of others) bother learning to code if your life doesn't even offer any problems/projects that can be solved by programming?
3
Apr 11 '18
I'm pretty sure that literally everything in life can be improved, augmented or made more efficient using programming.
2
u/taladan Apr 11 '18
I think you're probably right. I got to a point a couple of weeks ago where I had to stop myself from thinking 'you know, I could write a program that does that' and just find the right tool that does the thing instead and get back to work on the project I was already working on. Sometimes programming makes you want to open a door that is much like reinventing a room full of wheels *laughs*
4
u/wheedwhackerjones Apr 11 '18
It's fun and my job requires it. As someone new to it, I'm still finding ways to apply it outside of those areas but don't know where to begin.
2
u/semidecided Apr 11 '18
It's fun and my job requires it.
What is fun? How does your job require it?
I'm still finding ways to apply it outside of those areas
Such as?
but don't know where to begin.
There's no wrong answer here. I'm just trying to inspire you to pick one.
-7
u/wheedwhackerjones Apr 11 '18
Asking what is a way to apply it is looking for ways to apply it.
3
u/semidecided Apr 11 '18
You don't seem to want to help yourself here.
-6
3
u/hallmark1984 Apr 11 '18
Twitter/reddit bot?
Budget calculators
Home automation
This is how I started and although I still suck, I'm getting better
3
u/PandaMomentum Apr 11 '18
+1 for Twitter bot. Access is straightforward and you can't really break anything.
2
u/hallmark1984 Apr 11 '18
Great practice for loops, exception handling string manipulation and all sorts plus with a bit of practice you can tie it to all sorts. Mine tweet me about torrents, give me updates on system status and send me motivational DM's before meetings.
1
u/DemDim1 Apr 11 '18
The problem I personally have with twitter/reddit/social media bots is that I really don't have a use for them, there aren't really things I would want them for.
2
u/taladan Apr 11 '18
honestly, I've done a little web scraping and such - it's not something I'm terribly interested in, but as an exercise in usefullness, I've got to say those exercises made me a better programmer. If it takes you a couple of days to hammer out a twitter bot that teaches you better about OOP or handling data or webscraping or whatever else, I think it's a worthy exercise, whether you'll end up using it or not. Sometimes you have to whet your appetite before you can find a big enough project to take a bite out of...and any success is a good one - helps motivate us to do bigger and better. But if twitter ain't your thing, I'm sure you could do something like an IRC bot that does something funny, weird, or completely useless.
1
u/hallmark1984 Apr 11 '18
How about scraping your local public transport schedule? Don't dismiss the budget calculator as well it's great for getting your head around stuff like UI
1
u/DemDim1 Apr 11 '18
I don't know, maybe I'm too picky but those projects don't look like a lot of fun to me. I've been working a lot with deep learning lately which is just a lot more fun to me so maybe I should just keep training in that area.
1
u/hallmark1984 Apr 11 '18
Find something that interests you and drive it home. I used the Twitter bot as a jump on to OOP and to make something I could use, if that doesn't fit for you just experiment and find something that does.
1
u/taladan Apr 11 '18
I know of at least 3 projects that are good for beginners that would be glad to have help. What do you know about text based gaming? :D
1
u/wheedwhackerjones Apr 11 '18
Probably not a whole lot but I'm interested in learning. I know user input text based games actually
1
u/taladan Apr 11 '18
honestly, with evennia being based in python, it's not as bad a leap as one might think. There's very little math in the parts that I'm working on right now. The hardest thing (to me) is working on access structures and logic flow. The bulk of the work with evennia is string mangling though, which honestly...if you can mangle a string, you've got half the battle done. Most of the stuff in evennia that I'm using currently is either part of evennia or using builtins for code.
Have you ever played on a mush or a mud before?
1
u/wheedwhackerjones Apr 11 '18
Never, but eager to try
1
u/taladan Apr 11 '18
hit me up on github. I also use Telegram as a texting platform, so if you have that, pm me and I'll give you my info and we can talk about it
1
u/tempsquared Apr 11 '18
I had a text based mud that was written in perl but used logs for databases and was very inefficient. I then found out about python and was thinking to convert or rewrite the script. But it felt too overwhelming and so I gave up.
I still have the perl knowledge as well as the game mechanic and I'm wondering if I can get involved in your project somehow.
Any suggestions on where to begin?
1
u/taladan Apr 11 '18
Absolutely. First, if you don't have a github account, create one, then follow the pegasus project. If you have Telegram, I use that to chat with folks, so you're welcome to add me on there if you like.
2293052524
If not, let me know and we can either email or meet up in an IRC chat somewhere....I should probably make a chatroom on freenode for the pegasus project in the longrun...be easier for group communication that way probably.
1
u/taladan Apr 12 '18
I've created an IRC channel on freenode - #pegasus-project, there's enough people asking about it that I think it might warrant it.
3
u/lolwat_is_dis Apr 11 '18
Invent something yourself. I'm making my own version of Conways Game of Life. IMO it's perfect as the actual back end isn't that difficult (you're essentially controlling the behaviour of a 2D array) and the front end allows me to practice Tkinter.
2
2
Apr 11 '18
I had this problem really bad when I was newer. I stole other people's ideas but did not look at how they made it and tried to make it myself. Worked for me.
3
u/metakepone Apr 11 '18
Shhh! You’re supposed to just find something to build without knowing anything about a language.
1
u/vihu Apr 12 '18
A good first one is to build a self-hosted resume on any platform. Not only that'll teach you a plethora of web stuff, you'll actually get something useful out of it. Many recruiters, hiring managers, team leads and even execs care more about that you're actually willing to make an effort even if you don't know shit about what you're doing.
I know finding projects is a challenge and it does get kind of frightening to actually open a PR on an open project, hence my suggestion.
4
u/1024KiB Apr 11 '18
Just two random thoughts that are only tangentially related to your post:
you can learn the finer details of the syntax and the defaults by looking at code golf examples; granted, it won't teach you good practices, but I don't know, it's interesting and makes you aware of edge cases
look at the most frequent and most voted questions on stackoverflow to learn some tricks of the trade
idling on IRC channels that are about helping people, like ##python on freenode, can make you learn difficult points much faster, and usually people who go on IRC are more advanced and/or have more experience than on random websites. Their FAQs are often interesting too.
1
u/taladan Apr 11 '18
Very true, especially the part about the IRC channels. There's no other community that tends to hyper-focus on a topic with a severely over-experienced group of people than an IRC channel about a topic.
I always end up going back to #evennia on freenode whenever I get truly stumped, or just want to bask in the glow of people who know wtf they're doing with the system while I just play in the sandbox *laughs*
3
u/tunisia3507 Apr 11 '18
worrying about why the syntax of
','.join(string)andstring.split(',')look like that
I think that this is actually an important part of becoming an intermediate/higher-level developer. Being able to recognise language design choices and their reasonings, and why it makes sense, is vital to being able to abstract concepts outside of the language itself, as well as in designing your own software.
1
u/taladan Apr 11 '18
I agree, there is a certain amount of meta-thinking you end up having to do when you're coding, especially if you're doing OOP...but sometimes with me, that just gets in the way of getting something prototyped and then improving it. Sometimes bad code is better than no code. We all know good code is better....but I struggled for a long time with embarrassment about my bits and pieces of code that I'd tried up until I got serious about learning in the last 4-6 months....but yeah, it can be extremely instructive to look at the motivations behind doing something one way rather than the other.
I have to remind myself most times that there should be only one obvious way to do it.
2
Apr 11 '18
I'd love to work with you on your project if you'd like helo
3
u/taladan Apr 11 '18
I welcome any and all who would like to contribute. What do you know about text based gaming? ;) Seriously, if you'd like to contribute though, feel free to hit me a star/fork on git and check out what I've got posted here. That's kind of my working todo list. I'm semi-collaborating with a couple of other people on a system's project for evennia right now, so there's plenty of work to be done. If you're interested, hit me with a pm, and we'll talk. I'm going to be afk'ish for the next hour or so, but then I should be in for the evening (hopefully).
Thanks for your interest!
-T
1
Apr 12 '18
I'm working on a proven fair dice game for garlicoin right now, a portion of the proceeds will go to charity. https://github.com/Sa6oZnaka/GRLC-TEST I'll star your git and contribute when I have the time. Feel free to do the same :)
2
u/pazuzu6666 Apr 11 '18
What about doing coding challenges?
Or doing projects is enough ?
4
u/taladan Apr 11 '18
I've done a coding challenge or two, and they're good to get you thinking about coding to a deadline...but honestly, I look at some of the stuff on /r/dailyprogrammer and just shake my head in incomprehension. Other times, I will forego attempting the problem, but I usually scan down to a python solution if it seems like an interesting challenge that either I've dealt with something similar or may end up dealing with something similar. It's a very good way to get a bird's eye view of how many different ways a problem can be approached - and remembering
import this, many times you learn what not to do by reading other people's comments - those can be some of the most helpful information on /r/dailyprogrammer that I know of, imo.But, if they work for you, keep doing them...there's no /right/ way to learn. There's PEP8, and PEP257...but they're really guidelines ;)...so do what works.
2
u/pazuzu6666 Apr 12 '18
Thank you. I’ve been doing some doing challenges and sometimes i can’t even Understand what the question means.
I think I’ll attempt easy to medium ones but keep focuse on projects.
2
Apr 12 '18
Check out code golf: https://codegolf.stackexchange.com/ It focuses on making the smallest code to achieve an objective. While trying is great, finding others solutions help simplifying and making leaner code.
2
u/nolimbs Apr 11 '18
I've been feeling a little discouraged today, so this was really nice to read! I'm going to start the project I've been meaning to start tonight because why not. Thanks OP
3
u/taladan Apr 12 '18
So, how did it go? Make any progress on your project last night?
2
u/nolimbs Apr 12 '18
I did! I started putting together the first few lines. It’s a simple project but it’s an automation thing so it will be helpful for me in organizing some stuff. Thanks for checking in!
2
2
u/fishbulb- Apr 12 '18
See...that is how you become a better programmer. By sucking at it.
Good judgment comes from experience. Experience comes from bad judgment.
1
52
u/Angrydroid21 Apr 11 '18
To paraphrase an old saying, practice (projects) makes perfect (programmers)!... well not perfect, no one is but definitely a lot better.
I would say to look at like this. You can read all of the tutorials you want on how to ride a bicycle but unless you get on a bike and practice its all worthless.
18
u/alkalinemusic Apr 11 '18
The better version of that saying, as I've learned, is "practice makes permanent"
2
2
Apr 11 '18
yeah, but you can't create a project without a tutorial, so learn and then apply
1
u/d_thingable Apr 12 '18
You can dig through stack overflow and documentation. It feels like banging your head against the table every time you hit a snag but you learn eventually.
19
u/liln00b Apr 11 '18
See...that is how you become a better programmer. By sucking at it.
I suck at it. Guess I'm doing it right and I'm on my way to becoming a good programmer.
1
u/tempsquared Apr 11 '18
Sure. I have a github with a ridiculously simple project. It works but I'm still looking for ways to refactoring.
I don't have telegram but I have Discord, Slack, Allowing, Hangout, etc. I can also download and create a telegram account so let.me know what's easiest
1
u/taladan Apr 12 '18
I've created an IRC channel on freenode - #pegasus-project. That'll probably be the best way to centralize discussions...There's apparently some interest in the project :D
1
u/ty1771 Apr 11 '18
Thank god for all the stupid questions people have already asked, their answers all over google have helped me immensely.
1
u/taladan Apr 11 '18
God bless their ignorant hearts. I know I do. Imagine learning to program before google. Before BBS's. Just think of it.
We've got no excuse not to learn to program if we say we're really interested in it.
1
Apr 12 '18
Hey awesome, thanks for sharing this. I am stuck at the transition on how to implement projects after reading (many) tutorials, sometimes it's frustrating and tiring. The languages and Frameworks keep changing all the time which keeps me irritated !
2
u/taladan Apr 12 '18
Here's the thing that I've found out - you can't know every language and framework. So, find the one that works for your project and stick with that. Do some intelligent research, make sure the project follows some sort of standard and is fairly future proof and you'll have something you can rely on to just be there. As you find these few bits and pieces, eventually you'll just have your go-to stuff that you know you're going to want in a project and it becomes easier to plan code and lay out structure.
1
Apr 12 '18
Hey @taladan, thanks I didn't think of all the info you have mentioned. Thanks once again, I am starting with Django soon
1
u/Fuhdawin Apr 26 '18
What are some good projects for a beginner?
2
u/taladan Apr 26 '18
The best answer I can give you is: What sparks your interest? You know the things you're interested in, right now if you're teaching yourself, you can treat this as a hobby, so you write for things that interest you. If you like racing, then get on with some of the projects that do stuff with racing data -- I'm sure they're out there. I happen to love text based games, so that's how Pegasus came about....it's something that I'm more interested in seeing the end result than I am in worrying about the syntax of the code to get me there.
So, step 1 is: You have to have something that drives your interest. If it's something that you're in love with, then the code won't be a hassle, just an obstacle for you to overcome. And don't worry about being new and contributing to a bigger project. Not even RMS can jump into a project and start helping on day one. Everyone has to read and understand the documentation and the work flow of a project before they just jump in whole hog.
Step 2: Start by finding and fixing typos in wiki pages or readme's for that project that you're interested in. You can do it while you're reading the documentation. And already, you're helping. You think you're not, but you're saving the developers precious time they could be planning or coding. That's day 1 help.
Step 3: After you get spun up on documentation and workflow, then start looking at some of the smaller issues that are available. Don't rush into this - this is your opportunity to understand what kind of testing framework they're using, how they're doing their pushes - at this point you should be well and truly educated on the basics of Git, subversion or whatever you're using (how to clone a repo, how to pull and how to do a PR if you're using Git). Pick one and use it for now while you're learning. Also, learn how to set up a clean development environment -- This will keep you from having dependency headaches down the road and it's worth an afternoon parsing through what virtualenv is and why you should use it. Always. At least until they come out with something more sensible to use.
Step 4: fork the repo and see if you can get the issue to repeat itself. Look at what the code is doing, look at why it's doing it and try to understand where it's failing. If you can't figure it out, don't worry. Keep reading up on error codes and learn how to read traceback. This is where you're doing the actual work of bugfixing...eyes on bugs is the only way to learn what wrong code actually looks like in production. If you're not seeing bugs, you're not learning anything. Try to write bug free code, but take notes (at least internally) when you see a bug you've never seen before - that's where you're learning more.
Step, the 5th: Google. I don't think I can say this enough. Google everything. You see an odd notification in your OS that you see a thousand times a month but have no idea what it means? Google it. Get a weird traceback error where an object that you KNOW is returning an int is throwing a None error? Google it. Wonder what lib you should be using to handle dealing with os paths? GOOGLE IT. Seriously, if you aren't on stack overflow as well as github - get there today. Take time and set up accounts and just learn their interfaces and the way they work. It's a good pizza and beer night kinda thing to do.
Step 6: Once you have the project, you've fixed typos, you're up to speed on everything and you're actually looking at and starting to discuss issues with other folks on the project (JUMP IN - Developers love interaction. If they're asking for help on something, don't be afraid to help...even if it's just pointing out a small logic flaw or something -- Help is help), you are now contributing to a project in a way most beginners never do. If it takes you a month, let it take a month. Spend an hour here or there on it if that's all you have. But do it. Don't wait. Get your syntax down and then go to town. Learn from good code, learn more from bad code, if you don't understand something, look it up or ask -- someone has probably asked it already. ;)
I know that's kind of a long-winded answer to your question, but the question itself is a little presumptive that people start projects scaled to be 'beginner', 'intermediate', and 'difficult'. But the honest truth is, every project starts out as an idea on a piece of paper or a file somewhere...if it's something you enjoy, then you'll struggle a little less, and hopefully that'll help.
--Tal
2
Apr 11 '18
I feel like I know "a lot" but my logic isn't very good.
this is an example of my code and someone's else code (logic much better)
3
u/mshaw346 Apr 11 '18
I’ve been taking the MIT 6.00.1 on Edx. It’s really good about explaining why you are doing what you are doing, not just how.
2
Apr 11 '18
This is all good advice. When starting out I focused too much time on trying read up and learn about every function which is a waste of time. It is better to learn things on a need to know basis as you progress, with the exception of standard things like data types, logic structures and so forth. Creating my very own micro-projects helped me a lot.
1
Apr 11 '18
Tutorials and guided stuff are ok in he beginning but get away from them as fast as you can, I like the message op
1
u/drthunder3 Apr 11 '18
Does anyone know of a cheat sheet or some short reference to structures and algos (with notation)?
1
u/XChrisUnknownX Apr 11 '18
Still reading your post but I agree. I am doing very simple projects mostly involving random, while loops, if, elif, else, and it has improved my understanding of syntax and basic concepts dramatically. I went from crashing the program on the simplest of loops to being very comfortable in the ultra basics. Now if I can just do that 50 billion more times, I might have enough knowledge to make something cool. Lol.
1
u/Eschin Apr 12 '18
I agree with everything you said. I have a huge, half done js project that taught me to code. Front end (forgot most), backend, sockets, oop, functional. Everything was used to solve a problem, it took 4 months of regular work to port it from client side to node. I recently went back to school and run circles around my peers. I also landed a pt dev job because trying to solve big problems has given me a massive breadth of knowledge. Incidentally I'm on my 5th language and have little issue sitting down with a new one.
All that said, every day is a struggle. I know next to nothing, at work I need hand holding, in school I spend 20-25 hours on an assignment. But you keep needing to learn, structure, design, managing complexity, new tools, fixing bugs. Its rough and while its gotten easier, its still a trek through the swamps every day.
19
u/ASIC_SP learnbyexample Apr 11 '18
agreed.. good luck with your project :)
I'd like to add an item though
do the tutorials
do the exercises
do projects
here's some more discussions/articles similar to this one:
what to code?
learning by converting code from one language to another
I know how to program, but I don't know what to program
Write a command-line utility
A noob programmer's opinion on how to learn to code
PS: stick with projects you start and don't abandon them easily, reach out for help..