13

When reading through someone else's code, what about it made you think "Damn this is well written" or similar?

Any language - I have a bias towards PHP, C++ and C though.

Comments
  • 10
  • 3
  • 1
    @electrineer lol, the comments on that page.
  • 1
    @electrineer yeah, I spent a bit of time trying to find the original, got bored gave up.
  • 3
    In C# or anything object oriented it's usually when you see classes with intuitive names, the perfect amount of responsibility and they are used in many places in the codebase - not just once or twice.

    Usually the most impressive is when you see one codebase that's been rewritten from something that was "meh" into a completely intuitive structure.

    ----
    To contrast this: Unimpresive code to me is when someone adds layers of abstractions and unencessarty files just to "make it OOP" when it doesn't benefit from it.

    I once saw someone rewrite a dynamic json object used in 1 place in the codebase like { name: "joe", age:20 } into multiple files and an unintuitive classname like PartialPersonManagerObject.
  • 1
    I rarely ever read own code where i think that - and like most devs i am extremely biased towards my own code just because it fits my way of thinking more.

    But code of others - i don't think, that actually happened. The natural limit seems to be "okay, technically that way of doing it is fine too..."

    That said, i am pretty sure, that i saw really good code of others - i just did not realize it.
  • 1
    @Oktokolo You "notice" bad code.
  • 1
    @Demolishun
    Yes, but "not bad" most often doesn't equal "Damn this is well written".

    And i wrote bad code myself - and didn't notice that at the time of writing...
  • 0
    When I read some that has an actual domain model with logic in it instead of someone thinking they’re OO by having some empty entity classes and then shoving all the real code into a “business” layer.

    It’s been a while since I saw some good code to be honest
Add Comment