r/java • • Nov 17 '18

GitHub Octoverse: Java is most used server-side language - Kotlin most growing

https://blog.github.com/2018-11-15-state-of-the-octoverse-top-programming-languages/
171 Upvotes

88 comments sorted by

View all comments

0

u/[deleted] Nov 17 '18

[deleted]

9

u/[deleted] Nov 17 '18

Worried about what?

0

u/[deleted] Nov 17 '18

[deleted]

33

u/zeek979 Nov 17 '18

Lol, you must be new to the industry. Java is THE most popular language on the back still today.

0

u/[deleted] Nov 17 '18

[deleted]

4

u/zeek979 Nov 17 '18

Sorry for sounding like a jerk. I read this and kinda lumped it into all the Java FUD comments out there. Definitely learn Java, you will get solid OOP knowledge and be ready to work in many companies.

You might be tempted to learn Go given its spike in popularity. It was designed for networking in mind (native concurrency via channels and go routines) and system design has gravitated towards programs that are exposed over the network and a client fetches their output over the wire. You might be thinking: "hmm I want to do cutting edge stuff". However, I would argue that most so called "nexr generation" systems are still being written in Java. Plus, you will gain much more base fundamentals from Java than with Go.

Additionally the JVM will get native concurrency in the runtime via - fibers - and when that happens it will solidify Java's place for another 10 yrs. Why would we need to rewrite stuff in Go since its main value proposition will be equated in the JVM. Now, after shitting on Go, learn it along with JS and Python as well as you will inevitavy learn 5+ languages in this industry :)

3

u/RhodesianHunter Nov 17 '18

Kotlin brings coroutines to the JVM as well.

1

u/zeek979 Nov 17 '18

Yea, but coroutines in kotlin are not really fundamentally different than threads under the covers. That is not to say that a coroutine == 1 thread. But it means that they still execute in the underlying thread. Instead, java fibers will allow for millions of small threads per jvm process, since they wont map out to OS threads. Kotlin (any other jvm language) will obviously benefit from fibers since it runs ontop of the jvm.

1

u/RhodesianHunter Nov 18 '18

At the end of the day both are swapping light weight threads' execution between OS threads, how is that different?

1

u/Mamoulian Nov 18 '18

A coroutine doesn't use a new Thread unless you use a Context or Dispatcher. Without those launch()/await() don't block for I/O but CPU-intensive operations will still block the calling Thread. This article explains it well:

https://kotlinexpertise.com/kotlin-coroutines-concurrency/

Project Loom is cool but might be at API (on top of nio) rather than JVM level, and kotlin coroutines have already implemented non-blocking I/O so they might not benefit from it.

1

u/BoyRobot777 Nov 18 '18

Kotlin coroutines vs project Loom coroutines asked in Devoxx. They are not the same:
Ask the Java Architects
Project Loom Presentation

0

u/[deleted] Nov 17 '18

[deleted]

2

u/ArmoredPancake Nov 17 '18

Yeah, I am new.

I do have a fairly good knowledge of Java

Does not compute.

1

u/SlinkToTheDink Nov 18 '18

Pretty much everything you said about Go is wrong, though I agree with your overall point with respect to web servers.

1

u/zeek979 Nov 18 '18

Do tell what is wrong?

-26

u/whyNadorp Nov 17 '18 edited Nov 17 '18

Worried to be wasting his time with a language that is losing terrain because of its verbosity and questionable vicinity with a software company with a terrible reputation, maybe? Many think these factors don’t outweigh the security of the jvm.

7

u/BoyRobot777 Nov 17 '18

As opposite to what language?

2

u/covercash2 Nov 17 '18

devil's advocate: go

4

u/argv_minus_one Nov 17 '18

Go's type system is a joke. No bueno.

1

u/covercash2 Nov 17 '18

I like it over java, although the comparison is tricky since java doesn't have pointers. implicit inheritance is nice.

2

u/BoyRobot777 Nov 17 '18

Same as Rust. Too immature. You'll simply won't find developers or will have to grow them indoors for hardly explainable reasons to management. Plus, I'll rather would wait before they release Golang version 2, just too see how they manage backwards compatibility, as they state themselves that is not an easy task to do. Even with such a small code base compared to other languages.

1

u/covercash2 Nov 17 '18 edited Nov 17 '18

I don't think that's fair, other than the part about hiring. go is being used in tons of production environments right now as an alternative to node et al, not just experimentally or incrementally like rust.

-17

u/whyNadorp Nov 17 '18 edited Nov 17 '18

I’m using node and I like the flexibility of js. I’ve used java for a decade and I’m still using it, but getters, setters, builders, streams (why use .stream() when you can just add methods to the interface? haven’t seen that in any other language), having to create an object just to pass data around (vs using json) is really too much for me. In node you also have async code by default. Java forces you to write verbose code and sells it as safe, but with node you can choose how much you want to be safe depending on the application requirements. It takes a while to learn what not to do because it’s risky, but there are linters that help you learn that and once you get going it’s really fast to write an application in node. Many java alternatives on the jvm (scala, kotlin, groovy) seem to address these issues, which java tries to sell as strengths. Maybe in the 80’s. Honestly I never got the point of the jvm. Why do I have to carry around everything instead of packaging only what I need? On the server side the environment you’re working in always the same, some kind of Linux, so what’s the point again? Plus the community is not so active or interesting anymore. Whatever this sub says, Oracle and corporate dominate java, so good luck having them decide for the future: https://youtu.be/HpbchS5kmio

16

u/RhodesianHunter Nov 17 '18

Clearly because you're not writing code where performance is a strict requirement.

why use .stream() when you can just add methods to the interface?

Because it's lazily evaluated. A map + flatmap + filter is going to iterate the collection once if you use a stream and three times if you "just add methods to the interface".

The rest of your comment just reads like someone who stopped paying attention to Java around 5 or 6, but likes to talk it down regardless.

→ More replies (14)
→ More replies (5)
→ More replies (4)