Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is main focus for a developer when coding? [closed]

I read a lot of books about how to code right and usually they are talking about all these techniques from a point of view I can't understand.

E.g. lets consider the singleton pattern:

I'm restricting so the class can only be instantiated once, but since it's only me creating the application, if I know that the class only should be instantiated once, then why would I create it a second time?

It sounds like I'm securing against myself.

I feel like missing the big picture.

What is my main goal when coding an application?

How should I think?

Thanks.

like image 391
never_had_a_name Avatar asked Dec 12 '22 22:12

never_had_a_name


1 Answers

Make it work, make it work right, make it work fast.

Most patterns introduce complexity as one price to using them. Do not add patterns if you do not need them.

In the case of singleton - if you don't have to restrict the class to one instance (and when do you really need to), don't turn it into a singleton. It only makes your code more complex and difficult to understand.

like image 188
Oded Avatar answered Jan 27 '23 23:01

Oded