[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1673170420721970.png (45 KB, 4000x2500)
45 KB
45 KB PNG
In Java 21 you'll be able to:

void main() {
System.out.println("Faggot");
}

and
java Main.java


How will the "HeLlO WoRlD is So VerRboSe" fags cope?
>>
>>93660182
Is this just them getting rid of top level statements like in C# 9?
>>
What if I want to make an instance method called main that takes no arguments and returns nothing?
>>
>>93660182
honestly whats the purpose of this? who the fuck uses java as a scripting language? Im not complaining but can anyone tell me what this is supposed to solve?
>>
>>93660492
Competing with M$ for superfluous features...solutionism basically.
>>
>>93660182
>Java 21
java8 is all you need
>>
>>93660402
Yea
>>93660492
Probably making it easier for brainlets to get into Java.
>>
>>93660682
>java8 is all you need
>he doesn't want virtual threads and pattern matching
>>
>>93660182
Meanwhile every other language doesn't require writing out "System.out.println" every time you want to write something to the console, and even more obtuse stuff if you want to include some variable values in your string.
>>
>>93660492
>who the fuck uses java as a scripting language?
those youtube people who sell quick java courses
>>
>>93660718
>Meanwhile every other language doesn't require writing out "System.out.println"
They're changing that as well
>>
>>93660492
no one does. only extreme idiots that can't use bash for some reason because they're ultra autistic
>>
>>93660730
Good. It's about fucking time.
>>
>>93660182
I don't want a main function I want to write statements right at top level

And this System.out crap should not be necessary
>>
>>93661668
>I don't want a main function I want to write statements right at top level
retard
>>
>>93660182
>System.out.println
What will this be replaced by?
>>
>>93661854
println
>>
>>93661668
use python retard
>>
>>93661884
it only took 30 years or so to get rid of obviously retarded shit
>>
>>93661784
no u
With Ruby, I can iterate over lines from stdin, process them, and automatically print the result to stdout like this

ruby -ne '$_.upcase!' < file.txt


Imagine doing this with present-day Java
>>
That's still really fucking long desu, it's not a big deal but it's hardly a win worth bragging about. You're what, 2 decades late?
>>
>>93660718
>Meanwhile every other language doesn't require writing out "System.out.println" every time you want to write something to the console
If your text editor can't be configured to autocomplete 'System.out.println' when you start typing 'print' in 1995+28, you should just give up on programming and convert to an IT while people still think you're competent.
>and even more obtuse stuff if you want to include some variable values in your string
If you think printf is obtuse in 1970+53, see above.
>>
>>93660730
c has had this for how long?
>>
>>93660718
>>93661668
>>93661854
import static java.lang.System.out;

void main() {
out.println("Faggots");
}
>>
>>93661919
>Imagine doing this with present-day Java
But why? I literally don't need that.
>>
>>93662065
*convert to IT
also
>>93661668
>>
>>93662072
C is shit. Imagine creating a lot of shit functions like
type_init
type_operation
type_free
instead of just calling
type.operation
>>
>>93662077
no it will be

void main() {
println("faggots");
}
>>
>>93662123
>>93662077
Sauces?
>>
>>93662161
The >>93662077 one works since Java added static imports. I don't even know when they did it, but probably was before 2005.
>>
>>93661912
you could just static import system.out

That was always an option.
https://docs.oracle.com/javase/8/docs/technotes/guides/language/static-import.html
>>
>>93662161
https://youtu.be/P9JPUbG5npI?t=301
>>
>>93660706
>he doesn't want virtual threads and pattern matching
Yes.
>>
>>93660182
By having sex with biological women in a house they own.
>>
>>93662393
Why would someone have sex in the house of a biological woman?
>>
Java fags were never gonna switch to sepples, but I guess due to Kotlin and Rust they are finally having to get their act together.
>>
>>93660182
I fucking hate this shit, hated it in C# as well
Why make it less explicit?
>>
isn't java just for mine craft modders and freshman cs students who go to bad schools?
>>
>>93662877
>isn't java just for mine craft modders
yeah
>and freshman cs students who go to bad schools?
That's haskell
>>
>>93662877
>isn't java just for mine craft modders and freshman cs students who go to bad schools?
Nigger are you retarded? Almost every large platform uses Java somewhere, if not completely somewhere in its backends.
>>
>>93660492
Whats a scripting language?
>>
>>93660697
>Probably making it easier for brainlets to get into Java
it's exactly this. it's adding more superfluous features nobody will actually use to the language simply to make it easier to teach retards how to get their first and only hello world, before they breakdown when they still have to learn everything else.
>>
>>93662877
>freshman cs students who go to bad schools?
That's all schools.
>>
>>93660492
Who said anything about using java as a scripting language? You fucking gjgger.
>>
>>93660182
>main
You realize “main” is just an interface to the C runtime that everything has to copy, right?
>>
>>93660467
what if you want to make a static method called main that takes an array of strings and returns nothing?
>>
File: dwightHasQuestions.gif (1.75 MB, 498x448)
1.75 MB
1.75 MB GIF
>>93660182
Question. I haven't gone too deep into Java, but the more I dick around with it the less I like OOP. Is there ever a point where you guys like it?
>>
>>93663795
what do you think a scripting language is, if not the antithesis of verbosity to drive greater structured programs? yeeting away namespaces, obligatory function arguments, type decls are all pretty good indicators of a scripting language. java is only good for le meme of oop, specifically spending months writing objects and methods encapsulating members, just to drive some established framework (if not something in-house).
>>
>>93663950
what are you talking about nucodelet?
>>
It literally did not matter. The main needed to be public and static and showed perfectly the keywords one comes by with java.

Stay away from java if you are not willing to learn, noobs
>>
>>93660182
Serious question, does anyone still use this besides Jeets and legacy maintainers?
>>
>>93660182
>How will the "HeLlO WoRlD is So VerRboSe" fags cope?
By picking one of the 87,000 things that are actually wrong with Java.
>>
>>93660182
I stopped caring about the verbosity long before it stopped being so verbose.
What I care about is startup time. Since everyone and his dog uses Spring, it takes forever for a CRUD Hello world to launch.
Until this is fixed, I can't be assed to touch Java again.
>>
>>93660492
>who the fuck uses java as a scripting language?
*JavaScript joke*
>>
>>93660182
it's funny to see once again java just copying whatever c# does
>>
>>93660718
>every time you want to write something to the console
Doesn't happen often outside toy programs, and if you really are doing command line intensive program just alias it like

void print(String arg) {
System.out.println(arg);
}
>>
>>93669073
The only thing really and unfixably wrong with Java is the default visibility. It should have been public, not package. Only restrictions to visibility should be explicit.
>>
>>93669089
>it takes forever for a CRUD Hello world to launch
Uhh nope...
>Started SpringHelloApplication in 1.763 seconds
This with dependencies of
'org.springframework.boot:spring-boot-starter-data-jpa'
'org.springframework.boot:spring-boot-starter-web'
'org.springframework.boot:spring-boot-devtools'
'org.postgresql:postgresql'
...and proper entity, repository and controller classes and configured database connection
>>
>>93660735
>bash
You mean python
>>
>>93662490
This
>>
>>93660182
>making the language inconsistent to make it easier to learn
They didn't think this through.
>>
>>93669293
>it's funny to see once again java just copying whatever c# does
The absolute state of C# fags. Scala had this long before your shit lang had it. Java mostly copies from Scala, not your shitty garbage lang.
>>
>>93670678
>Scala
https://medium.com/@yifanxing/my-experience-with-sexual-harassment-in-the-scala-community-9245b4a139de
>>
File: 1655174014758385.png (260 KB, 1342x653)
260 KB
260 KB PNG
>>93670736
>C#
>>
>>93669419
You made me check.
Okay, Spring Boot folks managed to turn their trainwreck of sluggish component scanning into something that works decently fast. My nodejs apps still have a shorter startup times, but at least I can be assed to try Spring Boot again.
>>
>>93670761
>Okay, Spring Boot folks managed to turn their trainwreck of sluggish component scanning into something that works decently fast. My nodejs apps still have a shorter startup times, but at least I can be assed to try Spring Boot again.
Spring Boot fully supports native images now https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.introducing-graalvm-native-images
>>
File: 1502517919906.gif (1.5 MB, 250x233)
1.5 MB
1.5 MB GIF
>>93660182
Console.WriteLine("Nigger");
>>
[GO]
>>
>>93670761
>Spring Boot
Old shit. Use Quarkus.
>>
>>93665782
I like OOP because of design patterns. It is unironically fun to figure out how to make things fit together in elegant and reusable ways.
>>
>>93660182
you could run single file programs without compiling since 17 or earlier
>>
>>93660182
>conceding to angry script kiddies
gay
>>
>>93669532
you use python for scripting? are you some kind of fucking idiot?
>>
>>93665782
quote from the dearly departed joe armstrong:

Because the problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.
>>
>>93660492
For easier tutorials
>>
Reminder that Based Basic lets you do

? "Hello World"

Where ? is short for print.
>>
>>93660182
That's fucking stupid. You don't bend over to students of all things. This saves like 4 lines of code that are usually automated by IDEs. Now linters will have to be updated with this retardation.

Shit change
>>
>>93663719
any simple language for writing up quick programs. Typically ones without a bunch of imports and headers. Basically bash and python.
>>
>>93660182
java is not a shitty scripting language
>>
>>93672579
it doesn't matter when you are writting something that does actually something instead of printing a text in the standard output
>>
>>93662490
as fagjava, recently learned c++, just a few days adapt to it and i can do my own programming.the only thing that is confusing is the use of pointers
>>
>>93660697
>Probably making it easier for brainlets to get into Java.
And really misses the point about why Java is not a good beginner language.
Hiding Java's convoluted boilerplate just for the "Hello World" special case doesn't actually solve the problem.
And if you don't understand the problem, you are more stupid than the "brainlets" you're trying to criticize.
>>
>>93665782
OOP is not for "dicking around"
It shines the brightest when you have a big problem to solve and you're patient enough to work out a good design for a solution, rather than a quick base implementation with a hundred patches applied
>>
>>93665784
No reason not to have both, but I guess autists hate change.
>>
>>93675101
>It shines the brightest when you have a big problem to solve and you're patient enough to work out a good design for a solution
If you haven't at least considered and weight the tradeoffs of a non-OOP approach, though, your design is most certainly total garbage.
>>
>>93675259
OOP is the only paradigm that can have any practical solution designs for beyond trivial problems
pure procedural _needs_ to split everything into smaller individual problems, otherwise it crumbles under complexity
functional can't do big problems at all

you can't prove me wrong without shitposting or moving goalposts
>>
>>93675496
>pure procedural
It's clear: you don't actually have any experience designing big solutions and are just talking out of your ass or parroting memes after having spent a few years as a Java wagie on some Enterprise Software Abomination.
>>
>ad hominem
not an argument
>>
>>93669296
Most people use it for debugging. You can't tell me otherwise because practically every large Java program spams lots of messages if run from a console.
>>
>>93660492
Six figure FAANG SWE (top 0.01% of devs btw) here. I would. I needed to write a little data munging script yesterday and I literally looked up whether it's possible to run interpreted Java yet before resigning to writing it in Python which almost made me throw up.

Java is a beautiful language with dogshit DX.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.