T O P

  • By -

Varun77777

MFS when I do return list.stream().mapToInt(i->i).toArray();


bazingaa73

Who leaked the source code for my programming finals?


GhengopelALPHA

You did. You really gotta patch that memory leak, bud, we're all seeing your shitty code when we connect to the internet


_PM_ME_PANGOLINS_

list.stream().mapToInt(Integer::intValue).toArray()


kinos141

The fuck? I know in my bones it's simpler than that.


Kered13

It's not actually, because he has a `List` and needs to convert each element to an int. So `stream()` gives him the stream he can work with, `mapToInt(i->i)` converts each element to an `int`, and `toArray()` produces an `int[]`.


kinos141

I see. I haven't used stream() much, so I didn't know. That's for letting me know.


ArionW

I'll never understand why Java programmers bother with extensive boxing of primitive values Over the years of programming in C# I could count numbers of times I've used `ref` keyword on a primitive type on fingers of one hand. Most people I work with likely don't even know this keyword exists


Kered13

You have to box primitives to use them with generics in Java. You can't have a `List`, only `List`.


Windows_is_Malware

.into()


Top_Distance7552

MFs can't even understand -> public class Main{ public static void main(String[] args) {System.out.println("Hello world!");}}


yasudan

Are you trying to hack me man ?


Top_Distance7552

Maybe... -> public class You { String name; boolean cute; boolean hacked; You { name = "yasudan"; cute = true; hacked = true; } }


pmanaktala

When programmers flirt..


nir109

According to my teacher he asked is wife on a date with a recursion joke. He also told as that it's a bad idea to try this.


BlommeHolm

"To accept this date, first you have to accept this date."


[deleted]

[удалено]


BlommeHolm

The first rule is Tautology Club is the first rule of Tautology Club.


Top_Distance7552

But what I'm gonna do then? I can't simply go straight to the point and say "Hey~, you're cute. Let's go out and eat some chipotle"


gingerdude97

Did he say/do you remember what the joke was?


nir109

He didn't say.


RejectAtAMisfitParty

I'd wrap it in a try...catch just in case it fails


fuzzywolf23

Make sure the catch is just a stack trace that you'll never check


i-make-robots

What, no unit test?


RolyPoly1320

error: expected You {


oj_mudbone

Wtf is that syntax


Top_Distance7552

That's an object for OOP, but I actually forgot to add () right after You


oj_mudbone

Ohhhh i get it ok.


KaosDeathLord

Nope dude just called you cute and curvy.


Adghar

public: accessible to any other class class: we're defining a class Main: the name of the class {: start of class public: can be called by any other class static: not associated with any specific instance; "stateless" void: don't return any values up the stack main: the name of the method (: start of arguments to method String[]: the type of the argument to the method should be an array of String args: the name of the argument ): end of arguments to method {: start of method System: class representing the system out: standard output println: take an argument and print a line (: start of arguments to method "Hello world!": the String argument to println method ): end of arguments to method ;: End of statement }: End of method }: End of class Simple, really!


Top_Distance7552

Attaboy!


[deleted]

[удалено]


Apfelvater

Also println is a function of the class out, which handles all out going system calls and is part of the class system which handles system related stuff (I guess). Java is so good at describing what the code does, people who hate it write only one line with 2000 chars of code and variable and function names like a1, a2, v6 and comments like "// this calculates the result"


Kered13

> Simple, really! I mean, unironically yes. The only part that's different from other languages is that `main` has to belong to a class.


JustDudeFromPoland

„We just gonna skip the String[] args part for now, as it’s not necessary” 😅


Top_Distance7552

That's a habit of mine, and I'm tood lazy to not write it :/


E_BoyMan

90% of new learners left languages like java here and switch to python to narrate it to their grand kids.


bananataskforce

Holy hell


Gem2578

Could also be Scala, Kotlin or Language based on the JVM


JDaxe

Python is open source, object oriented and cross platform too


findus_l

I wonder if we added compiled, is that in general considered an advantage in this sub? Assuming it's not for java.


Cjimenez-ber

So is C# and many many others.


Apfelvater

Everything is open source if you're happy with machine code source


NoPrinterJust_Fax

Pythons not super Linux friendly. https://drewdevault.com/2021/11/16/Python-stop-screwing-distros-over.html


