[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Object Oriented Programming
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 149
Thread images: 6
File: Java_ai.png (12 KB, 550x550) Image search: [Google]
Java_ai.png
12 KB, 550x550
Why does /g/ hate OOP so much? It's all I've ever known. My first language is Java and I use OOP when I write anything else. My professors said it's good coding practice and my textbooks say it helps portability and maintainability, so why should I listen to you neckbeards who hate OOP?
>>
Because on 4chan it's hip to be contrarian and anti-social. OOP works too well and makes too much sense for them.
>>
>>54059329
This. Only time you should rule out OO is in languages with fucked up OO (ES5)
>>
because OOP is actually what's being used in the info tech field, wheras non-oop is used for useless degrees like comp sci.

Therefore, /g/ is butthurt
>>
OOP isn't bad, but using it strictly is not always necessary and can be tedious for no benefit.
>>
>>54059371
How is CS useless when programming jobs often ask for it?
>>
>>54058513
I don't hate oop i hate java
know the differenceâ„¢
>>
OOP isn't bad. Java isn't all that bad either. Eclipse and Netbeans are bad. Their badness makes most of the Java we all have to read through badly written import clusterfucks with verbose and misused syntax.
>>
>>54059411
Most people can write and get things done in Java without too much thinking and it offers great performance too. I can't see why you hate Java.
>>
>>54058513
Given that most of the properties of OOP are general properties that apply to almost any paradigm (abstraction, code reuse, etc) and the fact that OOP languages tend to take more and more features that were originally considered exotic (i.e. lambdas), the closest thing to a definition for OOP these days is

>the coupling of functionality and data

As for hate, I think it's mostly tangential things that tend to be common in OOP languages like Java (i.e. lack of sum types, null exceptions, explicit type decelerations, inheritance, etc).

To summarize: most of what OOP stands for isn't OOP-specific and old crufty languages that lack useful features from the last two decades brings it down.
>>
I've been thinking of learning how to make Android apps, obviously using Java. Is Eclipse a good IDE to accomplish this? Why or why not? If not, what would you recommend?
>>
>>54059627
You can use Eclipse with a special Android plugin, but I would recommend Android Studio. It has everything you need to make Android apps.
>>
>>54059661
I'll check that out. Does it have an Android emulator for testing as well?
>>
>>54059676
It's made by Google. It has every Android device emulator.
>>
>>54059709
Emulators are terribly slow though
>>
>>54059676
Yes it does
>>
>>54059716
So what? It's just for testing your code before you put it on a device. They're also no that bad if you have lots of RAM and a good processor.
>>
>>54059709
>>54059719
Alright, figured I may as well ask, just in case.

>>54059716
But at least it's better than having to push to my phone to test every change
>>
>>54058513
OOP is good for user interfaces. Everything embedded should really be 'C'.
>>
>>54059731
>>54059737
I use BlueStacks usually
>>
>>54059755
I've never heard of that
>>
>>54058513
OOP has its uses, but it's a bit over-emphasized in the mainstream world as the solution to everything, and the mentality at my school at least is that using OOP to faciliate code re-use is 100% a good thing, when actually it's sometimes easier to just start from scratch. And with Java in particular, the fact that the MAIN PROGRAM is defined as a class seems a bit silly.

>>54059456
>over one second to run Hello World
>great performance
>>
Because the real good stuff its made with C, Java is for simple boring applications and when used to anything more complex very unefficient and slow.
>>
>>54059819
>Anything that isnt a desktop app made in Java (like Minecraft)
>great performance and efficiency

pick one
>>
>>54059819
>>over one second to run Hello World
And there you just proved how ignorant you are about programming. It may take half a second for the JVM to start up but anything after that will take less than a millisecond. In fact, the more often a method is ran the faster it becomes because the JVM learns how it's utilizied and then compiles it directly to ultra optimized machine code. Consider yourself schooled.
>>
>>54059819
pleb detected
>>
/g/ doesn't hate OOP.
>>
>>54059913
*Inefficient
>Implying you write anything complex
Do yourself a favor and shut the fuck up
>>
>>54059969
>In fact, the more often a method is ran the faster it becomes because the JVM learns how it's utilizied and then compiles it directly to ultra optimized machine code. Consider yourself schooled.

hahahahhaha no
>>
"OOP has it's uses"
"Some problems are better suited for OOP"
I want to hear some examples of the above.
Frankly, I see some value in attaching functions directly to objects ("methods") but other than that, FP has much better answers than any of OOP.
>>
>>54059731
It's much faster to use real hardware for testing.
>>
>>54062441
No one owns every kind of cellphone with every kind of Android unless they are some huge enterprise.
>>
>>54059913
Minecraft was originally coded in Java.
>>
>>54062469
Confirmed for never having written and published Android apps before.
>>
>>54062492
I've written them, but I haven't published them.

How would I test for Android 6.0 if I only have a phone that runs 4.0?
>>
>>54062396
OOP is an intuitive way of implementing games and simulations where it's logical to think of objects doing things, rather than just having things done to them. Though it could be just as easily be implemented with functions located externally, it's just somewhat less intuitive.
>>
>>54058513
Actually the things people hate are:
>strict OO a la Java
>Java
>design patterns that you need to use to get around strict OO shortcomings for functionality that should be common
Luckily, new C++ and Java specs are leaning more towards adding functional functionality, but it is still a pain to work with strict OO and Java in a professional environment, ESPECIALLY if you've used other languages in your free time that has this helpful functionality
>>
>>54062470
>implying that minecraft bloated piece of shit is something good.
Please shut the fuck up and die from aids slowly
>>
I still don't understand the difference between objects and just fucking with structures in functions.

I mean I understand the conceptual difference, in that one is doing an action and one is being acted upon, but at the end of the day the same goal is done so I don't get the big fucking deal. Maybe it only makes sense in a large corporate project that involves lots of charts and pictures to describe program flow, I don't know.
>>
>>54059358
Are you implying that ES6 or even ES7 has food oop? The class keyword is a fucking debacle
>>
>>54062470
Minecraft was also well known for having clusterfucked code. Video game development is known to require strong functional language capabilities, be it in graphics programming through programmable pipelines, to the most common design patterns like implementing command in a simple manner. C is the standard because it at least lets you pass functions around.

iirc wasn't minecraft rewritten in C++ by more competent devs who wanted to expand it?
>>
>>54062851
Lambda Calculus and Turing Machines can both do literally any computable task. Doesn't mean they're the same.
>>
You Anons are a bunch of fucking idiots. Depending on what programming languages you use can and will make an application run slow. It depends on how fast, show or efficient your computer really is. For instance, I have $2g PC upgraded and ready. But it's not that fast enough nor have the graphics card to pull such Quality and put hyper threads into the code. Code varys within the computer build up. Not code build up in itself. Sometimes itself if you overstring it.
>>
>>54062922
>varys
opinion discarded
>>
>>54062922
Is this the birth of an epic new meme?
>>
>>54062922
This is too pajeet to be real
in case it is though, you can still make optimizations in code, and the difference between running times can make something run thousands of times faster or slower depending on amount of data processed
>>
>>54062831
It's good enough to see widespread use. The primary criteria of software quality is what customers think of it.
>>
>>54062958
Java was rewritten in C++ for consoles and pi. It's only in Java on desktop because it stuck and people have made mods for it already. Even Notch can tell Java was a mistake, it's just what he was used to
>>
>>54062958
t. Pajeet poo in loo
>>
>>54062330
great rebuttal!
I like the part where you neglected to use any facts
>>
>>54059392
Programming jobs where exactly? At shitty it firms that just opened few years ago?
>>
>>54062396
Modeling a system as a collection of distinct objects whose behavior may change over time.
>>
>>54058513

> introductory reading/watching
http://harmful.cat-v.org/software/OO_programming/why_oo_sucks
http://www.paulgraham.com/noop.html
https://www.youtube.com/watch?v=QM1iUe6IofM

Personally, I dislike reading OO code. I want to see all the data definitions in one place because it makes building a mental model of the program data easier. OO makes this difficult on purpose in the name of encapsulation. It wraps data and functionality into opaque "objects" that I can't understand without jumping around and reading definitions. I know how numbers behave and how strings behave because these things are pretty universal. OO programmers are often too willing to abstract that away, even though it adds a layer of indirection for anyone reading the code later. When I don't have that mental model, It's hard to tell which parts of the program are essential. The codebase just feels like a swamp with no distinguishing features.

I also the loudest proponents of OO they blindly believe everything their professors or textbooks tell them. They learned OO first, and justify their baby duck syndrome by regurgitating the so-called "benefits" without any experience with anything else they could use to make a comparison. Another problem with these types is they learned OO through real-world analogies, which is fine until they forget the difference between the analogy and how the computer works. Then, they end up with lots of incidental complexity due to applying an inappropriate model to their problem.
>>
>all these x vs. y threads
>never one example

I get the feeling from many comments that the posters learned one way or another and are shitting on the other way because
>muh preference
>>
>>54063614
>Personally, I dislike reading OO code. I want to see all the data definitions in one place because it makes building a mental model of the program data easier. OO makes this difficult on purpose in the name of encapsulation. It wraps data and functionality into opaque "objects" that I can't understand without jumping around and reading definitions.

That's the fucking point. The class interface (whether by inheritance or by an actual interface) is a wall which allows code on one side to radically change without having to change a thing on the other side. Callers are not supposed to know anything about the data representation inside the class.

This isolation doesn't just limit the impact of changing code in one part of a program. It allows the substitution of radically different objects. You write a report generator that outputs to PDF via a Graphics class. The class interface is a set of abstract graphics functions. So calling code shouldn't even know the underlying model is PDF. There's nothing specific to PDF in the interface.

Now you need HTML versions (not just PDFs embedded in a web page). Or maybe you started on Mac with native PDF support and are now on a platform without it. You should be able to slip in a new Graphics class without the calling code changing at all.

FYI - this is a benefit I see all the time in the real world.

OOP does require some thought and engineering to work well. There's no shortage of examples which are either over engineered (i.e. some of Java's stuff) or under engineered (classes are closely coupled defeating the whole point of OOP). But when it works, it works extremely well.

