DEV Community

Discussion on: What is Perfect Code in your heart?

Collapse
 
djnitehawk profile image
Dĵ ΝιΓΞΗΛψΚ • Edited

in addition to everything you guys mentioned, I always try to think of it from a performance perspective as well. how well this code will scale, am I doing unnecessary allocations, am I blocking threads, am I doing unnecessary context switching, needless locking, etc. also I try not to hypnotise myself with popular design/code patterns just because they're hip. if I ever pick something up, I always ask myself the question WHY? and if I can't come up with a good answer, straight to the trash bin it goes. the only principle i follow religiously is KISS. if you can understand your own code after 5 years then you've done a good enough job.