4 ms·
Yes, they're definitely from Texas: not the usual "cowboy coders" == "coders whom take too much initiative / don't follow a plan / directions." J2EE usually me
by anon49124 8y ago
Yes, they're definitely from Texas: not the usual "cowboy coders" == "coders whom take too much initiative / don't follow a plan / directions."
J2EE usually means GC pauses (hell), XML (hell again) and dependency injection (hell also). Thankfully, hells tend to pay well if someone is willing to schlep the muck around quickly and reliably.
JVM (IBM's, Oracle's) and CLR runtimes are battle-tested and much more widely deployed to run civilization than most non-enterprise developers realize.
Also, I should probably look that guy up as I'm in North Texas at the moment.
- vbsteven 8y agoCan you explain why you describe dependency injection as "hell"? I prefer working with DI/IoC rather than without it.
- thisone 8y agoHeh, not the op but I'll bite. I just had to go through an open source project that uses guice, in order to try to trace a particular code path, since the user group was less than helpful. Trying to figure what was running was an absolute nightmare of nested magic spread out through a score of files. Meaning as soon as I had a clue, I'd lose it as I had to retrace back through all those files. I'm sure it's clear as crystal to the people who wrote it, but DI can be obtuse as hell if you have to figure what's actually running on your own.
- spatulon 8y agoI understand dependency injection to mean 'pass dependencies as arguments', which seems pretty simple and reasonable. e.g. instead of void foo() { SingletonLogger::logError("no cheese"); } you'd write void foo(ILogger logger) { logger.logError("no cheese"); } Now it's much easier to unit test `foo` with a mock logger object. Is there more to it than that? Why are there big, complicated frameworks for it?
- thisone 8y agoDI/IoC gets complicated, fast. hand rolling DI, yep brilliant, generally quite easy to work your way through because it's easy to see where classes are being used. Hand rolling can get complicated when your applications get BIG and you want to do fancy things like having modular code (whether you ever use the module somewhere else or not) or lazy loading or multiple scopes. Then you use a framework and you find your dependencies take dependencies, your wireup code is auto-magical, you inject dependencies into private properties, you want multiple implementations of particular interfaces but want to ensure only the right one gets used in each circumstance. Then multiple people start getting their fingers into the pie and the DI/IoC explodes into config files throughout the application, and the only way to understand what's being wired up without a map, is to "find usages", pin files, and cry (I'm not bitter or anything ;) DI/IoC can work wonders for handling complexity, it can also increase your complexity if you aren't very careful)
- vbsteven 8y agoThat last sentence is the important part: "if you aren't very careful". I work in multiple large java/spring codebases and the rule we use is "Keep all configuration related to the same base type/interface in the same file". That way if you want to find out which logger is injected you only have to check 1 file. Another easy way to find out what is injected at runtime is to attach a debugger and set a breakpoint.
- thisone 8y ago:( with the particular project I've been looking through, trying to debug via running the entry point was a non-starter. The part of the system I needed to trace would only be able to run if I had 4 other services running (all started seperately from the same main file) and a full dataset loaded. Once I finally discovered a hint about which files governed the behaviour I was investigating I was finally able to isolate the tests to begin the debug cycle. Sometimes it's just complicated.
- logicchains 8y agoImagine you want to simplify the code, and you hate passing values around, so you write a framework that allows you to write something like: @GetMeALogger(andCallIt=loggy) void foo() { loggy.logError("no cheese"); } Where @GetMeALogger does some magic at compile time to pipe in some kind of logger class based on various config options. Then to unit test it, you use different config than production.
- EADGBE 8y ago> I'm sure it's clear as crystal to the people who wrote it This - in general - is the problem with programming.