>Then, they end up with lots of incidental complexity due to applying an inappropriate model to their problem.

More like they didn't understand how to model the problem in the first damn place.
>>
>>54058513
https://www.youtube.com/watch?v=QM1iUe6IofM

This guy sums it up nicely. Basically, OOP in the way it's generally used breaks encapsulation, and most OOP just unnecessarily complicates your code.

>helps portability and maintainability
Have you ever tried to read the clusterfuck that is Enterprise Java? Just trying to find code that actually does anything beneath the layers and layers of misdirection through objects and tiny methods is a nightmare.
>>
>>54059737
>But at least it's better than having to push to my phone to test every change
It's really not. Just plug your phone in and keep it next to your keyboard. Granted I haven't used that emulator in two years or so, but unless it's improved a lot I'd say it's too dog slow to do anything in.

But something you might want to look into if you really don't want to use your phone is Genymotion, an x86 Android emulator -- that's a reasonable speed.
>>
>>54063933
>and most OOP just unnecessarily complicates your code.
This. Even SDL, a non-OO api, is the standard even in games using OO languages
>>
>>54064004

Shit OOP is complicated. Good OOP is not.

Really no different from any other paradigm. Shit code in general is complicated. Good code is not.
>>
Good old Java. Perfect for driveby :p. Got to love them days. OOP is good, but only if the architecture is correct.
>>
Think of it this way. persedual programming is like Islam. Shit, old and stuck in the past. USED by hackers ( terrorist) With old school hacking(old school beheading)

