[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

java retards will defend this

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 71
Thread images: 6

File: le mit bird.png (21KB, 335x185px) Image search: [Google]
le mit bird.png
21KB, 335x185px
> hurr OOP is so intuitive

java.lang.Object
java.lang.Number
java.lang.Integer

public final class Integer
extends Number
implements Comparable<Integer>



https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html
>>
>>58900252
Math illiterate.
>>
OOP is just a tool, but when it's forced across the whole language then you end up with utter crap like Java.
>>
>>58900252
brainlet
>>
>>58900340
Java isn't pure OOP. It's mostly procedural really.
>>
File: kill urself u fool.jpg (22KB, 400x400px) Image search: [Google]
kill urself u fool.jpg
22KB, 400x400px
>>58900467

> b-b--b-but OOP works it's just never been tried
>>
explain to me how this isn't intuitive
are you mixed up somewhere about how integers are numbers?
>>
>>58900252
learn some math retard
>>
>>58900572

An int should not be an object.

Wrapping an int in a class is pretty much the definition of retardation.
>>
>>58900252
C++ and OOP enthusiast reporting in!

About your dumb little example, the idea of primitive types was a mistake in the design of java. If they really wanted to go for the "pure oop lang" then even built in types should have been objects but now they're forced into creating dumb ass wrapper classes to make the language more usable. This is not the fault of oop but simply the best fix using it which, mind you, is still quite elegant.
>>
>>58900639
>>58900299
>>58900355

> how does a CPU work
>>
>>58900704

Maybe this would be acceptable in a scripting language like Python

But for java which is supposed to be a c++ alternative this is an outrage
>>
>>58900720
Instead let's have operator overloading everywhere and have no idea what the code is actually doing.
>>
>>58900252
it just werks
>>
>>58900720
>supposed to be a c++ alternative
Not true. No competent dev. would suggest using java for anything but web software or library/software prototyping. things that c++ is not good for.

Your right that the idea of all objects might feel a little scripty, but it's an entirely doable abstraction even for a system programming language.
>>
Instead let's have lists of methods on every line and have no idea what the code is actually doing.
>>
>>58900771

Or not
>>
>>58900556
>>58900340
Look at C#, a fully OOP language that actually works incredibly well.
>>
>>58900252
works for me
>>
>>58900968
Why is C# a fully OOP language and not java?
>>
>>58900709
well define the architecture dipshit.
it would still be irrelevant since Java code is compiled to "native" architecture instructions anyhow so i have no clue what you're even getting at.
>>
holyc > java
>>
>>58900998
Technically Java is compiled to JVM bytecode, which is well-defined and doesn't depend on the underlying native architecture. But I agree that the guy you replied to is a moron.
>>
>>58900901
I want to use Java for GUI programming in Android. Renderscript and connected through JNI (NDK) C, C++ for heavy computations in Android.
>>
>>58901154
no shit.

and what do you think bytecode is compiled to?
Java is a JIT language.

also you forgot that as of Java 8, certain platforms will have an AOT compiler as well.
>>
>>58900556
Are you unironically saying Java is pure OOP? If you are, then you are either an obvious troll, or a nescient idiot.

Java is full of static methods, deep inheritance, constants, annotations, etc.

Read a book once in your life.
>>
daily reminder every value is stored on the heap in java
>>
>>58901338
>missing the point this hard

The Java bytecode format defines several integer types, cf. https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.3.1
Whether you're running it on Hotspot or Dalvik or your shitty homebrew JVM is irrelevant.
>>
>>58901430
but malloc is too hard
>>
>>58901430
what about the call stack?
>>
>>58901450
the fuck point are you making?

that you're stupid?

this doesn't change the fact, barring JIT lag, java bytecode is compiled to platform specific instructions on any relevant JVM implementation.
>>
>>58901338
java neggro. JIT SHIT AOT BUGGOT FAGGOT, you fucking brainwashed imbecile, you just accepted that you're worse than a fucking monkey.
>>
>>58901518
lol, are you mad that Java has virtually equivalent performance to sepples?
>>
>>58900985
Values stored on stack
C# also has value types and reference types, unlike Java where everything is a reference type
>>
>>58901515
This entire fucking thread is about integers, you mong.
>>
>>58901389

those are fine in OOP
>>
>>58900998

literally any architecture
>>
File: 1465174650278.jpg (171KB, 1280x1024px) Image search: [Google]
1465174650278.jpg
171KB, 1280x1024px
>>58901530
>everything is a reference type
le what???
>>
>>58900252
The real tragedy is that Number doesn't specify any numerical methods. All numbers add and subtract, multiply and divide, no?

I guess it becomes an issue when the concrete types are different. That's why Haskell wins in this regard.
>>
>>58901430

what
>>
>>58901532
>witnessed
>>
>>58900684
then use int instead of the boxed Object type?
>>
>>58900684
>An int should not be an object.
int isn't an object, it's a primitive variable type.
>>
>>58903161

Explain the OP then
>>
>>58903717
it's a wrapper class to work with the tacked on generics functionality.

it's just bad design, but it works ok and as a plus, Integer comes with a bunch of helper static methods.
>>
>>58901679
The actual logic would be different depending on what type of number it is. I'm not a Java programmer, but in C++ they would declare such methods as "pure virtual" meaning that it has to be implemented by the class inheriting from it.
>>
>>58901530
reference or value types does not define if something is oop or not you are just retarded
>>
>>58901536
No they're not. Don't be retarded.

They go completely against SOLID and GRASP.

https://nikic.github.io/2011/12/27/Dont-be-STUPID-GRASP-SOLID.html

You should shut up and not talk about what you don't understand anymore!
>>
>>58904867

you do not have a SOLID GRASP on what the fuck you're talking about
>>
>>58904957
You just proved yourself wrong, retard. I said Java was not pure OOP, and your pic states exactly that.

Am I being trolled? I'm being trolled, right? Hah, you really had me there!
>>
>>58900467
>isn't pure OOP
Java is completely based around object orientation. I agree that there are different and also better ways of creating an object oriented language but Java is still inherently object oriented.

Every java program has to have at least 1 class containing a static main method.
There are no actual functions. literally every "function" is a method on an object or a static method on a class.
Actually every little piece of java code has to be inside a class.
>>
>>58900252
Daily reminder that all languages are built on C and are therefore not truly object oriented.
>>
>>58905231
Class-driven isn't object oriented, retard.

Just because you're forced to put stuff in classes ain't mean shit.

You can still make 100% procedural code in Java.

Not to mention, classes are not part of the OOP definition. The best OOP languages don't even have classes.
>>
>>58905231
What's the problem with it having to be in a class? In python, you'll have to put it in some file. You'll have to import it and then call the function it all the same.
>>
File: CANTWAKEUP.png (117KB, 290x290px) Image search: [Google]
CANTWAKEUP.png
117KB, 290x290px
>>58905249
>all languages are built on C
>>
>>58900252
There's nothing wrong with this.
>>
>>58905249
Not all languages are built on C.

And some languages are truly object oriented. For instance, Smalltalk.

https://en.wikipedia.org/wiki/Smalltalk
>>
>>58905249
brilliant logic
>>
>>58905266
As I said, there are better ways to design an object oriented language than the Java approach.
There isn't one true way to do object orientation. Java does it with classes. I agree that this is a bad approach because it makes you focus on classes instead of the actual objects. But I'd still call it an object oriented language.

Yes, you can write procedural code in Java, but it clearly favors object oriented programming.

>>58905280
Nothing is really wrong with it. It just shows that classes are an essential part of Java.
Java uses a class-based object orientation approach which is integrated so deeply into the language that everything you write has to be a class.
>>
>>58905449
Yes, that's true. But what's the problem with it? More boilerplate code?
>>
File: smug sucy64565.png (180KB, 847x744px) Image search: [Google]
smug sucy64565.png
180KB, 847x744px
>>58900252
I literally just turned down a job offer because the company was using Java instead of rails or even Javascript as a backend.
>mfw I found out
>>
>>58905713
>ruby on rails
Wow. What the fuck. The most low tier of languages.

Javascript however, is absolutely horrid to work with. It's a cancer. But it's a cancer that for some reason, hipsters and young people have latched onto, and created an abhorrent ecosystem to work with.

The reason the web isn't flooded with awesome single page apps, is because of the load of bullshit you have to cope with in the javascript world.
>>
>>58905713
>I literally just turned down a job offer because the company was using a real language instead of things that shouldn't ever be used as backend as a backend.
>>
>>58901530
>everything is a reference type

Rookie mistake. Everything in Java is a value type. With objects, the passed value is a pointer const.
>>
>>58905853
>pointer values are not a form of reference
Am I being memed or are you that much of a moron?
>>
>>58903717
That's an Integer.
It's not the same as an int.
>>
>>58900252
If you have trouble grasping the basics of inheritance, then maybe you're the problem.
>>
>>58906066

Yes it is you ninny
>>
>>58906126
People who don't know Java should fuck right off. An Integer is an immutable wrapper class around the primitive int type. In cases where the usage can be interchangeable, auto-boxing and auto-unboxing is done by the JVM.
>>
India is the greatest country in the world
>>
>>58906185

wrapping an integer type in a class is like wrapping your penis in barbed wire
Thread posts: 71
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.