Despite what you often hear, one can produce very readable perl code.
It is just not enforced.
I feel that readabilty of my code has improved since I've started my IT bachelor studies. I'm wondering if it is because
- we are forced to learn java which enforces a lot of things
- I am much worse at java than at I am at perl which forces me to write really simple code
- I code more and am humiliated more often when trying to read my own code
- I have more confidence in my solutions and think longer before hacking.
I'm not very afraid of baby perl. I want to code efficiently and want to understand my code in a year or two.
As an example, last evening I sat one hour or so over a calculation I could not solve. I was tired, did it in excel and then tried to implement it in my listing. The line became longer and longer, the veriables more and more nested. A true monster! And - of course - it did not work.
This morning I looked at it afresh, removed the monster, replaced some sub-calculations with variables and now it works.
It is not efficient code, nor is it as short as it could be. It is even a little stupid.
But hey, I understand it without thinking a lot.
So, do you optimize your code for readability?
(Not only when you have to?) ;-)