Now think OOP which is nee, cleaner and still able to do hacking with more effective outcomes. ( post old testimony)

So don't be a terrorists stuck in the old days. Become a modern citizens with modern coding skills
>>
>>54064343
Your analogy fails because Islam is newer than the New Testament. And also because you're a faggot.
>>
>>54064343
Your analogy fails because procedural programming is not the only alternative to OOP, nor do languages ever employ just procedural anyway. And also because, as the other guy stated, you're a faggot
>>
>>54063040
You didn't use any facts either, you just stated things as if they are facts.

When you run a program, it doesn't recompile; so how can it optimise itself the more it is run? Stop being a fucking moron.
>>
lets play spot the javan
>>
>>54058513
>>>54064343
>Your analogy fails because Islam is newer than the New Testament. And also because you're a faggot.
But Islam followers uses stoneage rules.
>>
>>54058513
>>>54064343
>Your analogy fails because procedural programming is not the only alternative to OOP, nor do languages ever employ just procedural anyway. And also because, as the other guy stated, you're a faggot


Sorry, you are all lefties that have gone to Uni so they think you're a good coder. There are many procedural languages ls still in existence.

Islam and procedural programming stuck in the stonesges
>>
Java is not fully OOP
>>
>>54058513

A lot of people talk about Java that have actually no clue about it.

