/fjg/ - Friendly Java General

Talk about JVM languages here! Share your thoughts and secrets to entering enterprise development.

Attached: java8.jpg (399x500, 43K)

Other urls found in this thread:

allegro.tech/2018/05/From-Java-to-Kotlin-and-Back-Again.html
discord.gg/fckKjT
braveclojure.com/
twitter.com/AnonBabble

Is Java native dead?
even though Java lacks a few features we take for granted, I like the language.

I think Java went fatally wrong considering usability when they implemented lambdas but chose not to support mutable closures because "it's not the java way". If you're gonna half-ass it, why bother doing it?

Java is very much alive. If anything, Java has recovered from whatever slumps it had previously in progress. Now we have Java 10, Graal, et cetera.

Enterprise Java dev here.
AMA

Java isn't really a FP language desu. Lambdas are just a nice inclusion.

Do you work with Indians at all? I'm going to be working at an Indian IT firm soon.

Nope, no Indians.

That's what I mean. They went against features and semantics that are now universally considered useful, in favor of "staying old-school". What does that accomplish? Why would I touch Java until they have comprehensive support for lambdas? If you've ever done FP or used a language with closures you'll know that it's a much more natural semantic for creating functions than having to use useless intermediary classes to store the closed-over state. They went in the right direction but then they had to blow it.

I wish Java didn't take so long to include the var type. When are data classes going to be a thing?

C# manages to keep up to date, why not Java?

Yeah it's a valid question

C# is a much much younger language. When Microsoft started working on C# they already knew what could be done better and did not have the baggage that Java has. They started fresh and implemented some features from the get go.

It's younger, but only by 5 years. I still think they manage to catch up "with the times" quicker. I think Oracle should speed up adoption of features. I wish they'd just import all of Kotlin's features already.

What do you guys think of Kotlin?

I think it has some great features. It's mostly a meme language outside of Android though.