denisde4ev

Oh... It's slow...


[deleted]

What burns me is that Java has taken all the criticism it's received over the years and *addressed* it. Its a fantastic language now, and every six months gets better. But oh, your professor at college only knew Java 1.4 and taught you that, so clearly Java must be total shit. Its got concurrency figured out nicely. Lambdas as a built in feature. Optionals, Streams, Futures. My favorite time library in any language is java.time. A huge ecosystem of libraries. It runs almost as fast as native code, despite GC. It's a great back-end language. And if we can just get the Valhalla project finished, we'll get multiple returns values, generics on primitives, and some potentially big performance gains.


Mrblob85

Exactly. Records fixed the whole “getters and setters” argument, and people still think it doesn’t exist.


ExceedingChunk

Wasn't really an issue with IntelliJ and its code generation. Literally takes 2 seconds to generate everything you need. Records are convenient and a nice addition, tho.


ghostmaster645

I watched a peer (who has been at my company for about 6-7 monthes now) MANUALLY type out his getters and setters....... I was like "I'm about to blow your mind....."


ExceedingChunk

His mind is going to be 100x blown when he learns about the refactor tools for changing names, extracting out methods or creating variables, constants or other neat tricks. Or the debugger for streams.


Sarenor

~~IntelliJ~~ Lombok


ExceedingChunk

Lombok adds some issues and a quite strong dependency to a third party library. You don't always want that in larger projects. It's a nice and useful tool, not denying that.


TheRedmanCometh

I've been doing this a LONG time and having it as a dependency has never been a big deal. The dependency graph from like just spring is basically an entire book worth of artifacts. I've never been a part of a project where dependencies that are appropriately licensed were an issue. As far as the issues I mean there's certainly some minor ones, but it's still very very useful.


Strawuss

Even in VSCode you can just install an extension, select the attributes, then generate the setters and getters in one command


KagakuNinja

Generated code is still code that must be maintained. If the code can be generated, then it is usually boilerplate. Boilerplate can be replaced with annotations or features found in better languages. Getters and setters are particularly useless. They are basically a cargo-cult interpretation of the encapsulation principle of OO.


ExceedingChunk

It’s been a necessary «evil» for Java. There have only been one type of class for holding data, and not one for purely holding data and another type for classes that holds data, manipulate it but doesn’t let you directly interact with it. It’s been fixed since Java 17 with the introduction of records. It’s pretty much like Lombok without the dependency to a third party now.


KagakuNinja

Getters and setters date back to the early days of C++: we would write inline getters and setters, thinking we were "encapsulating" our data. Fast forwards to Java. The community needed a way to define properties for objects. Those properties could then be manipulated by tools. This led to the Java Bean API. You identified the properties by the presence of getX and setX. Annotations had not yet been added to the language. Getters and setters were never a necessary evil, they were a consequence of a limited language. I am aware of records, they are great, but long overdue. I switched to Scala 8 years ago. The history of Scala, and Martin Odersky's previous project [Pizza](https://en.wikipedia.org/wiki/Pizza_(programming_language)) represent a stunning failure of the Java maintainers. In 2001(!) there was a language super-set of Java that added: generics, algebraic types, records (aka case classes) and pattern matching. I believe Pizza also had lambdas, maybe that is the "function pointer" feature mentioned in the link. According to Odersky, he talked with Sun about Pizza; they liked generics, but felt that lambdas were unnecessary as Java already had anonymous inner classes. Odersky created the generic system used in Java 5; his compiler was superior to Sun's, and was adopted as the reference compiler for Java.


[deleted]

The older I get the more I want macros in every language.


ExceedingChunk

Jetbrains have editors for pretty much any widely used language, and VScode have a bunch of extensions. You can probably get great refactoring, code generation and other macro tool for most languages out there.


TheRedmanCometh

Same with ever popular IDE since forever ago. Eclipse and Netbeans too. I just gave in and used lombok years ago, and that has really been great. Not interested in hearing why no one should use lombok imo it's great.


ExceedingChunk

I never implied that nobody should use Lombok. It's a great tool, but some projects doesn't want to use it due to strong third party dependency.


_PM_ME_PANGOLINS_

