Use long variable names

My trading bot ran into a ‘undefined variable sell_strategy’ error because I removed the variable ‘sell_strategy’ as part of effort to cleaning up code. I need to find the references to the variable and remove the references.

‘sell_strategy’ is used in Single Bottom and Double Bottom. Since sell strategy is very common in trading, when I searched the variable ‘sell_strategy’ to find the references, there were quite a few found. I had to read the context to decide which referencing code to remove. I wished I had used more descriptive variable name like double_bottom_sell_strategy or single_bottom_sell_strategy.

[I know, I know. Strongly typed language like Java will give you compilation errors. This is Python]

Notes: Always use loooooong variable name so that when you search for it, you get highly relevant hits.

 272 total views,  1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *