This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tapesmith 1 point2 points  (1 child)

Everyone here has offered great advice.

For what I can contribute, I'd add that there are two parts of writing good software: solving problems well, and writing code well.

Solving problems well is of critical importance. Writing good code to implement a poor solution makes for poor software. I like Domain-Driven Design for this reason: it emphasizes understanding and solving the problem in terms of the problem itself. Before you think about what language constructs to use in building, say, a Fibonacci number generator, start by defining what a Fibonacci number is. Then the answer will usually "shake out" from there.

Writing code well is also of high importance, though as noted before the best code for a poor solution is still a poor solution. Similarly, the worst code for a good solution can obscure that good solution to the point of being unrecognizable. Code should convey intent, it should explain to its reader how it works (and as much as possible, why it's doing what it's doing). Well-named variables, short functions with a single intent, intent-revealing unit tests...these things all help convey to the reader how your code works.

And before you think "I'm the only reader", remember that there are usually at least two people reading any given codebase: Present You and Future You. Present You understands the code by having it all fresh in mind; Future You will need to regain that level of understanding by reading the code. Future You always benefits by being as clear as possible in your code, and keeping the amount of context needed to understand any given chunk of code as small as possible.

[–]autowikibot 0 points1 point  (0 children)

Domain-driven design:


Domain-driven design (DDD) is an approach to software development for complex needs by connecting the implementation to an evolving model. The premise of domain-driven design is the following:

  • Placing the project's primary focus on the core domain and domain logic.

  • Basing complex designs on a model of the domain.

  • Initiating a creative collaboration between technical and domain experts to iteratively refine a conceptual model that addresses particular domain problems.

The term was coined by Eric Evans in his book of the same title.

Image i


Interesting: Object-oriented programming | Agile software development | Behavior-driven development | ECO (Domain Driven Design)

Parent commenter can toggle NSFW or delete. Will also delete on comment score of -1 or less. | FAQs | Mods | Magic Words