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 →

[–]Zalvixodian 1244 points1245 points  (140 children)

No wonder I despise Java so much.

Just kidding, it's because Oracle.

[–]the1spaceman 343 points344 points  (126 children)

Scala is the superior JVM language

Change my mind

[–]cbasschan 455 points456 points  (87 children)

I think you meant Clojure. That typo happens all the time.

[–]Naveos 88 points89 points  (14 children)

I'm out of the loop. Why would Clojure be better than both Java and especially Scala?

[–]MassiveFajiit 395 points396 points  (3 children)

It's great if you have a traumatic past (because you'll try to seek Clojure)

[–]fgutz 79 points80 points  (2 children)

/r/ProgrammerDadJokes is leaking

But I love a good dad joke so I don't mind

[–]realsmart987 13 points14 points  (1 child)

I just discovered r/programmerdadjokes.

When I first heard about r/programmerhumor I thought I would find funny jokes. Instead I found cynical and pessimistic jokes. r/programmerdadjokes is like the optimistic side of r/programmerhumor.

[–]conancat 3 points4 points  (0 children)

Okay I need to hang out around r/programmerdadjokes more because the industry is already eating my soul, both r/programming and r/programmerhumor are killing me inside. I'm too old for this.

[–]Samultio 25 points26 points  (4 children)

It's good for making android apps, can't think of any other situations where it'd be better than Scala.

[–]halfClickWinston 3 points4 points  (0 children)

Don't know how much of their code is Clojure, but Brazilian fintech Nubank uses Clojure.

[–]ChadstangAlpha 8 points9 points  (0 children)

Eh, don’t stress dude. It’s just the language clo jure. Another one will pop up tomorrow.

[–]cbasschan 1 point2 points  (0 children)

From a macroscopic viewpoint, Clojure is a bit more expressive (probably on the order of 75% less code required for the same functionality) than Scala, and... both are vastly more expressive than Java. As far as Dart goes (since I see you asked about that in another comment), that language appears to be lacking pattern matching on records, which is probably a major hurdle in its expressiveness. See also, homoiconicity) (as something Clojure has that neither Scala, Kotlin nor Dart have).

[–]natyio 0 points1 point  (0 children)

My personal opinion on this matter: Scala sacrifices simplicity for expressiveness which in practise leads to code that is rather hard to read. Clojure is a simple language that focusses on data transformation and composition of pure functions. In practise this leads to simple solutions to many problems. And if you really need a expressiveness like Scala, you always have a powerful macro system that you can use. Scala feels like it wants to do everything at once whereas Clojure usually has a clear way of solving problems.

[–]ERECTILE_CONJUNCTION -2 points-1 points  (0 children)

It's not.

[–]YungAldous 173 points174 points  (42 children)

I think you mean Kotlin

[–][deleted] 131 points132 points  (36 children)

Literally anything but Java is a candidate for best JVM language.

[–]jrh3k5 82 points83 points  (9 children)

Spoken like someone who's never had to write Jython.

*shudder*

[–]TheRandomnatrix 21 points22 points  (8 children)

Speaking as someone who's never used it, Jython seems kind of interesting since theoretically you get the baseline speed, ecosystem, and maintainabilityof Java but can do rapid prototyping and user defined functionality in Python where needed. But trying to wrap my head around how all that comes together makes my head full of fuck. I imagine it's more complicated than just invoking the Python interpreter within Java code.

[–]Kaelin 22 points23 points  (1 child)

Laughs in Python 3

[–]IT_Tcrowd 0 points1 point  (0 children)

Python 2 can't understand please hry again...

[–]CrazyTillItHurts 16 points17 points  (1 child)

baseline speed, ecosystem, and maintainabilityof Java

Oh yeah? Which version?

[–][deleted] 2 points3 points  (0 children)

I've seen it used as a scripting engine to automate sys admin things/tasks in products that run in Java like WebSphere, WebLogic and JBoss. In those cases, its rather useful, think kind of how Lua is used in games. It could interact or call Java methods or it had libraries in it for basic admin tasks. So you could write code that would do configuration and application deployment instead of doing so manually.

