java.math.BigInteger 라이브러리를 쓴다고 가정하자.
분배법칙 Test한다 치면
Kotlin이나 Scala에서
val a = BigInteger("1894172491274189274912471247")
val b = BigInteger("48293812938172379")
val c = BigInteger("2839127412847192471248")
if (a*(b + c) == a*b + a*c && (a+b)*c == a*c + b*c) {
....
}
이게 Java에서
BigInteger a = BigInteger("1894172491274189274912471247")
BigInteger b = BigInteger("48293812938172379")
BigInteger c = BigInteger("2839127412847192471248")
if (a.multiply(b.add(c)).equals(a.multiply(b).add(a.multiply(c))) && a.add(b).multiply(c).equals(a.multiply(c).add(b.multiply(c)))) {
....
}
이렇게 됨
행렬이나 복소수 쓰면 맨날 이따구로 써야 됨
자바가 저렇게 연산자 오버로딩 막은 이유 보면 더 좆같음
Because James Gosling (자바 창시자) said so:
I left out operator overloading as a fairly personal choice because I had seen too many people abuse it in C++.
James Gosling. Source: http://www.gotw.ca/publications/c_family_interview.htm
Please compare Gosling's text above with Stroustrup(C++ 창시자)'s below:
Many C++ design decisions have their roots in my dislike for forcing people to do things in some particular way [...] Often, I was tempted to outlaw a feature I personally disliked, I refrained from doing so because I did not think I had the right to force my views on others.
Bjarne Stroustrup. Source: The Desing and Evolution of C++ (1.3 General Background)
니좆 애미
진싸 생나쁜놈이네 그럴거면 C 매크로 처럼 매크로라도 넣든가
ㅋㅋㅋ
ㅇㄱㄹㅇ
http://amelentev.github.io/java-oo/
플러그인 써도 자바가 좆같은 언어라는 사실은 안 변함
근데 두 사상 모두 다른 방식으로 색다른 좆같음을 선사함
결론: 세상에는 단 두 가지 언어가 존재한다 - 욕처먹는 언어와 안 쓰이는 언어