|
|
|
|
|
by Wheen
4502 days ago
|
|
As someone who is (Probably a bit more than) a junior dev with no formal education or experience in a team, do you have any suggestions to write better code? I feel like my code would be considered bad, but I have no idea what good or bad code looks like. Does anyone have some examples and comparisons between good and bad code? |
|
You should aim to use whatever features your language provides to attempt to enforce the above, by information hiding, encapsulation, avoiding global mutable state as much as possible, and using design patterns to achieve a good balance.
You could give two similarly experienced programmers a fairly trivial problem and they might come up with wildly different solutions, because the best solution is a myth, but we know the wrong solution if we see it (that comes from the experience of making the same mistakes.)
If you give details on the language(s) you're using I may be able to point you to some literature on good design.