Thread: how to be better in C

  1. #1
    Registered User
    Join Date
    Sep 2010
    Location
    Europe
    Posts
    87

    how to be better in C

    Hi. How to became better in C programming?

    I have done research online to find this:

    use code analysis tools
    conducting code review
    talking to other programmers
    reading good blogs
    write more code
    read books
    writing unit tests
    participate in forums

    I want to became professional in C. Any more advice?

  2. #2
    Registered User
    Join Date
    Nov 2015
    Posts
    3
    Try training in sites like Codeeval or hackerRank.

  3. #3
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Honing your trouble-solving abilities is a must. Go and find exercises that actually need some thought put into them. As Filipe suggested, training sites are good at this, but I'd vote more for online judges.

    Also, another must is having team experience. Find a group to build something together, or try to contribute to an open-source project.

    Other than that( and anything I forgot ), keep practicing. Thinking of the structure of a piece of code should be as natural to you as walking, that way you minimize potential syntactical and logical errors that could slow down a project's progress.
    Devoted my life to programming...

  4. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Short and simple answer: Practice. Like any skill, improving your programming ability requires frequent exercise.



    Some other things you should strive to master (non-exhaustive list):

    The language itself. Make sure you are familiar with the all the nuances of the language itself.

    The standard libraries. Get experienced using the standard libraries. The goal is not to know everything, but to know enough so that you can easily find functions for a particular problem you're trying to solve.

    Debugging. Learning how to troubleshoot programs is a skill unto itself, and needs to be developed.

    Data structures. There are quite a few common data structures used in programming - learning what they are and how to use them effectively increases your ability to write clever and efficient programs.

    Problem Solving. Learning how to break down problems and solve them piece-wise is a skill that helps overcome challenging requirements.

    Planning. Knowing how to develop and plan solutions "on paper" is imperative to writing clean, modular, and maintainable code.

    The following will also help sharpen your abilities:

    • Become familiar with the C standard
    • Frequent forums such as this - there is a lot of knowledge shared here, and you can learn a lot just by reading threads
    • Learn about the various tools used by programmers
    • Become familiar with good coding practices and common language idioms


    When you begin learning a new concept, start with little practice "throw-away" programs until you become comfortable with that concept. Then you want to start thinking up programs to write to really utilize all of your skills.

    This leads to the next big step - figure out what direction you want to go. Do you want to write GUI applications? Games? Console utilities? Microcontroller code? Analytical tools? Knowing what you want to program will inform your direction of where to go next. Depending on where you want to go, you might start learning how to use third-party libraries to help accomplish your goals.

    And remember - if you're completely comfortable with the code you're writing, then you're not learning anything. Be willing to go outside of your comfort zone in the pursuit of experience.
    Last edited by Matticus; 01-06-2016 at 08:00 AM.

  5. #5
    Registered User
    Join Date
    Dec 2015
    Posts
    34
    Probably going to echo some of the comments already. The best thing you can do is code. Code as much as you can, start by coding every single code example in books you read on the subject.

    Then think about how you can make it do something else or improve on it. Read as much code as you can, places like github, pastebin etc have a crap-ton of code. Read how others write code. Programming is a lot like the written language, so don't just learn to write it, learn to read it too.

    Probably the best advice don't be scared to 'break' things. Deliberately break your code, or do crazy things and see what pops out.

    Take pride in your work. When you've got the basics and you're moving away from 'coding as much as possible' mode.

    Start thinking about how to make your code more readable, more elegant. Points you back to reading other peoples code. Ask yourself whether or not the intention of the code is easy to follow. If it is, how did they achieve that? otherwise, what have they done to make it confusing and what would you have done to make its intent more clear?

    And pretty much everything Matticus said.
    Last edited by Lawson; 01-06-2016 at 11:33 PM.

  6. #6
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    I want to say, establish a testing framework. Write tests that ensure the behavior you're expecting actually happens. Keep these tests around and updated as you expand your code.

  7. #7
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    All of the things the OP has mentioned are generally applicable to any programming language. If you want to learn more about C, the best way IMO to get started is to read and write lots of (quality) C code. What is quality code and what is not, you will learn over time. An important part of really learning C is to understand the language specification, especially regarding what kind of code constitutes undefined behavior (even though it may compile).

Popular pages Recent additions subscribe to a feed