The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Coding system?

What do you suggest for a coding items?
e.g. for a school registration system.
Is fixed width code better than var. in length code.
e.g. ENG101-01 for english subject (always 9 in length)
    COM101-01 for computer subject
or non fixed subject code like:
  ENGLISH1
  COMPUTER1
  ENG-PLUS
  ENG-ADV-1

a non-fixes subject code might give more details. but poor standardization.

thanks for any info.
j2e
Monday, June 05, 2006
 
 
Have you tried splitting it into something like:

Subject Code + Term or Level Code e.g.

ENG 101
ENG 102
ENG 201
PHY 100
ECO 200

At least it gives you more flexibility in terms of being able create several subject and code combinations.

Hope this helps.
Phillip Flores Send private email
Monday, June 05, 2006
 
 
Agreed with the response. Have a look at a good database text on "first normal form". In my experience you are storing up trouble for yourself when you encode information into fields.
George Jansen Send private email
Monday, June 05, 2006
 
 
thanks.

Do you consider ' ' space as a good separator than '-' dash? I mean does space or dash separator matters ?
j2e
Tuesday, June 06, 2006
 
 
What I mean is having a table e.g. Subjects with two fields (1) Subject Code
(2) Subject Number

The subject code field will contain the generic names such as ENG for english, ECO for economics etc.

The subject number field will contain the type of subject it is, is it for freshmen or sophomores or is it a master's level etc.

You can then concatenate the values for presentation purposes.
Phillip Flores Send private email
Tuesday, June 06, 2006
 
 
Do everything in your power to avoid putting more than 1 piece of data into a single field. You have courses (English, Math, etc.), you have terms (fall, summer, whatever), and you have levels (beginner, advanced, 101, 102...). That's 3 separate data points, so you need 3 fields. You also have teachers, and you would never create a single field Eng-101-Fred. As pointed out, you can concatentate for presentation if necessary.
Ron Porter Send private email
Tuesday, June 06, 2006
 
 
"Do you consider ' ' space as a good separator than '-' dash? I mean does space or dash separator matters ?"

It depends on how the data will be saved.

If you follow the advice given and put ENG in one field and 101 in another field, then it doesn't matter.

If you decide to ignore our advice and you put ENG-101 in the same field, then use a hypen (the - symbol). Using spaces will create a lot of problems and give you nightmares.

I agree with George and suggest that you read a book on how to create a database, or take a class.  The school registration system is usually the first example database they will show you how to build - and they will explain things better than we ever could.
TheDavid
Tuesday, June 06, 2006
 
 
Don't do this--this is a joke:

<cruel>
instead of a space (0x20) character, use your favorite >0x7F blank character, like 0xA0 or 0xFF as a delimiter. The person who takes over your code will curse your mother for having carried you.
</cruel>
Steve Hirsch Send private email
Friday, June 09, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz