Saturday, May 25, 2013

Project Naming / Penamaan Proyek (file, variable, identifier)

While there are plenty of projects that fail with descriptive names and plenty that succeed without them, I think naming your project is worth giving a bit of thought. Leslie Orchard tackles this issue in an  Advogato article (http://www.advogato.org/article/67.html). His article is short and definitely worth looking over quickly.

The synopsis is that Orchard recommends you pick a name where, after hearing the name, many users or developers will both:
  • Know what the project does.
  • Remember it tomorrow.

Humorously, Orchard’s project, “Iajitsu,” does neither. It is probably unrelated that development has effectively frozen since the article was written.

He makes a good point though. There are companies whose only job is to make names for pieces of software. They make ridiculous amount of money doing it and are supposedly worth it. While you probably can’t afford a company like this, you can afford to learn from their existence and think a little bit about the name you are giving your project because it does matter.

If there is a name you really want but it doesn’t fit Orchard’s criteria, you can still go ahead. I thought “gnubile” was one of the best I’d heard for a free software project ever and I still talk about it long after I’ve stopped using the program. However, if you can be flexible on the subject, listen to Orchard’s
advice. It might help you. [1]

C File Naming  Convention

File names are made up of a base name, and an optional period and suffix. The first character of the name should be a letter and all characters (except the period) should be lower-case letters and numbers. The base name should be eight or fewer characters and the suffix should be three or fewer characters (four, if you include the period). These rules apply to both program files and default files used and produced by the program (e.g., "rogue.sav")[2].

Rules for constructing variable name (in programming) [3]:
  1. Characters Allowed :
    • Underscore(_)
    • Capital Letters ( A – Z )
    • Small Letters ( a – z )
    • Digits ( 0 – 9 )
  1. Blanks & Commas are not allowed
  2. No Special Symbols other than underscore(_) are allowed
  3. First Character should be alphabet or Underscore
  4. Variable name Should not be Reserved Word
Rules for writing identifier [4]
  1. An identifier can be composed of letters (both uppercase and lowercase letters), digits and underscore '_' only.
  2. The first letter of identifier should be either a letter or an underscore. But, it is discouraged to start an identifier name with an underscore though it is legal. It is because, identifier that starts with underscore can conflict with system names. In such cases, compiler will complain about it. Some system names that start with underscore are _fileno, _iob, _wfopen etc.
  3. There is no rule for the length of an identifier. However, the first 31 characters of an identifier are discriminated by the compiler. So, the first 31 letters of two identifiers in a program should be different.
  4. Choose meaningful name for an identifier, it will be easy to understand and work on.
--------------------

Penamaan Proyek
Ada dua konsep sederhana dalam memberi nama sebuah proyek (Apps, web apps or others, especially open source projects).
  • Nama merefleksikan apa yang dikerjakan proyek itu
  • Mudah diingat
Simple bukan? Keep it simple, smart :*
Source (copy-past and translated):  
[1] Benjamin Mako Hill
[2] https://www.doc.ic.ac.uk/lab/cplus/cstyle.html#N10081
[3]http://www.c4learn.com/c-programming/c-variable-nameing-rules/
[4] http://www.programiz.com/c-programming/c-keywords-identifier
Related Posts Plugin for WordPress, Blogger...