Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
yehaaw25683yGiving you 2 cents, but honestly depends on the project. Sometimes strict OOP patterns must be used.
-
Python and OOP = danger noodle...
It has a limited set of OOP implemented, and most of the time you just punish yourself trying to go full retard... Eh OOP. -
Yeah i agree, most python code shouldnt be any of those, it should be an empty file
-
@yehaaw I know pal. I know OOP is important. I did a lot of C# and Java code in the past where OOP is almost 100% times the way to go. But using OOP everywhere in programming languages like Python is just insane. I believe the key is knowing, like you said, that it depends. It depends on the project the tools you'll need to use.
-
@yellow-dog Ha nice try :). They're not empty. They are some really clever functional one liner solutions that Java can't even dream about.
-
@flakobatako for that matter you can write everything in one line in Java and it'd still work!
-
I went elsewhere...with Kotlin...and killed off the boilerplate and kept the JVM.
COME AT ME BRO! ;-) -
yehaaw25683y@iiii Why not? I’ve worked on a project a year ago with strict OOP patterns and python. It was a bit annoying, but now I’m curious about actual technical downsides.
-
Hazarth95063yBut... I like responsibilities being encapsulated in namespaces... So either classes, named tuples or modules!
:( Don't tell me how to live my life -
@Hazarth that's like comparing a regular hand sized gun to a planetary destroyer...
My statement might be wrong when seem from your perspective - I'd do what you described in any language if it's possible.
But in all the years I've seen OOP treated either like a religious cult where it's zealots happily perform any kind of self mutilation if they could use more OOP even when they don't fit or people who's approach to OOP is like a personal self-test from a questionable gossip Press Magazin: Oh it's this, of course we apply that OOP paradigm what else could we do.
Welcome to the joyful land of over abstraction, reflection, diamond problem, not knowing which fucking result this obese clusterfuck of templates and traits produces or why the DTO has setters and getters which need comments to explain how their result values changed over time.
OOP can be fun like any party drug.
But if you start sniffing it through your arse cause it won't work otherwise, it's really a problem.
(Not saying that you do it specifically :) ;))
I wish I had some times a brain chip and could dump the stuff I've seen without remembering it by myself to devRant.
I think a lot of people would be very terrified. -
@oh-4-fucks-sake I love programming in C# and LINQ. So I love Kotlin, because it feels very similar. Form me it is Java done right.
-
@Demolishun Generators are a sick and powerful feature of Python. A very underrated one IMO.
-
@IntrusionCM That's my point. I don't hate OOP. I hate peope who overuse OOP in things like Python, just because they learned to do it that way in Java and is like a religiuos dogmatic thing. And now that they are moving into Python, they are like an extremist group repeating the same exact methodology in every project.
They make a class for everything (yes even where there a 2 functions, the actual method and a __init__ constructor) and repeat the same DAO, DTO, Service, WhatEverTheFuckSakeShitILearnedInSchoolShit over and over and over again wether is a flask API, a simple AWS lambda or a script for web scrapping you have to jump trough 3-5 files to know what table the fucking LoginPasswordDaoImpl.validateLogin() method (YES IN CAMEL FUCKING CASE) wich lies in a ConstantProvider class, and is called by the UserServiceImpl Class which uses a ConnectionFactoryImpl class to create the sqlalchemy engine and wich is finally, called at the top from the lambda_function.
Dear Java developers who has a fetishes with OOP and Design Patterns, and are now using Python:
Not every fucking thing you build has to be a class, a singleton or a factory. Specially in Python. Go with your boredom and boilerplate elsewhere.
rant