Episode 1: I Was a Junior Developer and I Must Be Stopped
We all start somewhere. Some developers begin their careers writing clean, well-structured code, carefully following best practices, naming variables properly, and writing tests like responsible ad...

Source: DEV Community
We all start somewhere. Some developers begin their careers writing clean, well-structured code, carefully following best practices, naming variables properly, and writing tests like responsible adults. Others start by shipping a few bugs here and there, learning, improving, and slowly developing their own style. And then there's me. Today, we are reviewing a function I wrote years ago that is somehow still running in production, untouched, unbothered, and — against all odds — still working. No one has dared to refactor it. No one has tried to rewrite it. It has achieved something most code never will: It became too scary to change. This function is called multipleUpdate. It lives in a Laravel application. It updates multiple items. I think. Here it is, in all its glory: public function multipleUpdate( Scenario $scenario, Request $request ) { $r_arr = intval($request->right_arr); $id_array = $request->item_number ?? $r_arr; $name_ja_array = $request->name_ja ?? null; $name_en_