Comments The Benefits of adding comments to your code is gaining the ability to quickly read that comment and understand what a chunk of coding is doing. Share this: Twitter Facebook. Like this: Like Loading Leave a Reply Cancel reply Enter your comment here Fill in your details below or click an icon to log in:. Email required Address never made public. Notify me of new posts via email. When a system or program is being developed for a project is must have readable code, due to making it the program easy to maintain.
However, there are ways to improve readability of code. To make the code more readable the programmer can add colour coding, camel casing, comments,indentation , collapsible boxes and white spaces. Indentation is when it separate parts of code such as, statements and loops. In addition this makes it easier to find and read code. Colour Coding Colour coding is important for developing programs. When developing programs, much IDEs Integrated Development Environment will automatically colour code the program which makes it easier to understand the code.
As code cannot be directly colour coded and saved in those colours, it is up to the software that is used to edit and develop the code to colour code. Sign Out View Profile. Over 2 million developers have joined DZone. When coding in an Agile environment, making your code readable for others is key.
Read on for some great tips on how to make your code easier to read. Like Join the DZone community and get the full member experience. Join For Free. Consider this example: The comments I added at the function definition can be previewed whenever I use that function, even from other files. Here is another example, where I call a function from a third party library: In these particular examples, the type of commenting or documentation used is based on PHPDoc , and the IDE is Aptana.
There is more than one way of indenting code. There are two popular options: camelCase: First letter of each word is capitalized, except the first word. Just being consistent. The principle states: "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
This is precisely the reason why newspaper articles look like this: It is a good practice to avoid writing horizontally long lines of code. Here is what CodeIgniter looks like: 10 - Consistent Temporary Names Normally, the variables should be descriptive and contain one or more words.
Opinions expressed by DZone contributors are their own. Agile Partner Resources. Let's be friends:. This report will talk about why it is important that a code is easy to read and if it is hard to read, then it will give some factors on what needs to be improved so that the code is easy to read.
Stuvia customers have reviewed more than , summaries. This how you know that you are buying the best documents. You can quickly pay through EFT, credit card or Stuvia-credit for the summaries.
There is no membership needed.
0コメント