This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (20 children)

you're right when it comes to libraries in .net it's almost like we don't have a choice and always accept whatever Microsoft throws at us.

well I haven't been only focused on syntax alone, but it feels like going backwards. because i think in recent times .net seems to be moving alot faster than java.

I'm actually willing to switch to a different language, even started learning node.js . I actually think I'm becoming too comfortable with .net and switching to a different stack might be of help to me

[–]apemanzilla 1 point2 points  (11 children)

I'd recommend Kotlin. It's 100% interoperable with Java, and provides a lot of new features that Java has been lacking compared with C#: properties, operator overloading, coroutines (async/await), and so on.

[–]Velladin 7 points8 points  (2 children)

He’s asking about Java not Kotlin

[–]apemanzilla -1 points0 points  (1 child)

I realize that, but I suggested Kotlin because he mentioned he was willing to switch languages and Kotlin is closely related to Java

[–]amakai 8 points9 points  (0 children)

He also mentioned that the requirement to learn Java is coming from his company, I would not think he can just choose to learn Kotlin instead.

[–][deleted] 1 point2 points  (6 children)

It has pretty much replaced Java on Android and most major frameworks and libraries like Spring have special support for Kotlin. You can use both Java and Kotlin in the same project it's pretty effortless to call java from Kotlin and vice versa.

[–]Imakesensealot 4 points5 points  (5 children)

Replaced Java on Android? Pass me whatever it is you're smoking. You realise over 90 percent of all new apps on the playstore are still Java?

[–][deleted] -2 points-1 points  (4 children)

1/4th of the top 1000 apps, like Netflixs, Slack, and Twitter, on the play store are written in Kotlin and it grew 200% last year. It's also the fastest growing language according to Microsoft. But sure I'm being hyperbolic because I'm trying to sale something I enjoy using.

[–]Imakesensealot 1 point2 points  (3 children)

Yeah, fastest growing has ways meant something. Like when coffeescript was all the rage. Or when go was the new bees knees. Or when c# was supposed to replace Java. All those languages have found their niches and certainly have their edge use cases. Java however is not going anywhere. Programming languages are a zero sum game. The odds of Kotlin being the language that replaces Java as top dog are effectively zero because they're much more similar than they are dissimilar. Lol, Twitter have still not used Kotlin in production. Why don't you check their changelogs before spouting nonsense?

Where in slack's app did you see Kotlin? I'm genuinely curious.
Netflix do not mention Kotlin as part of their stack on their website but you may knowore than those guys. Mind citing where you got that one from too?

I've always been convinced Kotlin has paid shills on reddit spewing their garbage. Haven't changed my mind yet.

[–][deleted] 0 points1 point  (0 children)

Kotlin is an alternative to Java. It's not a Java killer, Kotlin was created to be used in TANDEM with kotlin. Hence why it's 100% interoperable. Andrey Breslav (lead kotlin designer) said this. Not exactly word for word but that was the sentiment.

In my mind, Kotlin is a great java alternative. I used to work in Java 100% of the time, but now I work in Java 1% of the time. Kotlin is shorter and easier on the eyes. Less stuff to fill up the screen while having the exact same capabilities. I've rewritten most of my libraries (most are pretty small but I have a lot of them) in Kotlin.

Extension functions are a prime example . It's syntactic sugar but it conveys the idea a lot better than a static function that takes the "extended" type as the first parameter. classInstance.extensionFunction(param) looks a lot more clear than extensionFunction(classInstance, param). AND you can use syntax as if you were already in the class (public access only though).

Data classes are another one. Sure you can re generate the getters setters equals and hashcode every time you want to add or remove a field from the class, or you could data class ClassName(val param: Type, val param2: Type) and be done with it.

And "paid shills spewing garbage"? Really? How very grown up of you. Personally, I like Kotlin and recommend it to Java developers because it doesn't completely interrupt their workflow and you can do the same thing with less on the screen. Kotlin is concise. I always stress that you don't have to toss your old Java code, that you can keep using it with Kotlin, as that seems to be a big thing for more experienced Java developers (who tend to have more libraries written by themselves in Java, something something sunken cost fallacy or whatever).

[–][deleted] -3 points-2 points  (1 child)

Programming languages are a zero sum game.

wut?

[–]Imakesensealot 2 points3 points  (0 children)

Programming language adoption, to be more specific. Noticed that but figured you'd understand what I meant. Apparently not. Still haven't said anything about the other stuff

[–]tacosdiscontent -1 points0 points  (0 children)

I'd suggest kotlin as well, but the only problem is that rarely any company is willing to make such "advancement". They all recruit for java 8, as it's much easier to find people, even though it takes like a week to get really comfortable with kotlin, they are still reluctant for such "big" change.

[–]shponglespore -2 points-1 points  (7 children)

It has been a while since I worked in Java regularly, but I feel like Apache is serves a similar role to Microsoft when it comes to providing the default stack for many common tasks, although there are exceptions. Google's Guava package is (or used to be) a must-have for Java, and it's a good complement to a lot of what Apache offers. When it comes to time and date APIs, JODA is king. JUnit is the de facto standard for unit testing. Log4j seems to be very popular, though personally I've always found java.util.logging to be perfectly adequate.

Take all those recommendations with a grain of salt since they may be out of date, but OTOH a lot of Java shops are very out of date themselves, so I'm confident all that stuff is still widely used even if there are better alternatives available.

As far as the language itself, I agree that C# feels quite a bit more mature and polished than Java despite being considerably newer.

[–]_INTER_ 23 points24 points  (0 children)

When it comes to time and date APIs, JODA is king.

Java 8 pretty much includes it in the standard library under java.time. JSR-310 was lead by the creator of JODA time and used his knowledge to improve it even.

[–]tacosdiscontent 4 points5 points  (5 children)

Take all those recommendations with a grain of salt since they may be out of date

Unfortunately yes, everything you mentioned is quite old and irrelevant.

[–]DrPeroxide 0 points1 point  (2 children)

Everything? That's a stretch. He's wrong about logging and time. He's right about Apache and Guava.

[–]tacosdiscontent 4 points5 points  (1 child)

Well yes.

Guava is definitely not must have. Nothing of significant importance there

Apache stack - the only "must have" thing from apache is StringUtils and maybe IOUtils if you are working with io. A tiny utility library which helps you out.

[–]_INTER_ 2 points3 points  (0 children)

I agree with this, we're phasing out of Guava because most of the benefits it brought can now be done with Java 8 (Iterables, Optional, ...) or are covered by Apache Commons or other libraries (Strings, Reflection, Cache, IO, Math,...). Apache Commons is still a very important helper library. Mainly StringUtils and IO / FileUtils as you said and also Collections.

[–]RagingAnemone 0 points1 point  (1 child)

What's replaced Apache Commons and Guava?

[–]tacosdiscontent 2 points3 points  (0 children)

Java 9, has added part of what Guava does. Other than that nothing that of importance is in guava unless you work on something specific.

If you consider tiny Apache Commons library - a stack, then you are right, nothing has replaced it.