tags:

views:

552

answers:

5
+13  Q: 

What does 4j mean?

I notice a number of java libraries use this as a suffix:

log4j, couchdb4j, neo4j, launch4j, etc..
+1  A: 

Is it short for 'for Java'?

Galwegian
do answers end with a question mark? I think it's just being rude to answer in such a way that makes the person asking feel inferior or stupid.
Peter Perháč
@MasterPeter - no need to take offense - I'd never given it much thought, so I was offering a suggestion (or educated guess) as to what it may stand for. The OP got his answer, so it's all good.
Galwegian
None taken. It just struck me to notice that there are three answers to a simple question, two of which end with a question mark.
Peter Perháč
+7  A: 

I'd guess it means "for java"

On this page slf4j it even says

The Simple Logging Facade for Java or (SLF4J)

Neil Foley
The only person who actually answers the question without being unnecessarily smug.
Peter Perháč
+26  A: 

Since the number 4 (four in English) is a homonym for the preposition for, it's being used to indicate that the library is for Java.

In .NET, libraries are sometimes prefixed with n to indicate that they are the .NET variant. For instance, Java has Hibernate and .NET has nHibernate. You also have cases where Java follows this "convention" such as jUnit (where .NET has nUnit).

As a beginning developer I, too, was confused by the 4j naming convention. I thought it was some kind of version indicator until I noticed several libraries carrying the suffix.

Maybe now a Google search will turn up a meaningful result for "4j" :)

EDIT:

I've been unable to find the origin of the 4j suffix, but my best guess would be that it started with log4j which now has variants such as log4net, log4php, log4cxx.

Ryan Emerle
there are several libraries with the 4net suffix for .Net for example log4net,
RA
@Alexey: as far as I see (and that's not very far in the .NET world) most of those are ports/rewrites of existing "*4j" libraries.
Joachim Sauer
Excellent response. I'd like to note that the "4j" suffix and the "j" prefix almost always denote a library or framework that has been ported to Java from another language; similarly, the "n" prefix denotes a library or framework that has been ported to .NET (usually C#) from another language.
Randolpho
I think your guess about log4j being the start is accurate. At least it was the first widely used library that I know of with such a name.
laz
22 rep ups :) [* required - at least 15 characters]
Rakesh Juyal
@Randolpho: can you give examples? The two that come to my mind, log4j and slf4j, aren't ported from anywhere as far as I know.
Joachim Sauer
+2  A: 

For java , as simple as this :D

Rakesh Juyal
A: 

4j ~ for Java. And I'm only writing more text because SO answers require a minimum of 15 characters, which is hardly to reach with an answer for this question - which should be community wiki anyway, to my opinion, even though it's legal and I guess, a lot more people just read this acronym without thinking about what it might stand for. ;)

But at least it's an opportunity to remind the community of a famous answer, given by ammoQ, on MasterPeter's now closed and deleted subjective question "Did Java steal away the fun from programming?":

Don't put the blame on Java; it's the abundance of frameworks that make a java developer cry. You can't even poop without using the Poop4J framework.

(Question can still be found in google's cache)

Andreas_D
Why would this be CW? It asks a direct question which has a single, unambiguous answer.
Kip
It's just my opinion (and inline with my initial comment to your question). Doesn't mean, I didn't like it :) - but it's a general problem with the SO rep system: the easiest way to build up rep is to ask an easy, maybe funny question and hope that people upvote before it's closed and deleted. To build up rep: never ask tricky stuff or answer on complicated problems.
Andreas_D