8 Tips for Beginning Programmers
Many of the fundamental concepts of computer science are used regardless of skill level. For beginning programmers especially, however, building a solid foundation on which to grow is highly important. Here are eight tips to help develop as a beginning programmer.
1. Remember convention
Whether a developer is programming for an organization or for herself, consistency is key. While individual companies will have their own standards, programmers should be aware of when to use camel case or snake case; know best practice for commenting out their code; and what proper documentation looks like. Variable names should be clear and descriptive with correct capitalization. Comments should be like Goldilocks—too many comments and the viewer gets distracted by irrelevancies, and too few do not provide enough information.
2. Start with pseudocode
Good writing starts with an outline, and writing code is no different. Pseudocode lies somewhere between English and true programming language—it lays down every step of the code logic and process without worrying about syntax. Many programmers find it much easier to begin developing a program from pseudocode rather than from scratch because of its lack of limitations. Pseudocode can be written anywhere; the developer can use a text editing program, a piece of paper, or a whiteboard. To the beginning programmer, pseudocode can be a great way to tackle daunting problems one step at a time.
3. Learn continuously
Practice makes perfect. Continuous, frequent practice will build experience and expertise with the tools of the trade, and having a comprehensive portfolio increases a developer’s chances at landing a job. Technology is constantly changing, so keeping up skills is vital to stay relevant to the field. Programming languages come and go—Java’s predecessor was C, C came from B, B came from BCPL, BCPL from CPL, and so on. Thirty years ago at Westmont, students took classes in BASIC, but today the language in its original iteration is considered vintage. Stay up to date on technological trends and keep learning new skills while maintaining old ones.
4. CLI is your friend
Don’t be afraid of using the command line. Especially with lower level languages like C, the command line interface allows the user to interact with her computer more quickly and powerfully than a graphical user interface (such as dragging files into a desktop folder). Git, for example, is almost exclusively used on CLI as opposed to GUI. It’s much easier to type a command line prompt to push a repository to Github than navigate to the website and upload it manually—git is designed for command line. While CLI can be intimidating for first-time users, good command of the command line will save time and stress in the long run.
5. Data structures and algorithms
Data structures and algorithms are the building blocks to good code. Different search algorithms have different efficiencies in different scenarios. If a programmer wishes to locate a single element in a short unsorted list, she might use linear search, which always has an
O(n) time complexity. If she is searching a large sorted array, however, binary search is much faster at
O(log n) in the worst case. With a comprehensive arsenal of data structures and algorithms under her belt, an experienced programmer will know quickly what the optimal data structures and algorithms to use in most scenarios will be.
6. Be aware of resources
As computer programming becomes more and more popular outside of the professional world, the number of free and paid resources has skyrocketed. New programmers are often unaware of the vast array of tools at their disposal both online and otherwise. Don’t be afraid of using Google. Websites like Codeacademy, Stack Overflow, and Github offer free lessons, code examples, and ways to get questions answers for programmers of all levels. A number of great fundamental books, like Introduction to Algorithms and The C Programming Language, are also available for purchase online and in bookstores.
7. Recognize patterns
A common mark of novice code is multiple elements that could easily be consolidated into one, e.g., a repeated function call that could be put in a loop or a series of similar variable declarations. If a developer notices patterns or repeated elements in her code, she might be able to clean it up by joining repeats into a single function or method. As opposed to manually declaring fifteen very similar variables one by one, the developer can write a loop to automatically populate an array with the variables she needs. Recognizing patterns and writing more elegant solutions is key to making the shift from beginner programmer to experienced developer.
8. Learn from failure
Code will be buggy. Tests will fail. Obstacles will seem insurmountable. It’s okay to fail, and every developer does. What distinguishes a mature programmer from a beginning programmer, however, is calm acceptance of inevitable imperfection and the approach of problems with the right tools. Being familiar with her IDE and debugger can save a developer hours of frustration, and viewing errors with a positive mindset—as challenges to beat rather than trials to be overcome—will keep morale up. Even the most competent programmers battle bugs.
Caught the programming bug? Find out more about what the CATLab is doing this summer by following us on social media here: