LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-30-2013, 12:22 AM   #1
Garda
Member
 
Registered: May 2005
Distribution: Debian
Posts: 83
Blog Entries: 2

Rep: Reputation: 15
Becoming a better programmer


Hi,

So, I went from a very basic level of skill (essentially having only made it part-way though programming tutorials) to a "not bad" programmer in the space of a little over a year. I have been working on a project, in Python.

I have a reasonable idea of data structures, I have read a little on design patterns and some "advanced"/"pro" books on programming in Python.

Can anybody recommend what to do/read next to become a better programmer?

In particular, what's bothering me is that I'm almost certain that I couldn't design something that was really big and complicated. Also, I know that a lot of the algorithms I use are slow and inefficient. Looking at code on github, some stuff can be really nice and elegant and clearly designed and put together by somebody much better at this than me. I know the above is vague and not too specific, but, any suggestions?
 
Old 04-30-2013, 01:04 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,848

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
I think it is not a simple issue. You can be advanced or professional from one point of view and novice from another point. The most important thing is to learn new techniques and to be precise (perfect?). As you wrote your codes are not so efficient, so try to make them better, try to find your own mistakes and failures. And practice, practice, practice. I think all of us have different knowledge and you also will have your own "style". The others will give you a lot of books to read and they are certainly useful, but you need to find your own way. Probably it will take a long time, years - or forever? And also some more practice....
 
1 members found this post helpful.
Old 04-30-2013, 03:21 AM   #3
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 275Reputation: 275Reputation: 275
Study and do many exercises
A good thing is find different way to resolve a problem. Try, try and try.
 
Old 04-30-2013, 12:50 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Looking at code on github, some stuff can be really nice and elegant and clearly designed and put together by somebody much better at this than me.
Copy them

No, I'm not joking. Studying existing solutions is very important.