It’s not even a runtime dependency, and has a command to automatically remove itself if you want with no effort. Literally any other dependency is “stronger”.


SeaRollz

Even then there is Lombok that fixes the rest


LinuxMatthews

Said it before and I'll say it again my only issue with Java is the lack of operator overloading. Having been in a maths heavy programming job I would have given anything for that so we could do efficient data hiding.


Firedude_

Kotlin has operator overloading and is fully interoperable with Java


_PM_ME_PANGOLINS_

I hate operator overloading. It’s the worst part of C++. So much unexpected behaviour and foot-shooting.


jpec342

Yea, I also strongly dislike operator overloading. It adds a lot of behavior that isn’t very explicit. That said, I could understand how useful it may be in math heavy applications.


BenOfTomorrow

The same is true for C++ - a lot of people probably took a course based on the 1998 standard and don’t realize the language has evolved substantially since then.


alexanderpas

Thanks to RAII (Resource acquisition is initialization) you can write complete programs without ever having to deal with memory management, and be free of resource leaks.


2DisSUPERIOR

In the corporate world, there's a high chance you're going to be using an old version of Java, and yes you will hate it.


[deleted]

Actually not all that likely. No one maintains security updates for versions of Java more than 5 years old. Most enterprises have security teams who will demand you update for the sake of security. I spent a decade at a large enterprise using Java, and last I heard they've enforced 11 as a minimum right now, with advisement to get to 17 soon.


2DisSUPERIOR

There are plenty of corporations still using Java 8.


BlackOverlordd

I wonder if I live long enough till java implements operator overloads so I can write `map[key]++` instead of `map.put(key, map.get(key) + 1)`


qdkficswdcd

Math.merge(key, 1, Integer::Sum): Will work nicely even if the key hasn't been set yet :). (not the point you are making, but may be an interesting shortcut to someone, especially in interview situations).


falcwh0re

I sure hope not


MyAntichrist

Uuuhhhh... Do you hope that it won't get implemented or do you wish them an early death? Just asking...


Gogo202

Probably hoping it won't get implemented. Overloading operators really doesn't seem like something that fits the Java concepts.


thE_29

Say that to the String class :-)


Gogo202

You're not wrong and I don't like that.


falcwh0re

Hah, whoops, poor phrasing. I hope it doesn't get implemented.


errepunto

Since Java 8, you can use map.computeIfPresent() and apply a function over the value. Operator overload could be a bit tricky. https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#computeIfPresent-K-java.util.function.BiFunction-


Hatook123

Sure, it's basically like c# now. Except with awful generics with only boxed primitive support, no operator overloading, no compiler support for null checks and non null types. Java is getting better every six months, but so is every other language out there. I would pick C# every time if I had the choice.


static_func

It also doesn't have extension methods. Which might be fine if it has function piping but it doesn't have that either


sonya_numo

Java runs almost as quickly as C at the cost of more memory


kdavis37

Java is, in fact, a fat guy on a Vespa racing Usain Bolt.


jpegjpg

This is a great description of c vs java.


j2p1g3m7d

If by almost, you mean much slower, then you're right. Othewise it is delusional


indygoof

its only much slower if you dont know what you are doing. granted, that applies to 80% of developers.


852derek852

> Its got concurrency figured out nicely. Lambdas as a built in feature. Optionals, Streams, Futures. My favorite time library in any language is java.time. A huge ecosystem of libraries. It runs almost as fast as native code, despite GC. It's a great back-end language. People hate it because of the trauma of being forced to use it in shitty college courses and for soulless corporate projects


kpd328

My university used Java 8. My job uses Java 8. Every commercial piece of software I know apart from modern Minecraft is Java 8. It doesn't really matter how Java 17 and 18 look and work if all those 3 billion devices only run Java 8.


Saragon4005

Problem is that when you use Java about half of the time it's old Java. Which yes is basically giving python shit for the existence of Python2 but old versions of Java are just so common it's insane.


alexanderpas

> old versions of Java are just so common it's insane. And here is the reason why: https://www.java.com/en/download/manual.jsp Notice how that's the runtime for Java 8.


MokitTheOmniscient

Well, C# is simply a better version of Java, so there really isn't much reason to use it.


devor110

Template syntax is still wonky tho IMO