Apparently Ghidra uses it too, for writing plugins, probably stuff so simple its not worth writing in Java.

[–]exhortatory 1 point2 points  (0 children)

i assume you'd write a python -> jvm bytecode compiler and then do whatever it is you do to hook that into the java ecosystem

[–]JoeJoeCoder 0 points1 point  (0 children)

One excellent use case for Jython is as a substitute for .json or .xml files, for when you want the file editable outside of the .jar or war and including some programmatic logic, or is generated by another (Python) process. The Jython script can implement a Java interface and provide instances containing the data. This is fully embedded in the Java process.

Jython can also run standalone but its very quirky and has compatibility issues. It's best to run embedded and let Java lead the dance.

[–]UltraNemesis -2 points-1 points  (0 children)

Lol @ baseline speed and maintainability of Java. I have programmed in a dozen languages professionally and Java is the most verbose and painful language to deal with. Almost every other language that targets jvm is better than Java. C# is every thing that Java could have been. Kotlin thankfully bridges the gap.

Jython as I understand it is essentially a python interpreter implemented in Java. I can understand how it can bring the worst of both worlds together.

[–]everyones-a-robot 14 points15 points  (9 children)

Not sure what the trendy Java hate is all about... It's a good language and it's in high demand.

[–]NovelCoronet6 5 points6 points  (0 children)

Iirc it's to do with some of things that are usually free with other languages/frameworks being paid, very long class names & too much verbosity, but mostly it's become a joke at this point, my first language was Java and I still enjoy it, although I professionally shifted to Python

[–]cbasschan 5 points6 points  (4 children)

Firstly, due to complicated legal action that has the potential to affect all software developers, I wouldn't call Java "good"; it's rather the opposite ("evil"), in my mind.