Head First Design Patterns (http://amzn.com/0596007124) is a good book to get you thinking about object-orient problem solving.

The SICP, which I have not worked through myself, is a fantastic one to get you into solving problems with a functional approach.

Python is a multi-paradigm language, so both books are applicable.

Last edited by dugan; 04-30-2013 at 12:59 PM.
 
1 members found this post helpful.
Old 04-30-2013, 01:17 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
In all seriousness: Get a job.

Programming is like swimming ... you can't learn it with books. You need to get into the pool. The sooner the better.
 
Old 04-30-2013, 01:30 PM   #6
marc_online_
LQ Newbie
 
Registered: Apr 2013
Location: The Netherlands
Distribution: Linux Mint Cinnamon
Posts: 15

Rep: Reputation: Disabled
Talking How to become a better programmer?

Practice, Practice, Practice, Practice, Practice, Practice, Practice, Practice, Practice.

And communicating with fellow programmers of course.
Cheers.
 
Old 04-30-2013, 02:15 PM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Garda View Post
I have been working on a project, in Python.
...
In particular, what's bothering me is that I'm almost certain that I couldn't design something that was really big and complicated.
First learn C++

Python is a very bad language for "big and complicated", especially when the programmer doesn't have a lot of experience in "big and complicated".

Even in C++, there is no substitute for experience. Sometimes the best way to get experience is: Do it wrong and then do it over. Sayings like "measure twice, cut once" are great for carpentry and many other fields. But they don't hold up in software engineering.

If you don't have enough experience to design something correctly, no amount of thought or structure (or reading and research) will cause you to design it correctly. You can spend far more time designing than coding and still have a completely garbage design.

This is definitely not the right advice for every situation, but it is often correct and rarely used: Start coding early. Plan on getting most of it wrong. When you get into trouble, make sure you understand why.

The total time to do it wrong and then design it right is often less than the time to design it right in the first place. If you are being paid for the work, you need an unusual amount of trust and flexibility from your boss to get away with this. Otherwise you might be boxed into keeping the initial bad design and layering on a mass of patches. If you are your own boss, doing it wrong before designing it right can work very well.

It also helps you think modularly from the beginning. When you are working on a piece you understand, but expect to throw away the surrounding pieces later, ask yourself what it would take for the current piece to be kept. Does this chunk of functionality represent a natural chunk of the total design, such that you might throw out the surrounding pieces without changing the boundary of this chunk?
 
1 members found this post helpful.
Old 04-30-2013, 02:21 PM   #8
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by johnsfine View Post
Python is a very bad language for "big and complicated"
If you're limiting the discussion to desktop apps then yes, that's true. It is, however, absolutely not true for website development. There are a large number of big and complicated websites written in Python (addons.mozilla.org being one of them), and a lot of Python-quality (read: very good) libraries to support building architectures for this level of scaling.

And for the record, I agree with the following completely:

Quote:
This is definitely not the right advice for every situation, but it is often correct and rarely used: Start coding early. Plan on getting most of it wrong. When you get into trouble, make sure you understand why.

The total time to do it wrong and then design it right is often less than the time to design it right in the first place.
Btw...
Garda, since you were asking for resources, pyvideo.org is an important one.

Last edited by dugan; 04-30-2013 at 03:00 PM.
 
Old 04-30-2013, 06:19 PM   #9
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 750

Rep: Reputation: 156Reputation: 156
As sundialsvcs noted, get involved. That of course can be easier said than done. So try and invent a meaningful project that can be achieved at home?

And remember that "big and complicated" is a series of "small and bite sized" problems/challenges. Part of being a good programmer is the ability to break a task down into component parts. Work on each part, test it and then build it into the bigger project.
 
Old 05-01-2013, 07:00 AM   #10
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by timl View Post
"big and complicated" is a series of "small and bite sized" problems/challenges.
That is only true for a very skilled and experienced programmer.

Quote:
Part of being a good programmer is the ability to break a task down into component parts.
Most software engineers break big tasks down into the wrong component parts.

Quote:
Work on each part, test it and then build it into the bigger project.
Doing each part well is necessary to do a big project well, but not sufficient.

I have seen (and been forced to use) a lot of formal design methods that try to deal with that big problem of software engineering. But none of them are actually helpful. If you pick a hard enough project, getting the modularity correct is critical and it is also an art, not a science.

Some of us (sorry for the ego, but I'm trying to be honest here) are naturally good at it and most are not. But at any level of native skill, experience can make a big difference (while formal design methods generally don't).

Finding clean boundaries between sections of a problem is the most important job for an engineer working on complicated tasks. That requires the more basic skill of knowing the difference between a "clean" boundary and a bad one. I don't know how to teach or even describe that skill. You need to find it yourself.
 
1 members found this post helpful.
Old 05-01-2013, 08:18 AM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
I would bypass the entire (non-)issue of "which programming language to use," and/or whether one is better-than the other. (I find the entire notion to be irrelevant.) The point, for me, is this: You need to write programs ... lots of them. Programs that other people actually use and can critique.

Over time, you will constantly find yourself in "shops" that have standardized on this-or-that programming tool(s). You can never predict which one(s) will be next.
 
Old 05-01-2013, 08:55 AM   #12
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by johnsfine View Post
The total time to do it wrong and then design it right is often less than the time to design it right in the first place
Bingo! That's probably the first time I've heard that said, even though I've believed it (and even proven it, at least within my own circumstances) for many years. I think this is particularly true when there are significant elements of the problem that are unknown. This might be something like how to program a particular device, how the software fits into a larger system or integrates with other software, or it might be as unassuming as using a new OS or programming language. If the problem is simply how to produce another instance of something you've already done numerous times (another web site, another accounting/inventory/other business package, etc), then johnsfine's rule might not apply.
Thank you, johnsfine. Unless someone else has already taken credit for the concept, I vote that we coin it the Johnsfine Rule.
--- rod.
 
1 members found this post helpful.
Old 05-03-2013, 01:04 AM   #13
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by Garda View Post
I'm almost certain that I couldn't design something that was really big and complicated.
You are certain because you haven't tried(?)
Figure out a domain in which you are interested e.g. web designing/networking/databases etc.
Pick up an existing `open source`software which fascinates you w.r.t the domain in which you
are interested.
Do NOT study its code right then. Study its functionalities.
Pick up its two simplest looking functionalities and implement them.
Then post you code for review on LQ or here.
Study the people's responses and dwell on what you could have done differently and why.
Last of all study the code of that software to see how they have done it.

Now, you have three designs (solutions) to the same code: your own, other reviewer's, and the
programmers of that software.
IMO, this approach will make you learn how to think.

Last edited by Aquarius_Girl; 05-03-2013 at 01:06 AM.
 
2 members found this post helpful.
Old 05-03-2013, 01:42 PM   #14
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I think it is much better to have a review of a design, than of a completed project. Important issues should be caught as early as possible in the process, as it makes no sense to put in code what should be done completely differently or not done at all. A code review should be to assess whether it meets the requirements as designed, as well as a possible a code QA.

--- rod.
 
Old 05-03-2013, 03:18 PM   #15
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
  1. Remain Teachable
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I am a programmer(Student). How can i help the Linux community as a Programmer? mgsurya Linux - Newbie 11 07-21-2010 03:56 AM
Who's the programmer Heiner Linux - General 1 10-13-2007 10:50 PM
Programmer to Programmer ( Long Story Of A GUI ) mdoubledragon Programming 1 10-13-2005 05:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration