This topic was published by DevynCJohnson and viewed 868 times since "". The last page revision was "".
- Topics - 444
Programming is an important part in computing. Programming allows developers to create new software that computers can use. Designing good programs is an important factor in being a great developer and creating popular/successful programs. There are a variety of programming tips I can provide that I hope will aid someone in their programming and design.
If the programmer knows many languages, choosing a language can be an important decision. Every programming language has its advantages and disadvantages. Some programming languages (like Python) are cross-platform. Others (like C/C++) must be compiled for each architecture and system that the programmer intends to support. Besides portability, performance is another factor to consider. For instance, assembly is not portable, but it is very fast. However, Java is portable (write once, run everywhere/anywhere), but such programs can be slow.
Besides considering the pros and cons of a programming language, if this is a team project, then each member's abilities must be considered. Also, if the chosen language is well known, then it is easy to get additional team members. However, if a less known language is chosen (like Ceylon), then it may be difficult to get new team members.
If the program is one that will likely grow, then choose a language that has many features and can offer growth. For example, shell scripting is fine for small needs that need a little script. However, using a scripting language (like BASH) for a large project may be a poor choice. Languages like C/C++, Java, Python, and others have many libraries and commands that can be used to design large and complex programs.
In summary, when choosing a language, think about these factors.
- Programmer's Knowledge/Ability
Once a language (or languages) has been selected, the next suggested course of design is to set some standards. Create a set of rules for organization. For instance, decide on a naming scheme for variables and functions. Then, it will be easier to work on the program over time and work with a team. Also, with an organized structure, maintenance and updates will be easier.
Use comments in the code to help remind yourself and inform team members of the purpose of a set of code. However, do not overuse comments because this can make the code appear cluttered and confusing. Also, try to follow the coding standards of the chosen language. For instance, when using Python, it may help a lot to follow the PEP standards.
When writing the code, place the code in an organized order. For example, it may be desirable to set/declare global variables near the beginning of the file. Then, global functions are usually set. Every programming language has its recommended layout. Sometimes, placing the code in a special order can help speed-up the code. For instance, some programming languages operate faster when the variables are set near the beginning of the file. Also, organization in a program can help the programmers find code within the file.
In summary, when designing the program's code, plan these factors carefully.
- Organized Code
- In-code Documentation (Comments)
Once the program has been written, it is important that the code be tested and debugged. Run the program and test every feature, command, button, etc. Try to break the program and think about the various actions users may perform on the program. Never assume the user will know how to properly use the program. Run speed-tests to find the slow portions of the program. Then, re-write that part of the program (if possible) to make it execute faster.
In summary, after writing the program, perform these actions.
- Debug some more
- Debug again
Throughout this whole process, it may help to keep the programming language's documentation near. Perhaps, the documentation can be downloaded in PDF form, purchased/rented as a paper book, viewed on the Internet, etc. Keeping notes and special or useful functions written down can help programmers. Programmers may want to create their own library of favorite or commonly used functions and snippets of code.
Once the program is complete, it helps to ensure that the program comes with thorough documentation/instructions. If that is not possible, then it may help to create a public webpage containing the manual.
- List of Programming Articles - http://dcjtech.info/topic/programming-and-development/
- Compiler Warnings are Helpful; Do Not Ignore - http://dcjtech.info/topic/compiler-warnings-are-helpful-do-not-ignore/
- Writing Your First C Program in Linux - http://dcjtech.info/topic/writing-your-first-c-program-in-linux/