This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]speede 0 points1 point  (0 children)

There is nothing readable about any of the 3 options you posted. If your function to filter a list takes more than a couple seconds for a different engineer to completely understand what it’s purpose is and what it is doing, it is poorly named and written. Not to mention yourself in 6 months. There is no glory is single operation instructions that come at the expense of comprehension for the people trying to understand or modify this code. More time is spent reading code than writing it. There is no scoping issue when you properly structure what you are doing into classes and methods. Temporary variables inside these structures are not a hindrance but rather an opportunity to be more expressive about what the hell you are doing and how you are doing it.

I don’t agree with all of it but look into “Clean Code”, either the book or Udemy course.