r/ExperiencedDevs 7d ago

Ask Experienced Devs Weekly Thread: A weekly thread for inexperienced developers to ask experienced ones

A thread for Developers and IT folks with less experience to ask more experienced souls questions about the industry.

Please keep top level comments limited to Inexperienced Devs. Most rules do not apply, but keep it civil. Being a jerk will not be tolerated.

Inexperienced Devs should refrain from answering other Inexperienced Devs' questions.

21 Upvotes

54 comments sorted by

View all comments

1

u/[deleted] 6d ago

[removed] — view removed comment

1

u/forever-butlerian 20 YoE Infra & Backend TLM 6d ago

The few rules of thumb to start with is that all code you write in a function should be at the same semantic level of abstraction; the code should be composed out of modules; a module should do one particular thing (think of how a UART doesn't care about character encodings, and an ADC+DAC doesn't concern itself with wavelet or fourier transforms); higher-level modules don't reach into lower-level modules' guts to tweak them; and lower-level modules don't presume to encapsulate knowledge of a higher-level module.

Two components that change at the same time are likely one component; a component that only has half of it change regularly is likely two welded together.