DEV Community


Discussion on: Using getters/setters as opposed to methods?

khrome83 profile image
Zane Milakovic

I really don’t use them. Mostly because I keep forgetting they exist.

Is there any performance reason to not use them?

nombrekeff profile image
Keff Author • Edited

I also forget about them :P

I don't think there is, although I haven't made much research in that respect.

Correction: It kinda has some side-effects and is prone to errors, for example, if a method or property is mispeled:

person.getFulName(); // Throws error
person.fulname; // Does not throw