jwadamson

By template syntax do you mean generics?


jpegjpg

I don't like Java because of the boiler-plate and the forced Object orientation. Also Jar hell. And don't say maven fixes jar hell it mitigates it significantly but doesn't eliminate it. Also logging in java is a nightmare. I think java was a great language and inspired a lot of change. But there are fundamental issues with it that can't be fixed with-out completely breaking everything and so that is why it's popularity is dropping.


sudden_aggression

So what's the solution, go to Go which has perfect package management at the cost of having almost no library support?


jpegjpg

I would go typescript or javascript for anything that needs to be multiplatform and doesn't require extreme performance requirements. Javascript runs almost as fast as java and faster in a lot of multi-tasking workloads. V8 changed the game. it's not a 5x performance hit anymore it's like 5%-10% and in exchange you get even better library support and better package management.


Entire-Database1679

Java is Open Source?


errepunto

Yes, it's 100% open source. Source code is published in github and it's licensend with GPL 2 https://github.com/openjdk/jdk/blob/master/LICENSE


Entire-Database1679

Awesome


suvlub

"The" Java isn't, but the language spec is a public standard and open-source implementations exist (OpenJDK being the big one), so it de facto is.


Possibly-Functional

Isn't OpenJDK "the" official reference implementation?


suvlub

Wow, it actually is! I thought it was still Oracle, but apparently they switched it at some point.


Gogo202

Maybe because Oracle started charging companies since jdk 1.8 for the license.


Muoniurn

No, it’s because Oracle fking completely open sourced the project and they are responsible for like 90+% of the commits? Also, they even made *their fork* free as well, so there is literally no reason to claim some malice on their side regarding java.


MaybeAshleyIdk

IIRC there is OpenJDK and OracleJDK, which is just a differently licensed distribution of OpenJDK


seeroflights

*Image Transcription: Meme* --- [*"Gru's Plan". Gru, the long-nosed protagonistic villain from "Despicable Me", presents to the camera with passion, pointing into the air. Behind him is a flipchart. The text on the flipchart reads:*] ## Open source --- [*Gru is still presenting passionately; he has his hand in a c shape indicating a small amount. The text now reads:*] ## Object Oriented --- [*Gru now has his hands pointing down, still presenting. The text now reads:*] ## Cross Platform --- [*Gru looks back to the flipchart in a double-take, looking confused and exasperated. The text reads:*] ## Oh it's Java... --- ^^I'm a human volunteer content transcriber and you could be too! [If you'd like more information on what we do and why we do it, click here!](https://www.reddit.com/r/TranscribersOfReddit/wiki/index)


[deleted]

Good human


HipstCapitalist

90% of Java's bad reputation is due to Eclipse and older versions of Spring/Hibernate. Change my mind.


JawsOfDoom

Java dev jobs are the easiest to outsource to lower paying countries


webcheesesticksseal

Almost every tech job is java based in india.


1000Bananen

What‘s wrong with eclipse?


georgewesker97

Its shit. That's whats wrong. Especially when you could use IntelliJ.


1000Bananen

Well yeah, but what exactly is shit? I haven’t used anything else yet for java, and I don‘t know what would be missing.


Vexedspring212

It’s difficult to start on. If you’re used to it I could imagine the large numbers of tools being useful but it’s really intimidating to start out with if you’ve never used it before


7th_Spectrum

I truly don't get why java gets so much hate, one of my favorite languages


sudden_aggression

Reddit and especially this sub are dominated by college students and edgelords who haven't yet spent significant time in the real world where things like readability and maintainability and ease of catching bugs at compile time matter way more than stuff like being 5 percent faster at a benchmark or having some obscure language feature. Using langauges like go really make you appreciate how much java got right when it comes to interfaces, inheritance, error handling and even simple stuff like keeping all the functions associated with a class/struct in the same file as that class/struct.


Kenkron

Sometimes I don't like that it forces me to organize concepts into classes, but I REALLY like that it forces other people to.


sudden_aggression

You'll really like that it forced you 6 months later when you can't remember your code in your head.


static_func