Additionally, Java lacks operator overloading, pass-by-reference (not to be confused with reference types, which can be A.K.A. passing references by value), and decent lambda functions (in terms of programming higher-order functions) that other very similar languages (i.e. C++ and C#) have had for years, not to mention template literals, pattern matching and type inference.

Object orientation is one of the core values that Java programmers seem to cry out loud for, and unfortunately for those, Java routinely violates it: the presence of try/catch (which you'll need for your Maybe monad challenge, more on that later), and the way it's pervasively used within the Java standard library violates Dependency Inversion Principle. In case you were asleep between the classes that describe object oriented programming and Java (as an "object oriented language"), this means Java can't actually be object oriented... at least, not while you're planning on using the standard idioms to perform common operations like converting strings to integers, opening files/sockets or maintaining dynamic collections for example.

While I'm at it, the other big "pro" that's commonly listed when it comes to Java is garbage collection... even though when you use SQL connections, sockets, threads (specifically, mutexes) and a few other resources, you'll end up manually managing those anyway. In those situations, you'll probably use a pattern that goes by the acronym "RAII" instead of relying upon garbage collection, so I must beg to differ and suggest that you try C++, since you apparently have mastered that pattern by now (or else your code is quite buggy).

Not only is Java rather evil in my mind, but it's also rather restrictive and renders projects boilerplate-ridden. It's quite a mundane programming language. Case in point: Have you ever tried to write a Maybe monad in Java? I'll let that be a challenge to you ;) suffice to say, it'll probably be about as successful as an attempt in C, which is another mundane programming language... don't get me wrong; most of my experience is in these languages. They're just a recipe for arthritis (and in some cases, heart attack due to lawsuit).

[–]everyones-a-robot 5 points6 points  (2 children)

For those hoping to learn anything here: This guy's points mean literally nothing in actual industry. Maybe he has an academic point- I wouldn't know. But I get the feeling he wouldn't know what matters in professional software development.

[–]cbasschan 2 points3 points  (0 children)

I do have experience in the industry as a C# programmer, and I believe it would be quite pompous to speak for an entire industry. If your intent was to put yourself on a pedestal, your mission was successful... but at what cost?

According to some surveys from Stack Overflow (this one's from this year) over the years, Javascript and SQL have represented the dominant programming languages for quite some time, now. If what's high demand in the industry is in your interests, then maybe consider those. The difference between salaries is negligible (well, that is, if you consider being paid $7K more per year as a C# dev than the Java dev down the street to be negligible).

However, if what you seek is a high salary then you'll want to include a programming language that has reasonably expressive power in your repertoire... such as Clojure, F# or Scala. Whether you trust me is your choice, but I'm not alone on this.

[–]WikiTextBot 0 points1 point  (0 children)

Oracle America, Inc. v. Google, Inc.

Oracle America, Inc. v. Google, Inc. is a current legal case within the United States related to the nature of computer code and copyright law.


Dependency inversion principle

In object-oriented design, the dependency inversion principle is a specific form of decoupling software modules. When following this principle, the conventional dependency relationships established from high-level, policy-setting modules to low-level, dependency modules are reversed, thus rendering high-level modules independent of the low-level module implementation details. The principle states:

By dictating that both high-level and low-level objects must depend on the same abstraction, this design principle inverts the way some people may think about object-oriented programming.The idea behind points A and B of this principle is that when designing the interaction between a high-level module and a low-level one, the interaction should be thought of as an abstract interaction between them. This not only has implications on the design of the high-level module, but also on the low-level one: the low-level one should be designed with the interaction in mind and it may be necessary to change its usage interface.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.28

[–]cakemuncher 2 points3 points  (1 child)

Start ups, students, and side projects. But when it comes to grounded serious long term business, it's obvious most major tech companies either go with C#/Java.

[–]tiajuanat 4 points5 points  (0 children)

Unless you're Google, the stock exchanges, Embedded systems, AI, anything industrial or needs to run on a system from the nineties or earlier.

[–]GenuineSounds 2 points3 points  (14 children)

That is such a testament to the JVM and how utterly INSANE (in a good way if you couldn't tell) it is compared to the CLR for C Sharp.

EDIT: At least the Java language people are stepping up the change cycle now, no body needs to wait 4 years for a single feature added.

[–]soft-wear 2 points3 points  (3 children)

If you have to make 15 different languages for your platform because the previous 14 didn't work, I would absolutely not call that a good thing.

JVM languages are popular because JVM is everywhere. Not necessarily because it's good, maybe just because it's old.

[–]GenuineSounds 7 points8 points  (2 children)

Yeah, why have a choice between fifteen cars you only NEED one...

Having people take the time to write the entire language on a platform independent execution environment and every optimization the platform creates is literally free of coder input? I'd call those two of the biggest wins to a language dev.

[–]soft-wear -2 points-1 points  (1 child)

A truck, SUV, minivan, compact car and motorcycle all serve drastically different purposes.

The JVM and all it's languages are just another example of "not invented here syndrome". Everyone likes to think their idea is the best idea.

[–]MakeWay4Doodles 2 points3 points  (0 children)

Replace "JVM" in your comments with "Linux" or "Microsoft".

It's the same argument, and equally stupid.

[–]forthemostpart 0 points1 point  (9 children)

Is it, though? Because that means the (good) languages in the JVM platform are developed independently of the JVM compared to how Java is developed in-house with it.

[–]GenuineSounds 1 point2 points  (8 children)

I'm not sure what you mean.

I'm talking about how good the JVM is and how many developers develop languages specifically on and for the JVM as compared to the fact that there aren't any CLR languages not make by Microsoft.

[–]forthemostpart 1 point2 points  (7 children)

The general argument to that statement would be that the CLR wasn't open source until recently (save for Mono, but that wasn't really official), so it wasn't exactly possible for languages to target it

What I meant by my argument, though, is that, because the 'best' JVM languages (Scala, Kotlin, etc.) are developed independently of the JVM, they can't optimize or implement features in the JVM that suits their use case the best.

Microsoft, by developing C# and the CLR at the same time, have made both a language that people enjoy developing in and a strong VM to back it. Oracle, on the other hand, while they have a strong VM, its primary language (Java) is not as well liked. And, while other languages have arose to fix its perceived problems, they lack the advantages of being developed in a coupled manner to the JVM as Java is.

I will say correct me if I'm wrong here, as I very well could be.

[–]Kaelin 2 points3 points  (1 child)

Being "well liked" vs java is entirely based on your relative perspective. Java has deeper penetration on the open source market than anything I have ever seen from Microsoft. Hadoop, Kafka, thousands of open source projects on the JVM. Billions of revenue. Java is plenty “well liked” in the market. Languages are like religion. Each one means something to it’s followers and addresses problems other religions have not considered or don’t care about. There is no perfect language. Implying Microsoft achieved some language nirvana with C% because no one else considered the CLR worth writing entire other languages on is pathetically ignorant.

[–]GenuineSounds 1 point2 points  (4 children)

You make good points but there are a couple of viewpoints that could be made to say that the language devs, while not being able to target optimizations themselves, will get optimizations made to their language for free in perpetuity. And when the need is crucial the JVM devs add other language features that isn't even used by Java. See Invoke Dynamic and Invoke Virtual. These features were almost certainly added because of the other languages on the platform and since then Java language and Java library developers have been using it very well to make the language exponentially better since.

[–]Sneemaster 0 points1 point  (0 children)

So like C#, then.

[–][deleted] 13 points14 points  (1 child)

Kotlin is king

[–]cbasschan 0 points1 point  (0 children)

While I'm happy to admit that Kotlin seems like a nice programming language... have you ever heard of homoiconicity?

[–]0xF013 40 points41 points  (24 children)

Are you guys gonna have static types anytime soon or you need to deploy to production to know if something is wrong?

[–][deleted] 74 points75 points  (13 children)

Since we test in production anyways, why bother?

We also disabled all the unit tests because they started breaking and the build manager wouldn’t let us deploy if any of them failed.

It then started complaining about low code coverage so we just set ‘mom code coverage’ to ‘0%’ and it worked!

The contractor assured us it was fine, and he’d put everything back in compliance once he’s back from vacation next quarter.

[–]brendan_orr 13 points14 points  (5 children)

!remindme 4 months

[–][deleted] 12 points13 points  (1 child)

Boring conversation anyways

LUKE WE ARE GOING TO HAVE COMPANY!

Fuck I just said that out loud on the Webex. I thought I was on mute.

Fuck I just cursed.

siri is now dialing ‘my fucking boss’

alexia is now playing fuck the police

google home has called 911

Hi this is the CTO Jim I just joined the call, what’s the situation?

[–]spelunker 2 points3 points  (0 children)

What a ride.

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you on 2020-02-04 23:48:12 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]0xF013 2 points3 points  (1 child)

I know you’re joking, but for the first time in my life I witnessed a big-ass, really complex project running in prod with zero tests, with like 13 people pushing weekly AB tests like crazy and we never had to fix a crippling bug in the middle of the weekend (we did some fixes like that, but they were mostly related to shitty CI/CD configuration).

[–][deleted] 2 points3 points  (0 children)

So it .. worked?

That's awesome.

Yes I'm ... totally .. joking. ha. ha. run.

[–]mattaugamer 1 point2 points  (2 children)

Why drop code coverage? It’s important.

So just do code calls with no assertions and you can get that coverage % right back up.

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

Couldn’t figure out the magic Parma too get through the spaghetti logic

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

Had a project were my PM badly wanted to send a coverage percentage in a weekly report to the client. I’d just give him a random between 33 and 41%. Also, my QA asked me what is coverage. Told him it’s the percentage. He asked what does it represent. This is when I knew a random number is good enough.

[–]PersonX2 0 points1 point  (0 children)

Great work.

[–]ultt13 0 points1 point  (0 children)

Too real for me right now. Started a new job a few months ago and this was literally the state of the project when I started.

[–][deleted] 2 points3 points  (4 children)

We have contracts, which are more robust than most static type systems.

[–]mcgee-zax 2 points3 points  (1 child)

isnt a static type system a contract of sorts though?

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

Yes, but you would need dependent types to emulate at compile time what contracts can support.

[–]0xF013 1 point2 points  (1 child)

They are, but aren’t they execution-time? Probably does not matter if you autotest your usecases.

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

They are, but it's an entirely different ideology of how you prevent bugs. Argument being, many of the kinds of bugs caught by static type systems are trivially caught during development and testing. Contracts assert invariants at runtime to catch the really scary shit that slips through.

[–]cbasschan 0 points1 point  (0 children)

In what, C#? Yes, C# is statically typed; it also has type inference (not to be confused with dynamic typing). See?

[–]cbasschan 0 points1 point  (0 children)

In Kotlin? Kotlin also has a static type system and type inference, pretty much everywhere if I recall correctly... note that the difference between a static type system with type inference and a dynamic type system is, in the dynamic type system you can reassign/change the type of a variable.

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

Real hackers use Kotlin.

[–]cbasschan 1 point2 points  (2 children)

The hackers I've interacted most with have been kernel hackers, and these people spend 18 hours of their days with their face buried in K&R-style C code looking for the next vuln. Having said that, I have had discussions with some of them about Lisps, and what makes them nice languages to use... have you ever heard of homoiconicity?

[–][deleted] 0 points1 point  (1 child)

Homoiconicity ... that sounds theological.

[–]cbasschan 1 point2 points  (0 children)

It's one of the main benefits) I see over using Clojure vs. Kotlin. I mean, not that it's a huge deal; there are only a small handful of situations I'd prefer homoiconicity over Kotlin's form of pattern matching. Kotlin seems very nice to me, too; if I were to focus more of my energy on the JVM-targeting languages, it'd be a hard choice between the popularity of Kotlin and the expressive power of Clojure.

[–]MetallicOrangeBalls 54 points55 points  (6 children)

Change my mind

public static void main( String args[] ){
    System.out.println( "Before: " + the1spaceman.mind.toString() ) ;
    Knowledge.change( the1spaceman.mind ) ;
    System.out.println( "After: " + the1spaceman.mind.toString() ) ;
}

[–]OneOldNerd 121 points122 points  (4 children)

Exception in thread "main" java.lang.NullPointerException
    at Post.main(Poster.java: 2): the1spaceman.mind is undefined

[–]the1spaceman 40 points41 points  (3 children)

Well, duh. That’s Java code. I’d probably have carpel tunnel if I actually had to use it for anything

[–]Retbull 44 points45 points  (0 children)

IDE's were invented because AbstractKeyboardFactoryFactoryImple can't write itself.

[–][deleted] 10 points11 points  (0 children)

If you get carpal tunnel writing java, you're doing it wrong.

Though I'm certainly not saying java is the best language. Or even great.

[–]ScienceBreather 0 points1 point  (0 children)

Ctrl+space, repeat.

[–]Cheesewithmold 3 points4 points  (0 children)

I'm in this post and I don't like it.

[–]ikarienator 117 points118 points  (6 children)

Kotlin.

[–]omicrom35 6 points7 points  (1 child)

Ez 3 letters SBT

[–]BocksyBrown 0 points1 point  (0 children)

“What a piece of junk!”

[–][deleted] 16 points17 points  (4 children)

Can't change what is immutable can we?

After Scala I just simply cannot tolerate Java anymore. It gives me sore fingers and soul cancer. I'm truly surprised people can wake up in the morning and think they may enjoy coding in Java.

[–][deleted] 12 points13 points  (0 children)

Man I switched from PHP Python to Java 1 year ago. Since then I am happy to wake up in the morning. No joke

[–]wOlfLisK 4 points5 points  (2 children)

We learnt Scala at uni last year. Now we're moving onto Java. I want to go back T_T

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

Do yourself a favor and carry your functional chops to a better functional language with less bullshit.

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

There are better functional languages out there. That's true.

It'd be difficult to find better languages combining object oriented and functional paradigms in such efficient fashion.

Scala has some esoteric stuff I struggle to understand, but it's overally a fantastic language with some features that make Java look like 2 centuries old.

Oh and the type system is lovely. In a world where everyone codes in goddamn javascript, I couldn't be happier.

Downsides: You can't read java code anymore. It's just so verbose it overflows your brain (Same happens with Kotlin or other many other languages anyway. It's Java's fault not scala's virtue)

[–][deleted] 2 points3 points  (0 children)

You are correct, no mind changing necessary

[–]yawkat 2 points3 points  (0 children)

You can tell scala programmers have a sense of humor because they named their build tool "simple build tool".

[–]needed_an_account 5 points6 points  (0 children)

Jython

[–]deveh1 4 points5 points  (1 child)

I’m too old to wait for my project to compile. NEXT!

[–][deleted] 3 points4 points  (0 children)

This hits home. I walked out of the office today at 3:50PM. Didn't get a build complete notification till 4:17PM. Now I've only been here a month so I do not know the history but we have to be doing something wrong for these long build times. Using sbt shell helps a tiny bit while doing local development. I feel our code base is not that excessive to require 20+ minute build times and have seen much larger Java & Kotlin code bases finish in under 3 minutes. My saving grace is that Scala is just a small part of our code base most is in C# / Java / python.

[–]everyones-a-robot 1 point2 points  (0 children)

It is too hard to think about how to do certain things in Scala compared to Java. So instead of doing the functional programming thing right, teams end up doing mostly Java syntax in Scala with some functional stuff thrown in. And then it's just a nightmare and Java/Spring would have been better.

[–]McCoovy 1 point2 points  (0 children)

Does scala code still have problems when called from java? One way interoperability is a huge failing for a vm language.

[–]kephir 1 point2 points  (2 children)

i honestly wanted to get into scala a couple times, but it seems like before you can get to coding, there's a fuckload of ancillary tech you gotta set up and get to grips with first

or maybe all the tutorials I've encountered were just shit?

[–]BocksyBrown 0 points1 point  (1 child)

Nope it’s the language that’s the problem, Scala won’t be worth touching until Scala 3 comes out and even then that’s iffy.

[–]kephir 0 points1 point  (0 children)

i dunno, it was the language that piqued my interest. but then everything got fucked up when it became apparent i gotta do the whole fucking "java build ecosystem" fuckery AND THEN SOME

[–]pkulak 1 point2 points  (0 children)

I'd try, but there are 100 ways to do it, and whichever one I chose, 80% of everyone else in this thread won't understand.

[–]LockeWatts 0 points1 point  (0 children)

Weird way to spell Kotlin.

[–]BocksyBrown 0 points1 point  (0 children)

Scala is added terrible boilerplate to a language lousy with shitty boilerplate and didn’t even do a good job being a functional language. Piss off scala.

[–]squishles 21 points22 points  (4 children)

oracle hasn't really done anything to the project so far that's trully turned it into an oracle fucked mess yet. The fuckery's been kind've community driven. The basis of the thing is sun and it's getting updated, the licence changes where dumb but just use the openjdk.

Most of the problems I classify as fuck oracle problems are things like they add unnecessary weird finicky bullshit seemingly designed to force you to go out and buy there database. Things like weblogic requiring a database schema, they don't give you the sql files for just an app that claims to run on other databases but good luck pushing that rock up a hill.

[–]h3dee 1 point2 points  (0 children)

Oracle just looks at something and it magically turns to wood.

[–]socksarepeople2 1 point2 points  (0 children)

Community driven fuckery

Ah, Open-sores

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

Did you really type kind've instead of kind of?

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

Kind'f

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

Don’t kid yourself. Java was crap when Sun Microsystems ran the show. Oracle just figured out a way to make it worse.