20

Let's stop putting business logic in Constructors...

Comments
  • 2
    Hell yeah!
  • 2
    I have worked in a place that sneaks logic in all kinds of places like a constructor. I also don't like all kinds of properties initialized that can wait for user or system input. I am also a stickler about business logic being in a class and method where it makes sense. There are some other things I hate but everyone else loves to pieces.
  • 2
    Yes, and not in properties either.
  • 0
    @viking8 yeah that too...
  • 1
    @OOPMichael worst I've seen in property setters are function calls before the value is assigned..

    Properties are bad. It's a shame how much action is placed in a setter or getter and they wonder why the application is so slow..

    DB call in getter.. fml
  • 0
    @viking8 ouch db call in a getter.
  • 0
    Another one I hate is looping through data looking for a certain condition to avoid link.
  • 0
    I don't like when exceptions are part of the flow of control. I like to do my best to avoid them in the first place but handle them when they occur .
Add Comment