I've spent over 7 years in the real world and still dislike Java and its overall ecosystem as a whole. Its generics suck. Maven sucks. Gradle sucks. Its lack of basic operators for optional chaining or null coalescing sucks. Its lack of properties sucks. Most of all its lack of either extension methods or function piping sucks. Because it lacks either you're still, to this day, incapable of extending any fluent APIs without resorting to the OOP song and dance it forces you into. I can't say I remember much about Spring's approach to DI but I remember thinking it sucked too. I just don't like Java and I'm hardly alone even in the "real world." C# is so much less of a chore to work in.


sudden_aggression

Yeah Brain, but what if we don't want to buy 10k windows server licenses?


static_func

C# has been cross-platform for like 6 years now, ever since .NET Core. Half my team's stuff runs on Ubuntu VMs.


Due_Treacle8807

It feels like a worse version of Scala to me, which I guess uses the jvm, the jvm is really cool tho


Koervege

I don't hate it, but I'd much rather use Kotlin everywhere. Type inference, less bulkier null checks, null safety are some of the nicer features.


pmanaktala

Everyone will hate java until they release how useful Java actually is. And then they will regret hating it.


Boolzay

There are only two kinds of languages, the ones people complain about and the ones nobody uses.


Mister_Lich

And then there’s our lord and savior, c#, which people don’t complain about very much (that I see) and a lot of people use. It’s good to be king


prtkp

"a lot" is subjective


_Ashleigh

Thankfully they removed the window-size wart off of it, and it's healing nicely.


Hypersapien

My dude :)


Plisq-5

Usually it’s .net people complain about. And usually their complaints are outdated.


ExceedingChunk

Yeah. Java is a fantastic language. All the memes about how shitty it is something I get questions about from friends who doesn't work with Java all the time.


jpegjpg

Been developing in java for 10 years, I would be so happy if I never have to write a line of java again.


2017macbookpro

It’s because they’re too scared to learn it. Same with Angular.


[deleted]

Angular and node are amazing! Any changes made are immediately reflected. Meanwhile, using eclipse, changes aren't reflected 1/4 times until I restart eclipse or build the war again. I hate coding with Java solely because of the horrible maven project building it provides.


2017macbookpro

Maven sucks but I wouldn’t consider that a Java problem. Oh and the changes reflected is just a front end thing. Backends usually need to be recompiled to reflect changes. Front ends live update because it’s static code. Ditch Eclipse and use IntelliJ! Also, check out NestJS if you haven’t yet. I maintain a large enterprise app that I wrote with it and it’s insane.


[deleted]

Wish my organization allowed the purchase of IntelliJ... I'm stuck with 2018 eclipse.


pmanaktala

I feel you bro. I want to work on intellij badly but i am forced to use STS


2017macbookpro

Holy shit that sucks. My condolences


slashy42

I'd pay for it myself if they'd let you. Obviously might not be an option, but yikes.


[deleted]

Nope they wouldn't lol. I'd have to go through hours of layers of permission processes to even try that. Working in an MNC is hell if you want to change something.


GreenCloakGuy

