Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
well maybe it's just me, but I find it very hard to write decent code without design patterns.
When you write code the way you like it you write code that is easily understood by you. Another dev would break a leg before he figured the way you are thinking. Patterns solve this problem perfectly. -
Design patterns are solutions for problems that other devs faced. If you learn them then you won't waste alot of time in solving any of those problems.
-
design patterns are also kind of a common ground when developing in team, from the high level architecture to the mere optimisation of algorithms. They make other ppl spot the logics in seconds instead of digging for hours deep inside obscure code. time saved that can be spent more productively.
And often they're full of best practices in order to avoid certain typical flaws that may emerge in the future.
They're shared knowledge from a collective experience.
They must be adapted to every specific situation, stack, problem, project and team ofc, what works here may be not the best call there, but to figure this out is our job. -
Guranteed regrets in 2 months when requirements change and you have to rewrite it ;)
-
Design patterns are not much else than well thought-out, clean code. With enough experience you'll automatically use design patterns you didn't even know existed because it's just common sense to implement certain things in certain ways.
So do what you want, but you should know that in the long run it might save you a lot more time and effort to learn design patterns now before you learn them the hard way.
And once you know how to apply design patterns you'll realize they aren't nearly as restrictive as you are describing. They're more restrictive than chaotic spaghetti code, but that's the point. -
@deadlyRants design patterns waste 10 times more of my time as developing something because i have to be careful and think where to put what and how. a feature i can code in an hour without design patterns would take me a whole day. thing is i dont rly have a lot of time, i have to hurry just to build the prototype at least and i can speed up the process if i dont follow design patterns. sure the code is gonna suck in the long run but I'll leave that job to somebody else in case the prototype is successful
-
@SukMikeHok on the other hand, you can use clean, well-structured code on Github when applying for jobs, which won't work with hacky shit. Double so in case you drop college.
-
donuts236726y@SukMikeHok I don't understand how design patterns relate to where you put things. Maybe you are still Junior and haven't seen enough code. But eventually you will see in many programs you are essentially solving the same problem/issue again and again.
I think design patterns are more applicable for large systems with many parts that need to be maintainable and flexible. And help you analyze big problems and break them down in to smaller components and parts. -
donuts236726yOh Android app... Hm... I've never used design patterns for those but I don't build mobile apps. I would consider them small problems/programs. Just follow the recommended place to put classes and stuff, I remember there's a certain folder structure
is it ok if im the only person who codes an android app and i code it by my own free will and skills?
meaning im not following any design pattern while doing so.
i dont like following design pattern because it narrows down my freedom of writing code the way i want to write it.
its like, imagine, you have a strict schedule or a dad who says at:
5:59am: get up
7:15am: study
9:01am: eat breakfast
11:00am: go to college
3:07pm: eat lunch
5:14pm: come home
8:02pm: eat dinner
9:00pm: brush your teeth
10:58pm: go to bed
11:59pm: you must sleep before midnight
IMAGINE THAT. be honest, could you actually follow this schedule in its exact hour and minute as it was written down for the rest of your life every day, no exceptions?
if you're a sane person, you would answer - no, of fcking course not.
life is much more broader and dynamic than following a static pattern every day forever.
so is not following a static design pattern while coding an app.
rant