One of the best refactoring tools is naming. Arlo Banshee wrote and interesting article about the subject some time ago (http://arlobelshee.com/good-naming-is-a-process-not-a-single...). This is a really long post, but the overall theme is iterate over code until everything has a name. To apply this to your question, the first thing you would do is take those lines, put it in a function with a bad name like “doesSomething” then keep iterating until someone can actually read the code and it makes sense.
In the beginning of learning to program it’s easy to get stuck on the “clever” side of programming, but a lot of the time it can remove readability. The earlier you learn this, the more your future coworkers will appreciate you.
In the beginning of learning to program it’s easy to get stuck on the “clever” side of programming, but a lot of the time it can remove readability. The earlier you learn this, the more your future coworkers will appreciate you.
Good luck!