Software Engineering is plagued by unanswered questions. Others have proffered solutions, but their answers are always incomplete. Over the years I've reached these hard-earned conclusions on our field's most dogged issues. You're welcome. Let's begin.
Should I use a dynamically or statically typed language?
It depends.
Should I use a Monolith or Microservice architecture?
It depends.
Should I organize my code in a Monorepo or in multiple repos?
It depends.
Should I use a new language for this project?
It depends.
But what about Rust?
It depends.
How long should my functions be? Mine is greater than 4 lines. Is that OK?
It depends.
Is it OK to nest code deeply?
It depends.
Should I use a code formatter?
It depends.
Is it more readable to return early in an if
?
It depends.
Should I use an immutable data structure?
It depends.
Is map
more readable than a for-loop?
It depends.
Should I use recursion for this problem?
It depends.
Should I make a method public in order to test it?
It depends.
Should my new function argument have a default value?
It depends.
Should I use a Generic type for this class/function?
It depends.
Is the JavaClassNameBuilderFactoryPattern bad?
It depends.
Should I require types on top-level functions?
It depends.
Should I order imports?
It depends.
Should I order enums alphabetically?
It depends.
Should I make illegal states unrepresentable?
It depends.
Should I extend my code with a subclass or with an interface?
It depends.
Should I use a comprehensive switch statement or should I add an else case?
It depends.
Should I consolidate duplicate code into a shared function?
It depends.
Should I speed up my code with multithreading?
It depends.
Should I use dependency injection?
It depends.
Should I organize code into feature folders or into 'layer' folders?
It depends.
Should I hash data to determine equality or check by ID?
It depends.
Should I fail fast and loud?
It depends.
Should I throw an exception or return an error value?
It depends.
Should I rewrite my legacy system?
It depends.
Should I migrate the database to a new schema?
It depends.
Should I make refactors incrementally or all at once?
It depends.
Should I use React.js?
It depends.
What about Spring?
It depends.
Should I build a DSL?
It depends.
Should I create a formal model of my solution?
It depends.
Should I write tests before I write code?
It depends.
Should I use mocks, fakes, or stubbs?
It depends.
Are unit tests or integration tests more important?
It depends.
How fast should tests run?
It depends.
Should I add documentation comments?
It depends.
Should I write project level documentation?
It depends.
Should I write that documentation in Markdown or in Google Docs?
It depends.
Should I use GraphQL?
It depends.
Should I add a batch API?
It depends.
Is it OK to return redundant data in my API?
It depends.
Should I deprecate old clients?
It depends.
Should I make a breaking change?
It depends.
Should I gracefully support offline clients?
It depends.
Should I use semantic versioning?
It depends.
Should I use AI to write my next feature?
It depends.
Should I replace human code review with AI?
It depends.
Should I optimize my system or should I buy a bigger machine?
It depends.
Are complexity metrics useful?
It depends.
Are test coverage metrics useful?
It depends.
Should I use Protobuf in my API?
It depends.
Should I make use of HTTP status codes?
It depends.
Should I use Kubernetes?
It depends.
Should I use a SQL or No-SQL database?
It depends.
Can I put a network cache in front of my database?
It depends.
Should I add a queue to my service?
It depends.
Should I migrate to an event-driven architecture?
It depends.
What's the best way to share code between iOS and Android?
It depends.
Should I use structured logs or free-form text?
It depends.
How long should I store these expensive logs?
It depends.
How much code review should my team do?
It depends.
Should my team adopt a standard editor/tool chain?
It depends.
Should my team use whiteboard problems to vet job candidates?
It depends.
Should my team pair program?
It depends.
Should my team adopt Agile?
It depends.
Should I learn Clojure?
Yes.