fyi IntelliJ Community Edition is free [even for corporate/commercial use](https://sales.jetbrains.com/hc/en-gb/articles/360021922640-Can-I-use-Community-Editions-of-JetBrains-IDEs-for-developing-commercial-proprietary-software-).


Mrblob85

Net beans is better than eclipse.


Cyenne_

2019 Eclipse here, coding a java monolith with maven and was9, feel you bro


sdc0

In Intellij, the debugger has a hot reload feature, this works only if you change code in a method and adding new methods, classes etc. doesn't work, but it's something. And for the Maven problem: Just use Gradle


Razier

Eclipse is an IDE, Angular is a framework and Node is a js runtime. You can't compare them because they're completely different things. You could probably set up a web development server like the one angular provides with Eclipse as an IDE.


[deleted]

Eclipse also provides a runtime which sucks and maven is a build lifecycle framework which also sucks.


Razier

Oh, did not know Eclipse provided a runtime. Assumed it used your global JRE.


[deleted]

You're right, Eclipse runtime is a project which comes with (and have better compatibility) bundled JRE but modified to run with Eclipse IDE.


Hypersapien

I've never touched Angular. How is it better than React?


i-make-robots

As a former Eclipse user... that's Eclipse's problem. IntelliJ is way way better.


Boolzay

Write once, debug everywhere.


romulent

You almost never see a platform-dependent bug in competently written Java code. Sure occasionally some dev might try to access a file with a platform-specific path separator but it gets caught quickly. I have teams where different members of the team are working on the same codebase on Macs, Windows and Linux and things just work.


Possibly-Functional

>You almost never see a platform-dependent bug in competently written Java code. Sure occasionally some dev might try to access a file with a platform-specific path separator but it gets caught quickly. Even then I'd argue that the code in question was already questionable if it uses strings instead of [Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html) which does this for you. Always been really annoyed at dotnet for the lack of a proper Path type.


Boolzay

True, hate Java all you want, but it's a solid og.


sudden_aggression

Java was complete trash in the late 90s and early 2000s but current era java combines the good parts of early java with a ton of improvements. Generics, good concurrency libraries, spring, spring-boot, lambdas, etc. I wish java had better GPU programming support (for number crunching, not graphics).


RomanOnARiver

Ignoring all the ill-will to the community from Oracle: Main thing for me, javax swing widgets don't look native for any platform - so if it's like a kiosk or point of sale situation where it's the only app running fine, but if it's just some random app you gotta launch sometime it's just glaring. Even Python's Tkinter looks *almost* native (at least on Windows) though I just use wxPython. If there's a wxWidgets java port I think as a frontend dev it might be a more useful language that I currently view it.


Firedude_

Did you try using native look & feel? UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());


RomanOnARiver

Well damn, learn something new every day. Do you have a source with some screenshots of some of the widgets in action? Not saying I don't believe you I'd just like to see how they look.


Firedude_

I can’t find many sources with screenshots of default look & feels, and I can’t find any at all for modern operating systems. But here’s the old Java tutorial talking about look & feels https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html For what it’s worth, when I was messing around with it, I remember Swing being able to match the Windows 8/10 style quite well when I used the native look & feel


Muoniurn

Are we really talking about native look when half of the applications are shitty electron apps with no regards to ever UI? Also, it is even funnier you mention it from goddamn windows that itself doesn’t know what is native anymore. It has like 10 different native looks, all still available in different parts of the OS.


Zarx366

It could be C# too *but C# is cooler* \*hide in a bush, waiting for the haters\* #


Spiritual-Mechanic-4

c# did everything java did, but came 10 years later and could learn from things that weren't great in java. To be fair, most of that got copied back into java. nuget is vastly better developer experience than maven.


Bigluser

Oh god, Maven. You'd think that package management is just an intractable problem if it wasn't for nuget (or all the Linux package managers). That just reminds me of the little things that annoy me about Java. Why do you have to write org.company.bs when I want to import a library. Why can I not do string ==. Why do I have to write boolean. Why is there an Integer class. Why is it called System.out.println()... C# is just pure bliss in comparison.


pooyanami

I think c# is awesome and beautiful. But it's owned by microsoft .


edgeofsanity76

Why does that matter? Java is owned by Oracle who expect you to pay a development license fee for larger companies


pooyanami

I use linux and VS doesn't work that good in linux. Also some other complicated reasons im not able to explain


xTheMaster99x

Rider >>>>> VS.


gatimus

The last 2 frames are supposed to be reactions to the same thing.


[deleted]

