Readable code
When you write code, it needs to be as close to natural language as possible.
You can do complex staff, but if it isn't readable put it in a function with a name that explains what it does.
For example let's look on the following code:
Will it work? sure, but when someone tries to read it, it is really hard to understand what we are trying to do.
What is is this replace? why is it there? why is the full_name isn't enough?
Now let's look on the following code:
Now we got clear intention, the hostname of the device is the fullname without the suffix, one line function made our code more readable, although the function is one line, when someone read out build_devices function he can understand, and if he wants to understand how we remove suffix, he can read our remove_suffix_from_device_name
Write the code you want to read, not the code you want to write.
I like the “Write the code you want to read, not the code you want to write” :)