Method names should start with verbs. width() isn't a width, it is a method that gets a width and should be named appropriately, ie getWidth(). That goes doubly so for area() which not only isn't an area, it isn't even getting an area, it is calculating an area and the name should reflect that, ie calArea(). You using property naming conventions for methods is a bigger smell than anything you're pointing out.
And I don't know what kind of systems you work in, but a Window class that doesn't allow access to its list of children is best described as nearly useless.
Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
I have asked my child what is 'calArea' and she laughed. She's perfectly aware of what is an area. And she has a friend called 'Cal' btw.
I work in a world class software company and have looooots of windows, we don't access objects since we believe in encapsulation and information hinding principles.
Windows are ok without being accessed
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Method names should start with verbs.
width()
isn't a width, it is a method that gets a width and should be named appropriately, iegetWidth()
. That goes doubly so forarea()
which not only isn't an area, it isn't even getting an area, it is calculating an area and the name should reflect that, iecalArea()
. You using property naming conventions for methods is a bigger smell than anything you're pointing out.And I don't know what kind of systems you work in, but a
Window
class that doesn't allow access to its list of children is best described as nearly useless.what is 'cal' ?
I have asked my child what is 'calArea' and she laughed. She's perfectly aware of what is an area. And she has a friend called 'Cal' btw.
I work in a world class software company and have looooots of windows, we don't access objects since we believe in encapsulation and information hinding principles.
Windows are ok without being accessed