Posted by: mattrmiller
It has been a while, but I am back with another round up of What Makes a Good Developer. Today I want to talk about code syntax. Now this is different than code commenting discussed in another episode, but equally as important.
What Is Code Syntax?
Code syntax is the way you format and label variables, functions, and other parts of code. It’s a standard for code, much like paragraphs, periods, and notations are for a standard for writing.
What is Hungarian Notation?
Hungarian notation, sometimes referred to as Hungarian Name Spacing, is a way of labeling your variables in a way that will be easy to identify just by their name. For example in C++ some developers will put a "str" in front of a string variable, or an "n" or "i" in front of a integer variable. To go a step further they will put a "m_" in front of a member variable. There are various lists with the prefixes available, and they will vary from language to language.
Why Should I Use It?
Much like code commenting, correct syntax is important amongst any development team. It gives a uniformity to to the final product. Imagine a book that was twenty chapters long. Each chapter was written by a different author, and each author had their own writing style. It would be difficult for the story to flow from chapter to chapter if this were the case. Correct syntax also helps with code organization, and plays a big role in source code control. Syntax will help you team support each others work and it will be easier to debug and expand if formatted correctly.
Yeah But I Develop Alone!
It’s still a good idea to start practicing code syntax. Most likely some day you will be a part of a team that enforces code syntax policies. It will be much easier if you are familiar, or have worked with code syntax before.
To Each Their Own
Now much like a lot of things, there are many different code formatting standards out their. My suggestion for this is first look at what the language developers recommend and use, after all they wrote and support the language you are developing in so they would know best. If this doesn’t work for you, research a standard that will work best for your team, and make sure everyone conforms to it. It should be the program manager, or the source code control specialist that makes sure code is formatted and archived properly.
…
It may sound cheesy but code is something you should be proud of as a developer. Code syntax provides organization as well as good aesthetics. It’s much easier to address archived code if it is formatted correctly, than it is if it was spaghetti code.
|
|
Other articles in the Computer section
What make a good developper part 1 - part 2 - part 3
Dreamweaver MX Productivity Tip
Main topics: microsoft -
Other sections
Pages in Spanish : tarot, astrologia, videncia gratis - sexo gratis adultfriendfinder - chat gratis - tips de belleza - mp3 - movil - préstamos
personales |