The Java Community Process - Is Sun Listening?
cgu queries: "For those who are familiar with it, log4j is one of the most
widely used Java libraries today. Sun Microsystems intends to ship an obviously
inferior package with JDK 1.4. Is the Java Community Process just a fig leaf allowing Sun to ignore existing development efforts? What has been the experience of other Java developers with the JCP?" There's a bit of history here, so you'll probably want to check out the log4j pages linked to, above. This is a large concern for any language which has developed a community around it, who hopes to assist in its further development. So is Sun paying attention to the community that has rallied around Java or is the Java Community Process just paying lipservice to the intended ideal?
No, this isn't comparable to that case at all. This concerns the default logging package available to all Java classes. With a standard implementation (which log4j quite arguably has been in the Java community, for several years) every code package can be written to use the same logging interface, knowing that it's up to the application to actually decide where and how and at what level the logging should be presented.
By providing a different, incompatible log interface in JDK 1.4, Sun provides strong incentive to developers to stop using log4j and instead switch to the "new standard". The result is that an existing "community standard" gets shoved out of the way by Sun's strongarm. The result is confusion, as developers waste time deciding which log package to use instead of just writing code. This is especially bizarre when log4j is an Jakarta project at apache.org; Jakarta is heavily supported by Sun, and there's no way Sun hadn't heard of log4j, given its widespread use. One must assume, then, that weird politics were involved...
The submitter of the question, it should be noted, is the author of log4j, but that doesn't invalidate his very good question, or his excellent and widely used work. Me, I'm just a happy user of log4j; if you write Java, you should be too.
Now, just replace fool with please and your done.
This is comparable to choosing to implement something other than Electric Fence in C; the impact on the entire community is negligable. If I choose to use a different logger it will not seriously impact anyone outside of the development group. It may mean the default is less than optimal, and people will use it without knowing there is an alternative which is better, but these are the same people who wouldn't know such a library existed now anyway.
No, this is not the ideal. You are oversimplifying the truth. In large projects, it is desirable to keep logging abstracted from the problem at hand, allow output to varying targets (not just ever-growing logfiles), allow multiple log levels (DEBUG, INFO, WARNING, etc.), make output format easily configurable, AND it should be fast.
Log4J has all of these attributes and more. As for complexity, you have a single configuration file where you specify your log targets and invocation requires only n+1 statements. That last point means that you get a reference to your log output handler (the "+1") and put in your logging statements (the "n"). Have you even tried using it or are you just talking out of your ass?
With regards to speed,
With regards to size, the core library is 78K. The complete library (core + utility classes that you can mix and match to your needs) is 159K. Not all that much to add to a general library distribution. Is this going to make or break your hard drive capacity or is this simply an aesthetic gripe?
So are you complaining that people want to reuse code or that they don't want to waste time reinventing the wheel (two sides of the same coin)?
And finally, your C++ anecdote is somewhat misleading. I think you're taking for granted that the standard C and C++ libraries are installed by default on many systems. If the JRE were installed by default and you were not including its size, your Java programs would be the smaller download/install. Is the Java standard library large? Yep. Does it do more than the C and C++ standard libraries? Yep. Should the C and C++ standard libraries do more? Yep.
Socket communication, GUI, distributed computing, threads, file I/O, component technology, database access, and on and on. Yes, it's a long list. The list is also there for C and C++, but on a far larger scale. Not only do your customers have to install the C/C++/Pascal/Fortran/Ada libraries for your particular task (CORBA implementations anyone?), but they must also install all of the library competitors that the other packages chose to use (database API implementations anyone?).
When I'm writing a program that is handling hundreds or thousands monetary transactions, I do not want to write my own database abstraction layer. It is not my core business. I do not want to write my own ORB. It is not my core business. I do not want to write my own logging infrastructure. It is not my core business. Other people have written these things and written them well. Unless there is a particular case where I think I can do it much better and actually find the time to do so (I haven't yet found a case like this in the Java standard library), there is absolutely NO reason for me to write it myself except maybe for educational purposes.
If you don't like Java, then don't use it. If you want to take advantage of what Java provides, don't be so quick to look a gift horse in the mouth. You begin to sound like Microsoft when they say that Open Source is bad, but turn around and use some BSD code. Java is not perfect but neither is your chosen saviour, C++. Use the right tool for the job instead of trying to band a square peg into a round hole.
- I don't need to go outside, my CRT tan'll do me just fine.
I've been doing Java development for quite a while. I recently switched a small project over to JDK1.4 (bugs and all) to get a feel for it. One of my major motivations was to use many of the new APIs and reduce external library dependencies. Switching from log4j (which I used quite extensively) to the new logging API was truly trivial... just a quick script doing some text replacement. Yes, there are some issues with the logging API, but it's architecture is similar enough to log4j that, for the end users, there really are no significant problems. Indeed, my only real complaint is that I do feel that the logging API distinction of FINEST/FINER/FINE priorities is gratuitous, and annoying. Still, easy resolution: Pick one (I'm just using FINE) and stick with it as the exact equivalent of log4j's DEBUG.
In other words, I think people are making a mountain out of a molehill. The logging API is not perfect; neither are any of Sun's APIs, for a revision or two. While I won't go so far as to say that Sun has a reason for not using log4j, I don't think it affects the average developer in the least.
I've had this sig for three days.
Although I have not followed the process carefully, I have looked into both log4j and the JSR specification, and find both to be, well, less than ideal.
First, I am going to assume that the author(s) of log4j made representations on the relevent JSR, and didn't just keep quiet until it closed. The points they have brought up (in this article and in the log4j docs) are very true, and the JSR is certainly an inferior API.
However, Java is becoming increasingly bulked up with useless functionality. While debugging/logging is far from useless, the API presented by log4j is (in binary size) heavy, and IMNSHO a nightmare to use.
The idea of creating types to represent categories, used in both APIs, is a classic example of object overkill. Instead of simplifying code to make it easier to maintain, both these systems add an unnecessary amount of compilation to keep track of the category (amongst other things).
The ideal debug/log system should take a single line to invoke, and not have additional overheads.
Instead of striving for ultimate functionality in a less-than-perfect world, Java should be aiming for a small but effecient and highly usable core set of classes, and leave the bloatware to third-party libraries.
We still have and need a market for third-party software, and it is only through the innovation of extending a simple core that we can grow good software.
The JRE has bloated now from 5.5Mb to 8.8Mb. I've already had to develop two projects in C++ because I can make the distribution less than 650kb and not have to hastle (remote) customers to download and install the JRE ... this is worsening the problem.
Sun is on a mission to create the Ultimate Set of APIs, and call it Java. The "community" is on a mission to get everything they don't want to do themselves shoved into an Ultimate Library. Somewhere we need experienced, knowledgable experts who work in industry with languages, people, design and requirements, to moderate the whole process.
Twylite
i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net