EnterpriseQualityCoding / FizzBuzzEnterpriseEdition

FizzBuzz Enterprise Edition is a no-nonsense implementation of FizzBuzz made by serious businessmen for serious business purposes.
21.55k stars 761 forks source link

Everything should be Hash Maps #74

Open reynoldsm88 opened 11 years ago

reynoldsm88 commented 11 years ago

Writing Java code that uses strongly typed objects leads to brittle code that is hard to change. Please change every object to a hash map so that everything can be dynamic and configuration driven PLEASE.

joezeng commented 11 years ago

But hash maps are hard to implement and understand (and are nonstandard). We're aiming for rock-solid, maintainable code, and "dynamic" and "configuration-driven", while good things to have, cannot come at the cost of basic consistency and understandability.

Olathe commented 11 years ago

Hash maps are not what I was taught in college, which means there are probably lots of programmers who haven't used them. In order to ensure that new hires will understand the code, we need to use Hashtables. Also, for that matter, we need to ensure we use Java 1.4 in order to ensure that no one inserts any potentially-confusing generics code.

sbeitzel commented 11 years ago

The synchronization overhead of Hashtable has been shown to be a significant performance hit in enterprise deployments. The ConcurrentHashMap implementation has been part of the language since 1.5 and has demonstrated significant speed benefits for frequent-read, infrequent-write multithreaded applications. While HashMap might be sufficient for a toy/demo single-threaded installation, today's enterprise environment is often not-only multithreaded but multi-core. We should use concurrent classes wherever they're available.