I was taught Java before any other languages. I've learned how to use the tools of C and some of C++...

I was taught Java before any other languages. I've learned how to use the tools of C and some of C++, yet each time I get an idea I end up forcing the use of objects...

How do I learn to program without objects?

Attached: download.png (166x304, 5K)

Other urls found in this thread:

youtube.com/watch?v=o9pEzgHorH0
twitter.com/AnonBabble

Help me, Jow Forumsuyz

what makes you think the culmination of 50 years of software engineering research is suddenly worthless because you saw a meme on a japanese forum for unaborted accidents that claims it be this way?

What did he mean by this?

Objects are fine if you have small collections.
The problem is when you start having >1000s in which case structures of arrays are better than having all those pointers around.
Thats what people do in computer games, scientific computing, etc.

OO is fine to manage the application state though.

use classes and modules and components like the big boys and stop bitching.

Only make something an object if you are going to have more than one instance of it. Use plain functions for everything else. If you need to maintain state in free functions, you can just use globals that are only visible in the source files that use them.

I don't get it
You mean functional programming?

I'm not bitching, I meant that every time I start coding I end up creating 10+ objects more than I need, when I really don't need that many. I was just asking for advice on how to organize my data better without having massive amounts of different objects

Yeah, basically, I can't really find any use cases that I would do with objects...

Learn Scala now.

you're not being detailed enough for people to critique your use of objects. Nothing wrong with 10 objects if you don't provide context

some helpful advice
youtube.com/watch?v=o9pEzgHorH0

C++ has objects/classes tho? I dont understand why people keep insisting on keeping C++ as simple as possible when the fucking bloated piece of shit has everything and more, if you don't want to use those things why not just use C

Attached: 1547750266387.jpg (500x280, 38K)

C++ has plenty of good parts that have nothing to do with object orientation. Strong typing, RAII, generics, namespaces, etc. It gives you true zero cost abstractions if you know what your doing, so you can get the same assembly output as C with a tenth of the code and much better type checking.

Attached: 1545337584911.webm (636x480, 620K)

You can write quick, dirty and short code all day but that kind of code doesn't work at scale. OOP is popular because businesses need a way to shard work and because they don't want to hire top talent. OOP prevents any one dummy from doing too much damage. There are enough design constraints in enterprise Java that even a really jackass would have a hard time wrecking a code base.

Also, C programmers have always created systems of encapsulated functions and data structures. You don't need an OOP language to make or use such encapsulated structures. Unless you're heavily using Polymorphism, chances are your object oriented code is just fine.

cringe

Attached: nagoorcorejava.gif (849x458, 150K)

You can't. OOP causes permanent brain damage and should be avoided at all costs.

this desu. rip in pajeet, op

This is so stupid. Go back to jerking off to Jordan Peterson.

Attached: 1492020460110.jpg (1072x1440, 320K)

>more objects that I need
how do you know you do not need those objects? If you really know you do not need them then fucking remove them.

Switch to Haskel
Profit

For example, the other day I wrote a message class that legit only stored a string(the message) and the type of message it was...

I think you misunderstood me, I dont want to stop using classes, I just want to find a better way to differentiate between when I should and shouldn't use a class. I think my excessive class creation is causing my more trouble than storing a couple of simple variables. I keep getting hung up on abstraction instead the actual problem why I was asking for a solution/advice. I probably should post some code, but then I'll just have a shitstorm of differing opinions on whether or not I am using too many classes.

So many videos of this man on youtube. Which one should I start with?

What about lisp? Its cuter imo

Lisp has OOP doesn't it?

My uni gives me OOP assignments all the time, and every single one has made me think "could I do this without classes?" And the answer has always been yes. I think that OOP is purely design. It doesn't give you more freedom or ability, it just organises things in a certain way. It's a perfectly valid design choice.
Also until I used C++ I could never see myself purposely using OOP. But now I see it can be a legitimate choice.
I still think that Java is useless and evil though.

My language 'roadmap' has been
Java -> Python (i puked on myself when i tried this one) -> C -> C++ (here now) -> hopefully lisp
I didn't spend that much time on C, I probably should go back to it and try to exclusively use it for a while...
As far as I what I've gathered rereading responses I don't think there is really any harm in my overuse of objects. However, I really struggle in **effectively** using lambdas or any strictly functional language

Just learn a functional language, OP, something like Haskell. Don't even need to go balls deep into the whole category theory stuff, just learn to write programs in a language that works in a completely different way so your brain gets used to doing stuff without thinking in objects.

so?

DTOs, EJBs and POJOs are valid and widely used design patterns.

especially for a message. you can then easily expand on that with a timestamp, author, recipient, permissions, route, digest, etc, etc when the need arises. or not.

I think I can help you a little bit

basically you know about composition, aggregation, inheritance, etc, right?

If you have a class that is used exclusively as a composing member of another class, you might be able to combine them.

example: you have a class Wheel and you have a class Hubcap, and in your model a hubcap can't really exist without a wheel. the only properties in hubcap are hasSpinner and hasSpikes, maybe put hasSpinner and hasSpikes as property of Wheel and remove the Hubcap class.

If you have a class with a huge number of fields however you might want to consider splitting it up again into logical chunks.

example: you have a class Wheel wherein you have 100 properties and 20 methods actually describing a hubcap. Even though the class will not be reused, consider building a class called Hubcap in the Wheel package and store a reference to a Hubcap object in the Wheel object.

The agile approach to figuring stuff like this out is to just write code until your program doesn't work anymore, and then clean up your code while you're debugging.

I almost envy you and your "Big Brain". I never wrapped my head around OOP and still can't read most open source code from corporations. To me it makes too much sense why my windows lags sometimes and uses so much memory.

I like many of the products many corporations produce, but they always suffer from this massive compartmentalization spreading out the code out as well as using too much memory.

In order to understand one code file, I have to find and read 12 different code files? Fuck OOP.

right click
find implementation

Not a C++ dev but I read the other day that it got closures/lamda expressions a few years ago. Use those instead of objects?

T.aspiring chad javascript dev

explain to me how closures replace objects