OOP was one of the answers on the software crisis, where code became too big/complex to keep track of it. And it was successful for a reason, because you can handle giant projects pretty well with it.

On the other hand Java (liek C or C++) is a terribly ugly language. Java is all about stability, safety and backwards compatibility which means, there's a lot of Syntax that's just unnecessary from a contemporary point of view.
There's a reason for languages like Scala, Kotlin, Curry and Groovy which work on the JVM and the Java libraries and try to produce 100% Java bytecode (sometimes more, sometimes less), but with much cleaner and better syntax.

With Java 8 they finally have brought streams and lambdas into Java (after almost every newer language has it), recognising that string-list-manipulations are a pain in the ass with java. But there's still so many things that are ugly and complicated in Java..

Don't get me wrong, it's highly advisable to really know java (it's complete package structure and some frameworks) at first, but when you do get there and take your time to learn one of the newer JVM languages, it will look like programming porn to you..

This is Groovy:

// print the letters a-z in reverse order
('z'..'a').each {
println "Letter ${it}"
}

// say hello
def sayHello(name) {
println("Hello $name!")
}

// names
def names = ["OP", "Anon"]
names += 'Faggot'
names -= 'Anon'
names.sort()
names.each {sayHello(it)}


Isn't this intuitive as fuck?
Can you write a Java Version of this which isn't at least twice or three times as long?
>>
>>54062856
why is the class keyword bad? Not disagreeing just curious, been using it for a while in my nodejs project, seems ok
>>
>>54058513
Design patterns were invented as a work around for OOP.
People also think inheritance is a good idea because they are lazy but composition gives cleaner code.

I'm glad they are adding algebraic datatypes, better tuples and pattern matching to C#.
>>
>>54064969


Another example, some "plain old Java objects" (POJO), also called Java Beans..

In Scala:
class Order {
var id: Int = _
var products: List[Product] = Nil
}

class Product {
var id: Int = _
var category: String = _
}



In Java:
public class Order {
private int id;
private List<Product> products;

public Order() {
products = new ArrayList<Product>();
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public List<Product> getProducts() {
return products;
}

public void setProducts(List<Product> products) {
this.products = products;
}
}

public class Product {
private int id;
private String category;

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getCategory() {
return category;
}

public void setCategory(String category) {
this.category = category;
}
}



Now while Scala is actually a functional language and there's much more differences than just "syntactic sugar", this is already a good example of why most Java guys love Scala, once they've tried it.
>>
OOP enables non-programming "code designer" non-job positions that sit around all day and fuck with flowcharts and tell you your code has to be "enterprise".

It's fucking bullshit, it's spaghetti code in the worst possible way, and it encourages elitism and backwards thinking that contradicts how computers do things.

Fuck OO and fuck anyone that supports that garbage. If you're not coding in C, then fuck you.
>>
>>54065052
This. Can't stand those non-programmer "muh job in IT" """people""" with their "analysis" and "business logic" and shitty flowcharts.

>this box is our database
>this box is the bank's database
>I'll draw a line to connect them

Not wanting to deal with these people is why I didn't get a job as a dev.
>>
>>54059716

Pro tip for use with Android Studio. If you have Windows 8.1 or higher and a HyperV enabled PC, use the Visual Studio android emulator.

It is god tier, and compatible with Android Studio, and very very fast.
>>
>>54064571

it's true that currently Islam is leading the world in medieval ass-hattery.

but at base, the religion itself is more rational than the other abrahamic monotheisms.

> abstract, non-personified deity
> actually universal ("holy trinity" wtf)

it's still all bullshit but
>>
>>54058513
>Why does /g/ hate OOP so much?

Because /g/ are all amateur hobbyist coders who work alone and have never collaborated on anything involving more than just themselves

If you actually want to work with other real people, it's impossible without breaking down the code into parts and separating concerns.
>>
>>54064486
No, you're the fucking moron. This is general knowledge, you're just too much of an idiot to realize it.
It's called JIT for a reason, and even the JVM is called Java HotSpot. Because it literally looks for hotspots in your code to compile after X amounts of loops.

http://blog.leenarts.net/2010/05/26/dontcompilehugemethods/
http://pieroxy.net/blog/2015/06/29/node_js_vs_java_nashorn.html
>>
>>54065361
If you use the same database it is that easy though
>>
>>54064486
>Just-in-time (JIT) compilers are essentially fast traditional compilers that translate the Java technology bytecodes into native machine code on the fly. A JIT running on the end user's machine actually executes the bytecodes and compiles each method the first time it is executed.

>The JIT process detects hotspots in code. If a hotspot is detected (usually 1000 to 1500 hits depending on your platform and JVM version) the JIT process marks a method for compilation to machine instructions. After compilation, method invocations are generally crazy fast on a method since the JIT process had like a thousand times to see what generally happens during the execution of a method and can optimise accordingly.

Dumbass
>>
>>54058513
because cat-v said so

plan9 and golang here
>>
>>54059392

CS isn't really a software development degree, it's a mathematics degree that happens to have a high crossover with software dev.
>>
>>54059443

Eclipse hasn't been bad for a while now.

Eclipse Mars is better than IntelliJ
>>
>>54065052
>>54065361

>NEETs / 10
>>
File: image.png (3 KB, 204x36) Image search: [Google]
image.png
3 KB, 204x36
>>54058513
Speaking of Java, what do people on here think of NetBeans?
>>
>>54059819
If this is the main reason people hate Java, I'll start learning some Java.
>>
>>54067194
This doesn't state that it recompiles each time that the program is executed.

Lol
>>
>>54059819

Literally by definition it should never be easier to re-write something from scratch than to re-use your existing codebase.

Either your initial code is poor, or you have a poor understanding of design patterns.

Literally the point is that you should be writing good code and programming correctly with ample documentation so you can easily and efficiently reuse your classes.
>>
>>54064969
>>54065034
Interesting, thanks!
>>
>>54067798
Use IntelliJ IDEA instead, NetBeans and Eclipse are cancer to development.
>>
People hate Java because they're used to ~it just werks~ syntactic sugar and just generally getting their laundry done by their programming language of choice
>>
>>54067986
>This doesn't state that it recompiles each time that the program is executed.
>>If a hotspot is detected (usually 1000 to 1500 hits depending on your platform and JVM version) the JIT process marks a method for compilation to machine instructions
Do you have a reading disability? Of course it recompiles the bytecode to machine code, the .class files only contain bytecode. It doesn't store the hardware instructions anywhere except the RAM after the JIT has kicked in. Stop being a fucking idiot.

Read the article I posted above, the one about benchmarking Nashorn to V8.
>>
>>54067062
>Because /g/ are all amateur hobbyist coders who work alone and have never collaborated on anything involving more than just themselves
this. /g/ usually have no idea what they're talking about. I remember a 200+ replies thread where no one knew how passing by reference works and that C and Java are strictly pass by value
>>
>>54069305
Source needed otherwise stfu pajeet
>>
>>54069521
https://rbt.asia/g/thread/S53989057
>>
>>54067986
C++ faggot butthurted LMAO KEK

Lell
>>
>>54068989
No it doesn't lol
>>
>>54069726
Lmao kek jej btfo pwned xD
>>
>>54069898
Now you're just out of arguments. Get the fuck out lmao.
>>
My brain has rejected OOP for years. I've got a basic understanding now, but most advanced concepts are over my head.
>>
>>54059358
ES5 is a functional lang, which could explain why people that treat it as OO hate it
>>
>>54067798
It's a slow piece of shit IDE.
>>
>>54068028
Quite often the existing code IS poor, relying on kludges to get the job done, or at least created by someone else who comments their code poorly, in which case you need to put in extra effort just to figure it out and make it do what you want. And sure, there are cases where classes are good and should be reused - but the problem with the way code reuse is emphasized is that it encourages people to see it as the ONLY solution, even if the existing classes are a more awkward solution than just creating something from scratch.

>>54069898
Java bytecode COULD be considered a type of machine code, it's machine code for the JVM. But the JVM still has to take the bytecode it runs and convert it into native CPU instructions.
>>
>>54071190
>Java bytecode COULD be considered a type of machine code, it's machine code for the JVM.
True.

Just to go one step further:
https://en.wikipedia.org/wiki/Java_processor
>>
>>54062521
>How would I test for Android 6.0 if I only have a phone that runs 4.0?

Get a new phone.
>>
>>54070028
No lol it just doesn't lmao you're wrong yet again
>>
>>54072687
lol retard
>>
>>54073039
>taking the bait
>>
>>54073158
I just wanted to bump the thread to be honest. seems interesting
>>
>>54062396
>I want to hear some examples of the above.
GUI libraries

Most functional approaches for this suck and the rest interfaces existing GUI libraries.
>>
>>54062396
>Frankly, I see some value in attaching functions directly to objects ("methods") but other than that, FP has much better answers than any of OOP.

Hate to tell you this but FP is a meme. It's a poor way to model the world, and abstracts so much about the machine that performance becomes a bitch.

I've never seen FP in a real world commercial project. I hope I never do.
>>
>>54073158
>hurr i'm fucking retarded
>it was all a troll, i swear
>>
Why so much java hate?
As a prof C++ user for many years, let me tell you this.Being able to WORA(write once run anywhere) makes things go super slow, since you use a VM.Imagine having a robotic eye executing hundreds of algorithmic procedures in 3sec responce time with C++.With java it would take a year, for it to decode the information given.Also, Java's GC is sooooo messed up, that you shouldnt be using memory.There are many many reasons why java is the scrub-language and others like C,C#,C++, are way better if you know how to prog with them.
>>
>>54075705
>Being able to WORA(write once run anywhere) makes things go super slow, since you use a VM

Others have pulled it off. But they generally compile native machine code and link against frameworks that abstract OS APIs to a common interface.
>>
>>54075058
>abstracts so much about the machine

What does it abstract, exactly? How a CPU works is much closer to the semantics of functional languages (variables are assigned a value upon initialisation and cannot be changed thereafter) than to imperative languages (update in-place).
>>
>>54062470
And its a piece of broken slow shit that eats more CPU than Crysis looking like a N64 game.

>>54061657
You are a cs faggot that writes pleb-tier commercial applications, stay mad.
>>
I'm just a 2nd year cs undergrad but i find making avstract data structures is waaaay easier with OOP
>>
>>54063843

What you are talking about is simply clean abstraction, that code can change one place and the change is isolated. This is not unique to OOP, nor enhanced by it. It's a completely separate issue.

My problem is that OOP makes clean abstractions harder because it forces you to create abstractions for data and procedures simultaneously instead of piecemeal. Code is not "well factored". It bogs you down thinking about which methods should belong to which class. OOP, as currently practiced, hinders the ability to define one without thinking about the other.

>>54064969
I like how that example code uses no OO specific features, making it more of a counter-example. You do call methods of 'names', but that is just syntax. The software crisis never went away, and all OOP did was create new jobs to solve the problems of using OOP and pretend like that was progress.

>>54067062
> OOP is the only way to separate concerns
please tell me this is bait
>>
>>54077141
>How a CPU works is much closer to the semantics of functional languages (variables are assigned a value upon initialisation and cannot be changed thereafter) than to imperative languages (update in-place).
CPUs have finite state which is reused and reconfigured.

The program counter keeps changing. The cache keeps changing.

Even if you're talking about register renaming (which is a hack that not all CPUs have), the actual register file is finite and reused. That mechanism is a very complicated way to update "variables" in place.
>>
>>54075705
Jesus Christ, people who claim to be C++ pros also seem to be really retarded. The fact that Java uses a VM is what makes it faster than other languages. Also the fact that you mentioned C# alongside C++ and C when C# is a direct Java ripoff with all the same components like a VM just proves what a fucking mongoloid you are.

That robotic eye analogy makes no sense either. You clearly know nothing about programming.
>>
>>54059786
That's because it's targeted to consumers who want to play their android games on a laptop/desktop. It's not really a development tool. Or at least not made to be. I forgot it existed until I saw that post. Weird choice. But I guess it was not nearly as slow as the Emus that ship with Android Studio.
>>
>>54075058
>FP is a meme. It's a poor way to model the world, and abstracts so much about the machine that performance becomes a bitch.
Pure FP, yes, but procedural/functional hybrids work very well.
>>
File: funny-cats-looking-disgusted.jpg (127 KB, 375x500) Image search: [Google]
funny-cats-looking-disgusted.jpg
127 KB, 375x500
>>54077141
>cpu registers cannot change after initialization
>L1 cache cannot change after initialization
>L2 cache cannot change after initialization
>L3 cache cannot change after initialization
>>
>>54078153
>The fact that Java uses a VM is what makes it faster than other languages.
In my experience Java seems slightly slower in execution than C++. Java seems to compile a bit faster, however compilation is only done once whereas execution is done many times.

>C# is a direct Java ripoff with all the same components like a VM
I don't think that's really specific to C#, isn't that true of all .NET languages?
>>
>>54077841
>What you are talking about is simply clean abstraction, that code can change one place and the change is isolated. This is not unique to OOP, nor enhanced by it.

It is most certainly enhanced by data hiding, inheritance, interfaces, and polymorphism. These ideas were chosen and implemented precisely because they enhanced clean abstraction at a time when procedural development was reaching a breaking point.

>My problem is that OOP makes clean abstractions harder because it forces you to create abstractions for data and procedures simultaneously instead of piecemeal.

If the data is not abstracted then you do not have a clean abstraction. Period. If code all over the project knows about the data representation then the entire project will break when that representation has to change.

There are rather recent examples of this happening on a large and embarrassing scale. The one I'm most familiar with is Apple's Copland, an attempt in the 90's to modernize Mac OS classic with preemptive multitasking and protected memory. (Mac OS X is literally NextStep, a completely different OS.) The project basically failed because the first Mac had 128K of RAM. To conserve limited resources most of the core libraries / APIs exposed data structures. Once there was a body of code built on that it was impossible to change.

Apple struggled with even minor enhancements before Copland because of this shit. As fast and efficient as QuickDraw was its reliance on exposed structs was always a fucking noose around its neck.

Someone earlier said they wanted to see all the data definitions in one file. That tells me A) they've never worked on a large project, and B) they've never worked on a project with changing requirements.
>>
>>54078153
>The fact that Java uses a VM is what makes it faster than other languages.

You either don't know what VM is or you don't know what "faster" is.
>>
>>54078749
>>C# is a direct Java ripoff with all the same components like a VM
>I don't think that's really specific to C#, isn't that true of all .NET languages?

Sorry, but I rank the .NET framework higher then most Java stuff. As much as it pains me to say it, Microsoft actually did a good job on .NET. (Though it is over engineered at points.)

The .NET languages have superficial differences. They borrow syntax from other languages so they can be called "C#" and "VB.NET" but except for the way you declare a variable or write a for loop they all operate in the same manner.
>>
>>54058513
OOP is the present and the forseeable future. Keep on using it and ignore these faggots.
>>
>>54078153
> The JVM makes it faster

It makes java portable but not faster. It makes it slower because the code is not compiled.
>>
>>54078749
>In my experience Java seems slightly slower in execution than C++. Java seems to compile a bit faster, however compilation is only done once whereas execution is done many times.
The JVM gets faster execution time after it has warmed up. When a method gets called enough times it is compiled to machine code with greater optimization than compiled C code because the JVM has had time to see what the code does and how it is ran.

>>54078898
You're a moron. There's a reason why Facebook stopped using Hip Hop and created HHVM instead. JIT has known speed improvements over traditional compiled code and Java happens to be faster than most other languages with an exception to C and C++.

>>54079101
That is in no way true. First of all Java is a compiled language, the compiler compiles it to bytecode. After the JVM has executed the program it starts compiling each method gradually ultra optimized machine code which would be faster than just compiling it straight away. I don't want to repeat myself again so just look what I wrote to the people above.
>>
OOP is hipster faggotry
FP is and always will be superior
>>
>>54075610
>still taking the bait
>>
>>54077841

>I like how that example code uses no OO specific features, making it more of a counter-example.

Wether you do OOP or not you need to use loops and string manipulations. I wasn't even talking about paradigms at this point.

Nevertheless I agree that OOP is not the silver bullet, especially not Java. It's just a smart approach with pros and cons.

>The software crisis never went away, and all OOP did was create new jobs to solve the problems of using OOP and pretend like that was progress.

There's a lot less projects going turning into shit these days. We got more elaborated project management methods, we got a lot more awareness about the possible problems and so on.
>>
>>54079209
>The JVM gets faster execution time after it has warmed up.

Binaries from good compilers simply are fast. They don't need to "warm up." And you don't get to discount the "warm up" time when comparing performance. Most people have a shitty impression of Java speed because by the time it has "warmed up" they've left for lunch.

One thing I'll give .NET is that it's pretty fast without Java's slow startup or long "warm up." So JITs aren't necessarily slow. Java is.

>When a method gets called enough times it is compiled to machine code with greater optimization than compiled C code because the JVM has had time to see what the code does and how it is ran.

The JVM is not an AI. There are only a handful of things that it can notice and optimize for. While there are some specific examples of optimizations that a VM+JIT can make that a static compiler cannot, they're not enough to overcome the overall speed deficit.

>>>54078898
>You're a moron. There's a reason why Facebook stopped using Hip Hop and created HHVM instead.

Apples and oranges. HipHop was PHP translated to C++ and then compiled. It wasn't actually C++. I can only imagine the structures, functions, and levels of indirection to make that work. HHVM is not going to out perform a binary compiled by a good modern compiler handed code in its native language.

>and Java happens to be faster than most other languages with an exception to C and C++.

What else are you thinking of? .NET uses a JIT. Python is interpreted. The Obj. C runtime introduces considerable overhead. (It's still quick, but you can't use it as an example of JIT vs. compiler.)

>>>54079101
>That is in no way true. First of all Java is a compiled language, the compiler compiles it to bytecode.

That's not the traditional definition of "compiled."

>it starts compiling each method gradually ultra optimized machine code

LOL! "Ultra optimized." This tells me you don't really understand compiler design and what can be optimized.
>>
>>54080961
>LOL! "Ultra optimized." This tells me you don't really understand compiler design and what can be optimized.
ROFLMAO!!! This tells me you have no idea why the JVM is called Java HotSpot and what it actually does

see >>54067088
>>
File: 1450869444024.jpg (8 KB, 200x200) Image search: [Google]
1450869444024.jpg
8 KB, 200x200
>>54067644
What's a good software development degree then?
>>
>>54080871
>>54080961
>>54081006
>performance

I'm very conflicted about Java. I know it can perform - apps running on very resource constrained Android devices run very well given the constraints.

But I feel like everything I see written in Java is a horrible cluster fuck. Backup Exec famously went from "performant" to "18GB RAM and 45 seconds to open the GUI" when they moved to Java. vCenter does absolutely fuck all and burns a mega shittonne of resources. I have vCenter servers now running on 48GB RAM just to manage a fucking GUI for management of four host servers.

Then you've got this versioning hell. Oracle's PMS.. currently only works with versions of Java so old, Oracle won't let you download them any more unless you have a PMS support agreement. What happened to this "write once" idea?
>>
>>54081173
SE you dumb fuck
>>
>>54081219
What about Computing?
>>
>>54081194
that's just what happens when you let Pajeets write code for 1 rupee a month

urge your HR department to look for competent Java architects that actually give a fuck
>>
>>54081219
SE is just compsci with a few more management courses
>>
>>54081173
Universities can't teach you programming. SE is a meme. Universities are good with theoretical stuff, so comp sci and math are good degrees. You should learn programming yourself.
>>
File: 1451937605829.png (8 KB, 493x402) Image search: [Google]
1451937605829.png
8 KB, 493x402
>>54059372
>>54059329
these posts

also never listen to /g/
you will only get meme'd on and then everyone laughs at you

ALWAYS do the opposite of what /g/ tell you to
>>
>>54070111
you started too late.
should've started learning OOP in your teens.
>>
>>54080961
It is ultra optimized, and the JVM is probably the most complicated piece of software ever written. You don't understand how much work has been put into it. The CLR is also not as fast as the JVM either, as benchmarks have shown.

>LOL! "Ultra optimized." This tells me you don't really understand compiler design and what can be optimized.

There is a JVM flag that lets you compile all of your Java code to machine code before it is executed. It's much slower than the JIT because the JVM can't learn how to optimize the methods before they are compiled. Seems like you know nothing about Virtual Machines or what can be optimized.

If you read one of the articles posted above, you can see how after gradually running a Nashorn JavaScript algorithm 10 times, to 100 times, to 1000 times the time went from 17 seconds, to 3 seconds to 1.2 seconds. The JVM does optimize your code the more you do run it and it does use those previous calls to find out how.

When you're running a web application written in Java the warmup time does not matter since the web server will likely be on at all times. This is where Java performance excels and there is a reason why Java has the fastest application-web servers (see image).

>HHVM is not going to out perform a binary compiled by a good modern compiler

Nobody said that HHVM would be faster than plain C++. But HHVM happens to be faster than HipHop compiling everything straight away which proves how much speed improvements there can be gained with JIT.
>>
>>54083007
lmao every modern compiler for nonVM langs compiles to machine code
>ultra-optimized
nice buzzwords
>>
>>54083022
>>54081006
>>54080499
>>54072687
>>54069898
>>54067986
(You)
>>
>>54083007
nice cherry picked benchmark

yes, these are buzzwords.
>>
>>54083292
>>54083022
literally what buzzwords
go kill yourself
Thread replies: 149
Thread images: 6

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.