Attached: 1200px-Java_programming_language_logo.svg.png (1200x2195, 116K)
This is the most comfy language
Jack Rodriguez
Christian Watson
why not upgrade to kotlin? it runs on the jvm. Its literally a fucking upgrade
Levi Parker
They said the same thing about Scala.
Ethan Ward
oh... whats wrong with scala?
Christopher Robinson
its un-scala-ble.
Jordan Ward
somebody... please laugh at my joke...
Anthony Sanders
Problem with Scala is that it broke compatibility with Java to truly be a functional language, but it still has some warts of Java. Also, the definitions of simple shit like maps are all fucked up.
Hudson Robinson
please laugh...
Aaron Parker
its a meh joke because the original intention of the name scala was that it was scale-able
Jordan White
cont.
its the equivalent of borats "this is a suit.... not!" joke
Juan Wilson
Juan Campbell
whats wrong with maps? they work just like normal for me in kotlin/java. the only bitch is multithreaded & concurrency
David Harris
aw im sorry bro. im just in a shit mood cause work today sucked. dont mind me
Isaac Thompson
its okay user, i hope things get better for u! go you!
Andrew Roberts
Thanks, Pajeet. 5 rupis have been deposited in your account.
Sebastian Long
stop using java
Mason Butler
if java supported vars (implicit typing), native optionals and coroutines, I'd be down to use it.
funny story, most dev teams still use old ass outdated versions of java for some fucking reason. like 1.7 and 1.8. I think they're up to fucking 1.13 now
Ian Russell
Christopher Wilson
Why is Java still relevant?
It's basically banned from the web.
How does the future for Java look?
Jace Jones
rupees, you mouthbreathing amerimutt
Tyler Anderson
Camden Ramirez
>1100 students in one classroom as a perk
no thank you, come again
Ryan Peterson
>Why is Java still relevant?
struts, JAWS, Android. Basically all the ancient shit.
Kayden Thomas
>C#
*blocks your path*
Jordan Wilson
My Java teacher was a creep but the guy was a good programmer. Worked for Northrop or Lockheed or something like that and taught part-time.
Kevin Perry
So why would anyone learn Java nowadays if it's all about the ancient shit?
Ian Johnson
Oh, boy... Just wait until you get a job
Jason Bailey
When you never knew any better.
Jordan Cox
Scala was for chads, and it got near zero community size
so, now Kotlin is for retards. by retards.
Jace Brown
b-but, do you have a Twitter account, do you?
Benjamin Fisher
>Scala/Kotlin/Clojure
>building programming language on top of the programming language to solve the problem of the primary programming language
>implying something good
Ian Smith
Java has all of those things now
Blake Richardson
No oracle shill, dont mix bloated with comfy
Jordan Peterson
>It's basically banned from the web.
What are you talking about?
Hudson Robinson
On rust:
type Byte = u8;
fn print(bytes: &[Byte]) {
println!("{:02X?}", bytes);
}
fn sum_one_formatted(bytes: &[Byte]) -> String {
bytes.into_iter().map(|b| 0x1 + b).map(|b| format!("{:02X?} ", b)).collect()
}
fn main() {
let bytes: [Byte;2]= [0x22, 0xAF];
print(&bytes);
println!("{}", sum_one_formatted(&bytes));
}
On Java:
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
public class Byting {
static void print(byte[] byteArray) {
for (byte b: byteArray) {
System.out.print(String.format("%02X ", b)); //Lol print("%02X", byte) unavailable
}
System.out.println();
}
static String sumOneFormatted(byte[] byteArray) {
//var stream = Arrays.stream(byteArray); //LOL NOPE, stream(byte[]) unavailable
List bytes = new ArrayList(byteArray.length);
for (byte b: byteArray) {
bytes.add(Byte.valueOf(b));
}
var stream = bytes.stream();
return stream.map(b -> 0x1 + b).map(x -> String.format("%02X ", 0xFF &x)).reduce("", String::concat); // Lol need 0xFF hacks to avoid overflow
}
public static void main(String args[]) {
byte[] byteArray = new byte[] { (byte) 0x22, (byte) 0xAF };
print(byteArray);
System.out.println(sumOneFormatted(byteArray));
}
}
Nolan Ortiz
time ./byte
[22, AF]
23 B0
real 0m0,002s
user 0m0,002s
sys 0m0,000s
$ time java Byting
22 AF
23 B0
real 0m0,081s
user 0m0,096s
sys 0m0,013s
Java sooo comfy
Nicholas Perez
>map(|b| format!("{:02X?} ", b))
WTF is this bullshit?
it should be just a for-each of increment + print
idiots, idiots everywhere.
Elijah Gonzalez
You're missing the point. Did you even read the function names?
You can too map(print(x+1)) instead of map x+1 followed by map print.
Colton Morris
I actually have a job :D In it's Java related. I'm just trying to find some alternatives with my knowledge because this is boring as hell and as you said: ancient shit.
Oliver Gomez
>recViewFac = recyclerView.factory.createNewFactory(getApplicationContext(), MainActivity, findViewById(Resources.getID(R.id.recview));
>recView = recViewFac.createView(getApplicationContext(), findViewByID(Resources.getID(R.id.recview));
Oliver Sullivan
Java is fine. Most people get taught ancient versions of Java. Even in 2019 I still see people getting taught Java 1.6.
Elijah Thompson
/thread
William Peterson
.into_iter()
.collect()
Rust needs HKTs.
Nathaniel Hill
He means that websites no longer run Java code themself because (Javascript and) security issues.
Owen Peterson
John King
>not Typescript.
We will get them Soon™.
Nicholas Fisher
python is better than java
Jayden Williams
>Java is low level
Michael Price
Open a file and read from it.
Jayden Moore
byte[] bytes = Files.readAllBytes(Paths.get("myfile.txt));
Angel Evans
imports, motherfucker, do you write them?
Gavin Myers
low IQ level
fify
Aiden Ortiz
>not letting his editor/IDE auto imports for him
Grandpa...
Kayden Murphy
My IDE takes care of imports whenever I save
Dylan Phillips
>nio
The JCL is such a massive farce. I watched the devs replace packages with newer ones and keeping the old ones as decorations far too many times and yet you still need to get an httpclient and tuples from Apache and Google's asses and then get BTFO by the amount of times the package has changed since all resources online have been made.
Isaiah Roberts
java is awful.
Benjamin Williams
laffed
Connor Flores
HttpClient was introduced in Java 9
James Perez
How come?
Joseph Martinez
ITT: people who think java is still in version 5
Parker Howard
>Java post 8
I am not paying Oracle to get a lawsuit later on.
Jayden Ward
>what is OpenJDK
Aiden Martinez
based
>kotlin
bloat
Bentley Wood
kek
the money tho
John Thomas
>bloat
based
Hudson Brown
>based
based
Adrian Thompson
at the mercy of Larry Ellison
Michael Johnson
No legacy support, I couldn't even build some obscure tool I found on github, had to manually download the entire runtime library from Oracles website, which defeats the purpose of muh multi-platform.
Nolan Morales
Be specific.
>no legacy support
What the fuck are you even talking about?
You can create bundles JRE's for your application.
Bentley Diaz
Have you seen java programmers?
Look at what it does to them.
Hudson Nelson
Java is indeed an atrocious language, well demonstrated dear rustfag
Connor Harris
this it makes them awfully rich and they usually end up dying from too much coke and hookers cruising around the world.
Ethan Edwards
I don't see how these are specific to HKTs, wouldn't type classes be the proper term?
Ryan Butler
>sudo apt install openjdk
>it's for fucking java 12
>the repo was written in some older version
>some functions were deprecated
>built it
>not working
I write C++ for a living and runtime libs are cancer, but at least glibc is consistent with its legacy and doesn't change on a whim of a company or a few individuals.
Dominic Ross
wtf have you done? are you literally retarded? Someone who doesn't have autism needs to tell me if this is a troll or not.
Charles Sanders
Java 11 introduced implicit typing.
Java is a new language now, it becoming comfy and comfy after each update.
Aaron Gomez
That is literally impossible unless you are dealing with some of the very few libs that have been removed due to jigsaw.
Dominic Green
I think you are confusing java with javascript.
Adam Sanchez
If you have HKTs you can use fmap rather than map which eliminates the need for both of those functions.
Mason Mitchell
I'm just saying, isn't that thanks to generics (the type classes variety of generics, more specifically) and not HKTs per se? People always talk about HKTs, but the term HKT actually refers to the really niche syntax Haskell has for representing types of things.
Jaxon Richardson
If one were to learn proper java and wanted to avoid the pajeet Mr NagoorBabu way, what's the best resource? I already know the basics of programming such as conditionals, loops, etc.
Jose Ross
>literally impossible
My anecdotal experience says otherwise. If I remember right it's something to do with some Application class.
I'm not a Java expert but if a runtime library deprecates something by completely removing it from future versions then it's a shit one.
Zachary Gomez
>I'm just saying, isn't that thanks to generics (the type classes variety of generics, more specifically) and not HKTs per se?
No, it's definitely HKTs that allows you to abstract a function over a variety of different container types that are themselves generic.
>People always talk about HKTs, but the term HKT actually refers to the really niche syntax Haskell has for representing types of things.
HKTs means type constructors can be used as type parameters. It's not specific to Haskell - you have a form of it in C++ with template template parameters.
Christopher Bell
Not with all the fucking boilerplate you have to write
Jordan Allen
>No, it's definitely HKTs that allows you to abstract a function over a variety of different container types that are themselves generic.
You could do that with an ad hoc generics syntax too though (Java already has generics, combine that with interfaces and it probably could do anything Haskell can do), I think it's type classes that actually allows the generics in Haskell and templates in C++, and HKTs are just a nice language for describing that.
Connor Lee
Also to* your account
Brandon Morgan
You'd have to write a different map for every container if you just plan to use ad hoc generics (by which I presume you mean overloading?).
With first order generics then Rust traits, Java interfaces and Haskell type classes are pretty much equivalent to each other.
It's quite simple. Without HKTs you have to erase a Container of Foo to an Iterator of Foo using into_iterator, and then to get back to a Container of Foo you need to use collect. With HKTs you can just make Container a parameter of the map function too.
Logan Baker
>It's quite simple. Without HKTs you have to erase a Container of Foo to an Iterator of Foo using into_iterator, and then to get back to a Container of Foo you need to use collect. With HKTs you can just make Container a parameter of the map function too.
I think this was the point I was trying to make too - if you have HKTs you have a flexible syntax for describing this, but even without it you can perform the same stuff for example using Java's interface / subtyping mechanism and type casting afterwards. The casting operation just isn't type checked because the language's type syntax wasn't expressive enough to handle a map function returning a variable type value.
Julian Parker
Java has had that for ages with Lombok already.
Tyler Garcia
Java is a programming language targeting the JVM.
Scala is a programming language targeting the JVM.
Kotlin is a programming language targeting the JVM.
Clojure is a programming language targeting the JVM.
Eli James
The whole point of generics is that you don't need a cast. It tracks types in and out of a function directly. Casts are essentially what into_iter and collect are.
Isaiah Russell
The JVM is built around the semantics of Java, and the other languages which target the JVM are limited by those semantics.
Julian King
Another point I was making, I wouldn't be so sure about that. Modern Java might be able to express type variables combined with interfaces, pretty much letting you imitate any feature HKTs might epxress
This should be a valid Java function signature:
T max(T e1, T e2) {
Matthew Rodriguez
That's not HKTs though? HKTs would be writing something like this.
static C map(C in, Function f);
Unless the higher kinded type can be used as a parameter you can't express the full range of genericity directly in the function signature (and thus avoid casts).
Jaxon Taylor
Yeah. It was just showcasing how it's indeed possible to do pretty much the same things without HKTs, even Java can do most of it with their ad hoc system I think (generic containers like the map function you posted, too, I just don't know enough Java to type it out). HKTs are just a nice and consistent language for describing the same thing. What actually matters most is traits / type classes / templates, and you should be able to have those with or without HKTs.
Levi Foster
I could send you a pallet of toilet paper instead
Carson Gray
Or maybe I'm full of shit and the moment your type system can express container types as variables it _has_ HKTs, even if it otherwise doesn't have a notion of functions of types.
Not sure if this is valid Java:
T returnUnchanged(T ts) {
Daniel Martin
Well no, this isn't possible in Java because Java doesn't have HKT. The best you can do is - well something like this instead.
static Stream map(Stream in, Function f);
Which is comparable to the map method in Rust. In fact Java's Stream interface is very similar to Iterators in Rust - and they're bogged down by the same problem of having to use a .stream()/.into_iter() method to erase the container type and then a .collect() method to get it back.
The fact that you can do much the same thing with Java interfaces as you can with Rust traits is what I was expressing here , whether you have traits or interfaces or type classes doesn't matter. What matters is what kinds of type you can abstract over.
Carter Reyes
Alright, seems like you know your stuff better than me so I'll take you word for it.
Benjamin Morgan
Maven is the most mature build tool/package manager out there.
Building api's/webstack using spring boot with mapstruct and lombok is probably the most comfy and solid option there is.