Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to become good programmer?

Tags:
  1. Sep 12, 2014 #1
    I find myself interesting in programming especially android programming can you share ideas that will help me to become good in programming and it will be good if you will share some links on android programming tutorials.Thank you in advance.
     
    Last edited by a moderator: Sep 12, 2014
  2. jcsd
  3. Sep 12, 2014 #2

    phinds

    User Avatar
    Gold Member
    2016 Award

    I can't really tell you how to become a good programmer but I can tell you for sure, from lots of direct experience, there ARE very good programmers and very bad programmers and the difference in their effectiveness is not 10% or 40% or 90%, it is multiples. My rule of thumb is a factor of 6 to 10 between the worst and the best. Unfortunately, the PAY difference between the worst and the best is rarely more than maybe 50% when it should be a lot more.

    SO ... I'm glad to hear you want to become one of the good ones.

    The one thing I've noticed most is that the best programmers tend to have a natural talent for and a love of both math and logic.
     
  4. Sep 12, 2014 #3

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Programming is part skill, and like all skills, it needs to be practiced constantly so that you can become good at programming. Write as many programs as you can, but start small and experiment. Later on, when you have acquired some experience, you will find it easier to write larger, more complex programs having mastered smaller apps.
     
  5. Sep 12, 2014 #4

    Borg

    User Avatar
    Gold Member

    Practice, practice, practice and understand that the learning never ends. There's always a new way of doing things.

    In my experience, the best developers are conscientious about their work and the worst will just do the minimum required to complete a task. For example, I know many programmers who will be given a bug to fix and will look to see how the bug (and its repair) affects other parts of the system. I've seen other programmers who will 'fix' something and break everything except the thing that they fixed because they didn't look deep enough at the problem.

    I haven't looked at Android programming in a while but here's some links. You will have to have a working knowledge in Java though.

    Android - Getting started

    Android Development - Tutorial

    And, don't follow the advice in my signature. :tongue2:
     
  6. Sep 12, 2014 #5

    TheDemx27

    User Avatar
    Gold Member

    One thing I would recommend doing is to comment on a lot of your code. I hate it when someone just posts a bunch of code where you have to figure out for yourself what section does what and the variable names aren't very specific.
     
  7. Sep 12, 2014 #6

    berkeman

    User Avatar

    Staff: Mentor

    One very important skill to gain is to get comfortable and practiced using a "Source Control" system. We've use several over the years here at my work; we currently are using Perforce.

    Source control is used to help you track the changes you make in your software (to fix bugs or to add features). It backs up various versions of your code (and the associated include files and library files and make files, etc.), which is a huge help in keeping track of what-all you have done in your code development.

    You should also gain some experience with bug tracking systems/software. We used to use Remedy here, but recently switched to JIRA.

    http://en.wikipedia.org/wiki/Source_control

    http://en.wikipedia.org/wiki/Bug_tracking_system

    Finally, it's good to learn about the various important subjects in software engineering -- how compilers work, how to use data structures most effectively, how to optimize code, how to organize and document your code most effectively, etc.

    Have fun! :smile:
     
  8. Sep 13, 2014 #7
    And there's GitHub, which is one of the most popular hosting site for free for open source projects.

    Bitbucket is from the same company as Jira, and provides free git or mercurial repos and issue tracking. Unlike GitHub, they allow commercial projects to use the service for free for up to 5 users.
     
  9. Sep 14, 2014 #8
  10. Sep 14, 2014 #9

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    1)
    I second this. When anyone talks about "self documenting code", poke him in the eye.

    2) Learn to make comments that are formatted for a documentation tool like Doxygen.
    3) Don't get too cute with your code. Keep it simple.
    4) As recommended by others, learn and use a source code configuration management tool. I use Git even when no one else is involved.
     
  11. Sep 14, 2014 #10

    rcgldr

    User Avatar
    Homework Helper

    So you don't like Cobol?

    Since you mentioned android programming, I assume you mean applications programming for some type of android device, as opposed to modifying the android operatins system itself or creating the equivalent of a device driver for the android operating system. So you've already chosen a specific area of programming. Previous posts already included links for android programming so have a look at those.

    For a learning process, start with simple android apps, then go on to more complicated ones.

    Once you have a job, there will normally be some standards for codiing conventions, source code control, debugging / verification testing, ... , so you will be following those standards, even if they aren't the best. Each project / job usually involves some form of specialization, so your experience in specific fields of programming (and math / science) will evolve as you change projects and or jobs.
     
  12. Sep 15, 2014 #11

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    And when someone says to use a tool such as GhostDoc to automatically generate that "self documenting code", poke him in both eyes.
     
  13. Sep 15, 2014 #12

    Borg

    User Avatar
    Gold Member

    I guess that I'll add my biggest dislikes.

    • That will never happen.
    • That will look good on my resume.

    First one by customers who later insist that they should have been told about it when their previous decision comes back to bite them.

    Second one by developers who overkill a design just so that they can learn a new language or API.
     
  14. Sep 15, 2014 #13

    harborsparrow

    User Avatar
    Gold Member

    Write some programs in any language. Keep coding. Don't name variables things like 'x'--give them descriptive names. Practice, practice, practice. And you'll become good by doing. No amount of studying without also a lot of practice will get you where you want to be.
     
  15. Sep 17, 2014 #14

    chiro

    User Avatar
    Science Advisor

    Learn to keep two things in your head as much as you can - state space and flow control.

    State space comprises of all the data, its structures, and variables and flow control looks at the execution of
    code and how it relates to the values and/or changes in state space.

    Practice will help you go from keeping a few things in your head to being able to track entire platforms,
    modules, and applications in your head well enough to debug them, modify them, and make use of them as efficiently as possible. The more you code, the easier it will be to keep track of more complex programs and their associated repositories.

    The easiest way to do the above is through experience - namely debugging. Debugging will always help in this regard. The other way is through learning how to organize code and data structures and to find a way of mapping these internally (ie in your head) so that you can make sense of the relationships intuitively as you gain more experience, practice, and skills.
     
  16. Sep 27, 2014 #15
    About commenting, how should we know which to comment. Should we put comments on every line of code?

    Also, when writing pseudocodes, how should we determine if the pseudocode is understandable by everybody. I got deducted point from our lab because "someone who doesn't know programming" will not understand your code.
     
  17. Sep 27, 2014 #16

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    The minimum is to document the purpose, inputs. and outputs of procedures, any section of code within there that has a single purpose, and any parts that are unusually obscure. Beyond that, the programming standards may require more. I add a lot more if I plan to hand off the code to another programmer who is not very experienced with the programming language or the methods being used. References to documents and web-sites that explain algorithms is very helpful and it puts the burden of explanations on the referenced documents. They are usually much clearer than I could be.
    I think that rephrasing the code into a natural language does not hurt. Just parroting the code is annoying to the reader. I don't have much experience with pseudocode other than the comments that I just described.
     
  18. Sep 28, 2014 #17

    Borg

    User Avatar
    Gold Member

    I also will add comments where the code is more complex w.r.t. the requirements that apply to it. In very complex cases, I will list the various scenarios that may occur. I also occasionally reference bug report IDs from the bug reporting systems that we use along with the date and my initials if I think that it would be helpful. On larger projects, one tends to work in the same sections of code such that you may come back to a method that you wrote months or even years earlier. I can't count the number of times that I have saved myself hours of analyzing because of the comments that I put into the code.
    I think that "someone who doesn't know programming" should learn how to program before trying to understand the code of others. :rolleyes:
     
  19. Sep 28, 2014 #18

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    Amen to that. I have actually spent hours looking at someone's code, trying to understand it, wishing there were more comments. Then I realized that it was my code from years ago.
     
  20. Sep 29, 2014 #19
    Guess I have to poke my eye because I don't comment my code. I only do it when I got "smart" or "dumb" with my code and there is a really good reason for it. I comment on that part so others will know why I did it that way. In general, I try to write descriptive names and lots of test. I use tests as my documentation.

    @preceptor1919 You should ask your teacher & TA about the comments. They are the one that grade your work, and they know what they want. In real life, I say, do whatever it is that makes your future self thank you when you have to fix your code.
     
  21. Sep 29, 2014 #20

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    Someone looking through hundreds, maybe hundreds of thousands, of files of code would have to read through each one to find out what it is doing. Each line of code would have to be studied. That would be like a library of books with all the covers torn off and the table of contents removed. When you are writing the code and have it all figured out, it only takes a couple of minutes to put some comments in. Unless you think that your two minutes are worth more than an hour of another person's time, you should put comments in. I often have to look into massive amounts of code that other people have written and I can say that I appreciate good comments. And I am not exaggerating about the hundreds of thousands of code files.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook