Jump to content

Uber

Members
  • Posts

    2
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Uber's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. setName(string) is a setter and getter. It is actually good practice to use those. Eclipse adds them that way when you select add getters and setters for a methodAs said before, I usually abbreviate classes and then add a number or something memorable if I have more than one. writing db instead of documentbuilder1 5 times is way easier. Plus in my code, you can clearly see what the variable name comes from. db is obviously an abberviation of DocumentBuilder. It's not bad coding, it's actually good coding. And I was planning on putting an initializing thing inside of it then I realized I didn't have to. All methods - especially in c++ require constructors and destructors for adequate memory management. and if you know how to code, you should be well versed to follow what the variables mean. It seems to me that you jumped to the bottom of the code instead of reading all of it and confused yourself. about the empty constructor - java is build in such a way, that; if there is no constructors defined in the class then default (empty) constructor will be created automatically. so there is really no need to have an empty contructor in the code. If you have made a contructer with parameters, java does not automaticly create a defult one. in your code you only have on contructer(without parameters)...you dont use inhairitens, so i really cant se why you have it there. (again i have only been programming for 7 weeks. i migth be wrong, and if you think i am please tell me why so i know what i am talking about in the future) I know what the variable means, i wasn't specifly saying that db was hard to find, but in large snippets of codes, if you have random letters scattred around it hard to know what is what. you mentioned eclipse - it has a feature that, so you dont have to write DocumentBuilder everytime, you can just wirte doc and press Ctrl-Space. Personaly i dont think two letter variable is viable. Makes it easier for me and anybody else to read and understand the code.
  2. First off all, i would like to say that i do not consider my self a pro. i have only been programming for 7 weeks. but i wanna ask you a couple questions. Why do you, in your User class, have a contructer that calls on methods to setName etc? when you can simply have this.name = name; i dont se you use setName(method) anywher else in the code. so why do you have it there? In userManager you have an empty contructer wich is just bad coding.(Not a question) Why do you use random variables, such as un/db?(i mean c'mon db could be anything.. database to mention one ), if your make codes for public use please change those to something you understand insted of finding where you made those variables/objects. db = documentbuilde.. this Anyone who scripts here, especially on mac or linux can figure out how to save files them selves. - your qoute. How should anyone manage round the code and change anything, if the dont know what the variables stand for?
×
×
  • Create New...