News for hackers. Stuff that matters.
Re:“Coding is basically just ifs and for loops.” by opportune on Saturday December 04, 2021 @03:23PM (#29443975)
I inherited a piece of code that was designed as a state machine and the state machine design basically made the project become pure technical debt as requirements increased over time and engineers had to make it work with the state machine model that had been chosen when the project started.

If the project had instead been designed to have less unnecessary state and “transitions” it would have been a lot easier to make changes.

All those ideas sound good by themselves but they are really bad for “defensive” coding. Good luck selling a project to refactor something when it’s going to take multiple people-years. Once you’ve made the mistake of committing to an inflexible design it’s either that, replace/ignore the thing, or deal with low productivity as long as the thing exists.

Re:“Coding is basically just ifs and for loops.” by astrange on Sunday December 05, 2021 @03:38AM (#29447762)
State machines are refactorable if you use state charts. Using one giant FSM is like committing compiled code.
Re:“Coding is basically just ifs and for loops.” by mro_name on Saturday December 04, 2021 @04:33PM (#29444507)
> state machine model that had been chosen when the project started.

so was the chosen model the issue or choosing a state machine model at all?