61

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

log4j, couchdb4j, neo4j, launch4j, etc..
Ryan Emerle
  • 15,461
  • 8
  • 52
  • 69
Verhogen
  • 27,221
  • 34
  • 90
  • 109
  • 14
    4J means "For Java" – JuanZe Dec 01 '09 at 13:11
  • 2
    You forgot crap4j: http://www.crap4j.org/ – tvanfosson Dec 01 '09 at 13:13
  • 11
    9 upvotes and counting... wow, I think I need to start asking more questions like this one :) – skaffman Dec 01 '09 at 13:27
  • 14
    Unbelievable. And if you ask or answer something really challenging, you usually get 0 points (maybe an accepted, if you're lucky). Stupid game. – Andreas Dolk Dec 01 '09 at 13:56
  • 7
    @Andreas_D judging by the asker name, he's Chinese. Given that, it's really not a strange question to ask... after all the number 4 is seen as very negative in Chinese culture, it's a homonym for "death" or "die". If you didn't come from an English-speaking background, it'd be easy to not realize that 4=for. – TM. Dec 01 '09 at 14:15
  • It may not be a strange question to ask, but it sure ain't a programming question. It should not earn anyone any rep on a **programming** QA site. – Sinan Ünür Dec 01 '09 at 14:20
  • 3
    @SinanUnur it's not like he upvoted himself... obviously (at least) 11 people out there thought it was a good question. Plus a lot more rep has gone out for "what's your favorite programmer tshirt" type questions than for things like this which are at least really a request for knowledge. – TM. Dec 01 '09 at 14:30
  • 1
    +1 from me. This is certainly a valid question on this site. It helps people to understand something about libraries just from their names. I'm a native speaker and I never made this connection before. – Kip Dec 01 '09 at 15:19
  • @Andreas_D I agree with you. I have an accepted answer with a zero hat trick: http://stackoverflow.com/questions/1578434/java-rmi-marshalexception/1578479#1578479 – JuanZe Dec 01 '09 at 15:41
  • 1
    @JuanZe @Andreas_D , I've been frustrated by the same thing... I tend to get the most rep from easy answers. Fact is people tend to upvote answers they "know is right" so the easier the answer, the more upvotes you often get (for a pure coding problem). Same concept tends to apply to questions, people tend to just glaze over stuff that they don't immediately understand. That said, I do not blame or downvote people who are just asking easy questions... it's not their fault that people vote them up. But, *most importantly*: **what's hard for one might be easy for another, and vice versa** – TM. Dec 01 '09 at 16:29

5 Answers5

73

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
  • 15,461
  • 8
  • 52
  • 69
  • 1
    there are several libraries with the 4net suffix for .Net for example log4net, – RA. Dec 01 '09 at 13:15
  • 1
    @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 Dec 01 '09 at 13:16
  • 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 Dec 01 '09 at 15:10
  • 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 Dec 01 '09 at 17:07
  • 22 rep ups :) [* required - at least 15 characters] – Rakesh Juyal Dec 02 '09 at 06:35
  • @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 Dec 03 '09 at 10:16
14

I'd guess it means "for java"

On this page slf4j it even says

The Simple Logging Facade for Java or (SLF4J)

Neil Foley
  • 1,763
  • 1
  • 13
  • 32
3

It is an abbreviation for 'for Java'.

Christoph
  • 50,121
  • 21
  • 99
  • 128
Galwegian
  • 41,475
  • 16
  • 112
  • 158
  • 5
    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áč Dec 01 '09 at 12:59
  • @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 Dec 01 '09 at 13:08
  • 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áč Dec 01 '09 at 13:14
3

For java , as simple as this :D

Rakesh Juyal
  • 35,919
  • 68
  • 173
  • 214
2

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)

Community
  • 1
  • 1
Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268
  • 1
    Why would this be CW? It asks a direct question which has a single, unambiguous answer. – Kip Dec 01 '09 at 15:24
  • 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 Dolk Dec 01 '09 at 15:42