2010-10-13, 12:54 AM
A few things I'm noticing:
In verbs.java, you have VERB and REG. It's generally not good practice to have variables be all uppercase letters. If I'm looking at code for any language and I see all uppercase letters, I'm going to be looking around for static, global constants. It's good practice to do this in any language. So change VERB and REG to verb and reg to avoid confusion.
Another thing I like to steer clear of are try/catch exceptions. Unless you need to inform the user of a problem in the catch{} section or if there are multiple things that could go wrong, there is no need for a try/catch. Perform a string split, check the length of the array, and if it's the wrong length then tell the user what's up (if-else).
Also, it's bad karma to have "verbs" be a method. A method must be a Noun+Verb and variables must be nouns. A method named "verbs" is confusing.
In verbs.java, you have VERB and REG. It's generally not good practice to have variables be all uppercase letters. If I'm looking at code for any language and I see all uppercase letters, I'm going to be looking around for static, global constants. It's good practice to do this in any language. So change VERB and REG to verb and reg to avoid confusion.
Another thing I like to steer clear of are try/catch exceptions. Unless you need to inform the user of a problem in the catch{} section or if there are multiple things that could go wrong, there is no need for a try/catch. Perform a string split, check the length of the array, and if it's the wrong length then tell the user what's up (if-else).
Also, it's bad karma to have "verbs" be a method. A method must be a Noun+Verb and variables must be nouns. A method named "verbs" is confusing.