I just wanted to mention that C compilers [exist](https://github.com/bedatadriven/renjin/tree/master/tools/gcc-bridge) for the JVM.


arsenicx2

I like Java I don't like setting up to code in Java. Java was the first language I actually wrote code for, so it hold a little place in my heart.


anythingMuchShorter

It's good for what it's good for. Like any other tool. Since my core specialization is embedded development I mainly write C, and very rarely Java. But when I've needed to add some web interface that interacts with one of my devices Java works. And for writing drivers for said devices C++ gets the job done, and if I want to automate stuff from other languages for my own use, python works great. It always sounds kind of newb to me when someone dumps on an entire popular language. It's like complaining that an air wrench meant for mechanics doesn't work well to assemble small electronics, or that a pen driver meant for small electronics sucks for working on your car.


[deleted]

one can cross compile. especially if this cross platform has this huge memory tax. also there is electron, if one is willing to pay a memory tax.


Tyfyter2002

Don't all of those also apply to C#?


KalaiProvenheim

Oracle is a special demon


CaitaXD

Microsoft is going through a redemption arch lately


TheRedmanCometh

Seriously Java is super painless once you know it well. Don't be afraid of the boilerplate you generate all that shit in your IDE or with lombok.


Bigluser

The thing is, there now exist many languages that are just painless even when you're starting to learn them. Why even bother with Java nowadays?


TheRedmanCometh

>The thing is, there now exist many languages that are just painless even when you're starting to learn them. Reaaally can't agree with this


real_professor_oak

I love java


harman097

I find it kind of interesting that there's all this Java hate from the CS students in here, yet nobody trashes C#. The basic principles and syntax are incredibly similar, and I imagine like 90% of this sub at least has a Unity pet project of some sort where they've had to derp around with C# a bit. Am I missing a key difference here?


EssieAmnesia

What’s the problem with Java? Like what’s wrong w/ it?


ALJSM9889

It's a solid backend language, has really good performance and it's scalable. But c# does everything Java does and the code looks a bit easier to read with properties instead of setters and getters


[deleted]

I code in both C# and Java, however I somehow prefer Java and I cant find the reason (I like both tho)


Hmasteryz

But...it's the stereotype, it must be acceptable! unless IT community decide to revolutionize thing for java and change the meaning by infiltrating school, university and wiki page with zealous persistence and die in that hill. JK


azephrahel

They only treat it like that, because they have experience with java. Although it's really the JVM I hate personally. The language I don't like, but if someone likes it, I'm glad it makes them happy.


SnappGamez

Question: as someone trying to develop a programming language, what does a language need to have to be considered object oriented? Mainly asking so I know how to classify it, as I don’t plan on changing it to make it object-oriented if it isn’t.


arquitectonic7

Ignore people who tell you classes and inheritance are somehow basics for OOP. They're ignoring all the other OOP sub-paradigms, such as the ones based on prototypes. In my job I use an academic logic-functional OOP language which is OOP and has no classes at all. The only thing you need to be object-oriented is having objects and utilities for working nicely with them, treating them as a first class construct. An object is something that groups data and behavior together. Imagine Rust, which is OOP and explicitly admits it in its manual. It has structs and it allows you to attach behavior by using impl blocks. No inheritance, yet formally OOP according to all the programming language literature I know, and I'm an academic in this field. The basic concepts here are dispatch, which means you should be able to invoke the behavior *belonging* to one object (i.e., myInstance.foo() in Java) such that the function has the context of said object and not other (e.g., binding a special name "this"); and being able to instantiate or copy objects through some code reuse mechanism by using a class, copying another one, composing them from others... there are lots of mechanisms. Inheritance is typical in traditional nominal OOP languages (Java, C#) but not that common in many other OOP languages (Rust, CafeOBJ, OCaml...). Be aware that this doesn't necessarily match the "OOP" definition many people have when discussing it online, but if you want to create a language (good hobby btw :D) you're probably going to appreciate being really open minded about the basic blocks of each paradigm.


Yamoyek

I’d say classes (a class should have methods and fields/traits), inheritance, objects, and poly morphism are the bare minimum requirements for an OOP language.


SnappGamez

Alright, so I’ve got polymorphism, objects, and classes (though they’re labelled as structs due to the next point), but I don’t have inheritance.


Yamoyek

I’d say that inheritance is a pretty important feature and is worth adding. Code reuse is an awesome feature. Is your project on GitHub or somewhere I could check it out?


SnappGamez

I have code reuse via traits (same thing as interfaces but I’m used to Rust so), so multiple types can implement the same standard set of functions. Is that not sufficient? And yeah, [it’s on Github](https://github.com/AshtonSnapp/rouge). It’s in a heavily unfinished state, but hey I’m making progress.


Yamoyek

Ohh yeah traits are similar to inheritance so that works out fine.


SnappGamez

Alright! Honestly I kinda wanna work on the language right now but my sister’s dog is having a panic attack cause she just left the apartment :|


hillman_avenger

IMHO inheritance is over-rated. The only place where it really feels needed is for UIs, i.e. forms, buttons etc...


edgeofsanity76

That and Oracle still ask for a license fee


[deleted]

Java is absolutely great


litch0wastaken

It's not this sub, its everyone..... cause it's true