Tuesday, July 30, 2013

Java Programmers Best Guidelines

1. Code should be READABLE. If not…please don’t code!
2. If you are using a DESIGN PATTERN, check with your lead, whether it is the right one in the given situation.
3. If you don’t COMMENT your code, you have not documented it.
4. If you did not make NULL CHECKS, your code will fail!.
5. If you use STATIC everywhere, you leave yourself open to memory issues.
6. If you do not handle EXCEPTIONS, you should not code, or review it.
7. If your code is not UNIT TEST able, you have not written it right.
8. Do not add Numbers directly as FLAGs or ENUMS, use readable constants instead.
9. EXTERNALIZE all User Visible Strings.  (Keeping it flexible for Multi-lang apps.)
10. Add Parameters that could change, in CONFIGURATION files.
11. Do not use Popup Message Boxes for Testing, use Console PRINT statements instead. You will forget to remove them!
12. Using LOGS in proper places, can enhance code, and avoid 11. in many cases. This is the only thing that will help you in remote communication from the customer end. Also helps in timing the functions and troubleshooting performance issues
13. Expose commonly used Utility Classes in UTILS package. Keep a note on its size, as not all Classes may need the whole package, it is a good practice.
14. Avoid practice of STAR importing (i.e importing whole Package e.g. java.lang.*)
15. When Synchronization is not needed, avoid using Synchronized Classes (e.g Do not use Vector when ArrayList would do the work).

(Thanks to friends who have contributed)

Living on 30 rupees per day per person

Indian government has declared that anyone who spends more than 30 rupees per day per person on food and living are above poverty line. What about other expenses, like housing, utilities, school, dresses, medical expenses, entertainment etc?


That means, for a family of 4 - husband, wife, 2 kids - 30 x 4 x 30 = 3600 would be cost needed for food alone. Makes sense, considering the cost of grocery, vegetables etc.

However we need to consider these monthly costs too

Gas cost @ Rs 430, Electricity @ Rs 500, Medical @ Rs 1000, School @ Rs 1000, Dresses @ Rs 2000, Entertainment @ Rs 3000 which includes, movies, cable/dish tv, eating out once etc. & Transport @ Rs 2000.

So in all we would need about 13,600 rs a month to survive in a normal town (or a city like Bangalore/Chennai)

Inputs: I spoke to the security of my apartment - who makes about 8k for a straight 12 hours/day, 6 days shift. Even on that holiday, he goes around doing commission selling work, buying and selling old furniture.


I have a feeling more than 80% of Indians are poor. Including me.

What else do we need?

Main thing would be saving for the future, emergencies, kids marriage expenses....

But if you are an IT folk, with some experience like me...

So in India particularly in Bangalore, a minimum survival budget for food, house, transport, school, etc turns out to be more than 50K/month that too for 2 kids, one husband, one wife only. Now imagine adding up movies @ 300/seat, icecream, pizza, burgers, fries etc. Both spouses should work for quality life in Bangalore. Bachelors need 20k a month.