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
-
Just don't write code at all, keeps it clean :)
I try to follow SOLID principles -
@hamolicious Single responsibility, Open-closed principle, Liskov substitution principle, Interface segragation and Dependency inversion
-
@hamolicious https://www.wikiwand.com/en/SOLID
Ooohhh boy, there's soo much you should know about clean code.
Here's a very brief summary:
https://medium.com/mindorks/...
But you should really have look at https://amazon.com/Clean-Code-Handb... -
C0D4669025y@351483773 not really java specific, plus a pattern approach makes it easier for a large team to maintain things as everyone has the same ideology for creating maintainable code.
This might be of use to you @hamolicious
https://williamdurand.fr/2013/07/... -
@351483773 I suggest to first get familiar with clean code paradigms before making statements like that.
The "breaking down into small functions" is talked about in [if my memory serves] the 4th chapter of R.C.Martin's "clean code". It's classified as the very fundamentals :)
and no, it is not only applied to java. It should be applied to all the languages, to some extent incl. asm.
P.S. @desirous is talking about S in Solid. -
I find many problems because of bad file organization. Wether you code in java with packages or just plain files in e.g. pyhthon.
If your files aren't organized well you will eventually put code into the wrong classes/files because "there is no good place"
Best way I found is organizing your files/packages whatever by the features and inside those by layers like controllers, ui, ...
This helps extremely to identify where to put a new class or if a method used by more than one object should be put in a package/folder above both.
What would be the best tips for keeping code clean?
I recently noticed how "unclean" my code is, I try to organize it as much as possible but through that I manage to make the code very messy :/
What are your best tips, advise, tricks... lalala?
Note:
This problem mainly applies to long projects and games :P
question