You are on page 1of 2

1/ Set name : Variables : type : e.

x viewT able, nameTextField Method : purpose : getImage, Searchable name : not listView => list_View Implement, Interface : name the same of their names, w/o I in advance : e.x Student, not IStudent Class name is a noun, not a verb. Method Name : begin with a verb, E.x: getItems

2/ Method Set name property and effective for user to understand Small little than a screen => break down into small part Just do one thing, no more than one Arrange code from top to bottom For switch statement, always put it on as low level as possible because when we put it on top, our program will become so sophisticated to modify when it needed o My general rule for switch statements is that they can be tolerated if they appear only once, are used to create polymorphic objects, and are hidden behind an inheritance

Choosing the name that show the function of this method

Method with as less arguments as possible Flag or a Boolean in a method is so terrible => split it into two separated methods

84

You might also like