-1

I use apache commons lang lib as my favorite 3rd party lib for many years, but I don't really understand what's the meaning of "lang" in its name. Yesterday I thought I need another try. I tried googling for some time and read through all its official website , got still no luck. Does anyone knows the answer to my question here?

Mehdi Charife
  • 722
  • 1
  • 7
  • 22

3 Answers3

2

The content of official webiste you've enclosed says that, this library provides a host of helper utilities for the java.lang API.

The java.langpackage contains of fundamental classes of Java and its design and since the commons-lang is mainly designed to add additional utility and helper classes for the classes in java.lang package, the -lang postfix of this Apache library seems to be self descriptive.

In addition, the lang is mostly the shorthand for language word.

Edit:
I understand a little the origin of your question, but I think, having such dilemmas is unnecessary. Having such objections could lead to "why Java is named Java" (no mention of cross-platform, OOP and others in the name), "why Lombok...", "why Gradle...", Hibernate, Spring, H2, Redis... (you should get the point).

The 3rd party library can be named in any way as its developers wishes, the lib name is used mostly just as dependency and the more important thing is that the library should have a kind of self descriptive class names (like NumberUtils or StringUtils).

itwasntme
  • 1,442
  • 4
  • 21
  • 28
  • I guess its meaning should be language. But it does not make sense to me. Java is kind of coffee, meaning that programming Java is comfortable. java.lang means a package of java programming language. but apache is not a programming language. – Chuan Liang Jan 03 '20 at 09:13
  • @ChuanLiang No, it's meaning is exactly what it says in the bolded text of this answer, it's a library of helper utilities for the classes in the `java.lang` package of the Java API. – Andreas Jan 03 '20 at 09:24
2

The main Apache Commons page says:

Lang: Provides extra functionality for classes in java.lang.

The link you provided to the Apache Commons Lang page says:

Lang provides a host of helper utilities for the java.lang API, notably String manipulation methods, basic numerical methods, object reflection, concurrency, creation and serialization and System properties. Additionally it contains basic enhancements to java.util.Date and a series of utilities dedicated to help with building methods, such as hashCode, toString and equals.

So, to answer your question "what's the meaning of "lang" in its name?", the answer is:
"Lang" refers to the core java package java.lang.


For reference, the javadoc of package java.lang says:

Provides classes that are fundamental to the design of the Java programming language.

Andreas
  • 154,647
  • 11
  • 152
  • 247
  • yes, I know java.lang stands for java language. It does make sense there. But apache language does not make much sense to me here. – Chuan Liang Jan 03 '20 at 09:12
  • @ChuanLiang Why not? As I already said, the "Lang" in Apache Commons Lang is a reference to the `java.lang` package, *not* a reference to the word "language". --- The library contains classes such as `BooleanUtils` to provide extra helper methods for working with `Boolean` values. If e.g. the Java API has put the `Boolean` class in a package named `java.types`, then the library would likely have been named Apache Common Types. The library name is **inherited** from the Java API *package name*, just like the library documentation says. – Andreas Jan 03 '20 at 09:21
0
  1. Apache Commons Lang is a set of utility functions and reusable components that should be of use in any Java environment. This library provides helper functions for java.lang.

  2. Package java.lang Provides classes that are fundamental to the design of the Java programming language.

Thus, referred to as Apache Common Lang.

Dmitriy Popov
  • 2,150
  • 3
  • 25
  • 34
Ramya
  • 31
  • 3