Well what features of Kotlin would you like to see in Java?
Thing is, giving Java the features of Kotlin is kind of missing the point of having them both in the first place.
Kotlin is also a JVM language so it does compile to similar bytecode as Java with minor differences (this has an impact on speed, Kotlin is still pretty slow compared to Java but it's getting there).
As for C# vs. Java, I agree some stuff IS better although C# is still not as mature (opinionated frameworks and libraries) but it does have some features out of the box which I guess the authors of Java hadn't thought of at the time of the languages inception.

I have to start getting into mobile development and I hate react native. I hate java too but maybe Kotlin is different.

I hear it's great for Android however it is not mature enough to use in Enterprise (so I believe).
I recommed this article allegro.tech/2018/05/From-Java-to-Kotlin-and-Back-Again.html
It outlines some strength of Kotlin but ultimately gets down to pragmatics of coding as well as some simply subjective things about the language which some people may not be very fond of.

Data classes, extensions, inline functions, and range expressions would be a nice start.

>As for C# vs. Java, I agree some stuff IS better although C# is still not as mature (opinionated frameworks and libraries) but it does have some features out of the box which I guess the authors of Java hadn't thought of at the time of the languages inception.
That's the big advantage Java has over C#: seniority. It's simply an older language with a much wider range of library support.

Can we get a discord server that's as popular as the C# one at least? Maybe one not filled with just new users too?

Kotlin made me very happy when I first used it. I learned it first before I dived into Java honestly. It's a breath of fresh air.

I've never used discord but sure, why not.

The thing I always found sound weird about Java was that it was never intended to run standalone programs like most languages but instead was designed for Rich Internet Application you got from a browser but now it is still alive and kicking but literally no one uses it for browser programs.

I mean granted JAR files got retrofitted for this purpose but they were designed for fast network transfer to get an applet running...

just seems so weird they went through all this trouble to make the language and platform and it didn't even ship with a basic way to distribute and launch programs outside of using command line tools.

I might actually create one soon if I can find enough experienced Java programmers that are actually interested in joining such a server. Right now there's just the learnjava server but it's admin is too busy playing rocket league and jacking off to anime to help the server.

Sure, sign me up.
I have 2 years of experience in enterprise Java.

Recent grad here, am I ever going to need to use an Interface over an Abstract class in the real world, ever? Even though I've read up on it, I still feel like there's not any real reason for interfaces to exist.
I'm mostly just worried I'll go into a job interview and get asked what an interface is and I want something to say besides "dumb."

Keep an eye out for a discord server link in the next thread then. I'm entering the enterprise world soon (as soon as HR gets sends that offer letter).

There are many cases where you would use an interface instead of abstract class.
First of all, there is no multiple inheritance. This means that you can only extend one abstract class which limits your options. You can however implement as many interfaces as you like.
The difference between an abstract class and an interface is that the former can also have method implementations. Think of an abstract class as a 'base' class that other classes literally extend. An interface is just a contract that you have to fulfill when you implement the interface.
Think of it this way:
You can have an abstract phone. It has a field for number and also implemented methods for texting and calling, both of which in a certain way (you want all phones to text and call in this particular way). Then you have a smartphone which also has texting and calling BUT it also has many other features like taking photos, thus you EXTEND the basic phone with some new features.
If you had a phone interface you could say 'I want ALL the phones to have texting and calling but I do not care how you call or text'.

Stop fucking making generals for every shitlang

>stop discussing technology on a technology board in a manner I don't agree with

Attached: vO7lRZ7.png (621x702, 56K)

what we need is a proper programming board desu

Didn't we use to have a programming textboard?

I'll make the logo.

We did before m**t decided he wanted to be a bigger faggot

Oh he quietly purged them?

Thoughts on using Spark Java as a means to create a rich web application?

Spark is pretty niche, I'd recommend just using Spring Boot.

How did such a shit language that is javascript overtake java in web development?

Yeah Spring Boot is probably just as fast to get an web app up desu.

It's simple, it's pretty fast, it just werks and you have a single language on the entire stack.

Because Java Applets got a shit reputation for breaking a browser's sandbox easily leading to a plague of viruses. JavaScript's worst crime by comparison was performance.

>AbstractAbstractBeanFactoryFactory

Java development is controlled by a committee of several companies and C# is controlled by one company, Microsoft. So Java moves slower. Each approach has its pros and cons. C# has a lot of feature bloat, for example, while Java is much simpler. A simpler language is better for keeping your sanity especially if you work with a large codebase with lots of different programmers.

Verte.io web

Daily reminder that not even the Mongols could conquer Java

Attached: Capture+_2018-08-13-13-23-10.png (1308x1000, 111K)

>spurdo on book cover
>java
makes sense

I have to learn java for uni this year.
What's the best book for someone that already knows C++, C and Common Lisp and just wants to not have to pay attention in class for a year.

Attached: 1488085716883.jpg (500x375, 54K)

OP pic.

And effective java edition 3, begin way above typical java course.

Why you don't like JakartaEE/JavaEE, /fjg/?

Attached: 1532095347594.jpg (825x959, 76K)

user, do you mind sending the link to this "popular C# discord" and "learnjava server"? thanks. I'm also looking forward to this java discord you're creating

>this
these*

Scala is THE BEST JVM language and there's nothing you can say to prove me wrong.

They disabled it a few days ago because some autist raided the server but I can ask.

A committee of several companies? I thought it was just Oracle.

Here is the Java one at least:
discord.gg/fckKjT

The main development of Java happens at OpenJDK, which is done by Oracle, IBM, Red Hat, and others.

What is the most efficient way of explicitly deleting objects from the JVMs memory? I’ve been looking into the sun.misc.Unsafe class, but seeing as how Java wants to remove it, are there any alternatives?

Oh, didn't know so many companies were involved in the committee. They are doing a 6 month release schedule now, right?

System.gc()

Looked into that already, but like I said I’m looking for a more explicit way to do this. System.gc() calls don’t guarantee that the garbage collector will actually run, nor does it guarantee that an object will be sweeped.

Yes.

clojure is the best jvm language.

braveclojure.com/

Attached: braveclojure.png (900x900, 104K)

FP Java lang when?

kotlin + http4k + jdbi = lightning fast statically typed backend bliss

Is Java similar to Javascript?

Kotlin is based and the competition/vision that Java needs.

lolno

Why would you need that?

I'm currently setting a static String in the constructor of a class to the name of the class using reflection as such:
public class A {
private static String id;

public A() {
if (id == null)
id = this.getClass().getName();
}
}


I'd prefer for this String field to be final as well, in order to initialize it only once at compile time instead. How can I do this? Since you can't use the "this"-keyword in a static context, the following doesn't work, but can something close to it be achieved?
public class A {
private final static String id = this.getClass().getName();
}

Attached: 1488064476351.jpg (460x423, 17K)

Spring is a bloated mess with too much magic.
Use vertx.io instead, it's faster, faster to set up and allows you more freedom

You can't really, you would have to use the concrete class (A.class.getName()). this.getClass() only makes sense in non-static contexts where it could be run from a child class.

Spring might be bloated, but Boot should work well for that application type.

How much do you make?

Ah well, at least I can stop speculating then I guess. Thank you.

Attached: 1486512825716.gif (400x224, 2.74M)

Its time for Java to die. It had a good run, it was good for mobile apps in the days of flip phones. It was good for enterprise infrastructure in the 00s decade. But its forced OO is very clunky and is cause for lots of lack of productivity and innovation due to its constrained eco-system. So languages like Kotlin, Swift and Go are all making in-roads to enterprise computing.

Ah, so it's mostly a conceptual thing. I forgot that Java doesn't have multiple inheritance, so it sounds like interfaces are very useful in that situation.
Thanks!

>native

>whats graalvm

how do i learn how to use camel or any of the frameworks? Most of the docs are too high level or assume that I have been programming for a while. I have camel in action and its a good book but I need way more tutorials with step by step examples, not snippets of code. or am i fucked?

>clojure
is clojure as good as rich makes it seem in his talks?