Car car = new Car()

Car car = new Car()

Shopping Cart Returner Shirt $21.68

Unattended Children Pitbull Club Shirt $21.68

Shopping Cart Returner Shirt $21.68

  1. 2 months ago
    Anonymous

    val car = Car()

  2. 2 months ago
    Anonymous

    homosexual homosexual = OP as homosexual;

    • 2 months ago
      Anonymous

      <null

  3. 2 months ago
    Anonymous

    Car cAr, caR, car;

    Only winhomosexuals are confused at this point.

    • 2 months ago
      Anonymous

      You have Windows Derangement Syndrome

    • 2 months ago
      Anonymous
    • 2 months ago
      Anonymous

      Jeez, that's a lot of cum

    • 2 months ago
      Anonymous

      Source is some russian movie called Draculov.

  4. 2 months ago
    Anonymous

    >types le bad
    >oop le bad
    anything else you unemployed redditroon?

    • 2 months ago
      Anonymous

      le bad
      >>oop le bad
      yes pajeet

      • 2 months ago
        Anonymous

        No, you unemployed troon

        • 2 months ago
          sega

          >self inserting as chud
          sad

          • 2 months ago
            Anonymous

            He's an uber Aryan Chud (chad + stud) you seething troon

          • 2 months ago
            Anonymous

            how am I a troon you demented cord homosexual

          • 2 months ago
            Anonymous

            >He's an uber Aryan

          • 2 months ago
            Anonymous

            bro you forgot to turn off selfie mode

          • 2 months ago
            Anonymous

            It really is. Why would somebody impersonate me of all people?

        • 2 months ago
          Anonymous

          That's a very discord zoomer meme. Kinda gay.

        • 2 months ago
          Anonymous

          cringe

      • 2 months ago
        Anonymous

        unemployed

    • 2 months ago
      Anonymous

      Who are you quoting? But yes, OOP is very bad.

    • 2 months ago
      Anonymous

      I am employed and I think OOP is bad for most use cases.

    • 2 months ago
      Anonymous

      Types are in fact bad and OOP is even worse.

      • 2 months ago
        Anonymous

        I am employed and I think OOP is bad for most use cases.

        Who are you quoting? But yes, OOP is very bad.

        https://i.imgur.com/qC4E4I4.jpg

        le bad
        >>oop le bad
        yes pajeet

        frick off samegay

        • 2 months ago
          Anonymous

          Get better at spotting, newbie. Only one of them is me.

          • 2 months ago
            Anonymous

            > implying there's a way to tell who samegays

            yes, continue to be ignorant of how easy it is to manipulate discourse on this shitty website. it helps me and my bot farm influence you all.

          • 2 months ago
            Anonymous

            Yes, lurk more moron

          • 2 months ago
            Anonymous

            i'm aware of the numbers in the bottom right corner. they don't help aside from uncovering extremely obvious attempts.

          • 2 months ago
            Anonymous

            Imagine being this autistic lmao.
            >I can't tell people's writing apart unless they are attributed!

          • 2 months ago
            Anonymous

            it's relatively easy to train yourself to type as if you were someone else. plus, you have infinite opportunity for practice. if someone calls you out, your technique may need improvement (though in many cases it's just bluffing). i'm quite good at it, and i guarantee that you would be unable to tell.

          • 2 months ago
            Anonymous

            I guarantee that I would be unable to care.

    • 2 months ago
      Anonymous

      Good morning sir

    • 2 months ago
      Anonymous

      >>oop le bad
      It has it's usecases. The issue is not being able to determine when it should and shouldn't be used.

      • 2 months ago
        Anonymous

        >It has it's usecases.
        I can only think of GUI toolkits.

        • 2 months ago
          Anonymous

          The largest and most complex software in the world uses OOP principles. Even Windows (up to 8) used OOP for it's WinAPI. After 8 it was freezed. Oracle database, considered the largest and most complicated piece of software to exist uses OOP

          • 2 months ago
            Anonymous

            >Even Windows (up to 8) used OOP for it's WinAPI. After 8 it was freezed.
            What does it use now?

          • 2 months ago
            Anonymous

            >Oracle database, considered the largest and most complicated piece of software to exist uses OOP
            By what metric is oracle db the "most complicated piece of software to exist"?
            For some reason I highly doubt that statement.

      • 2 months ago
        Anonymous

        >reusability
        >modularity
        >Information Systems
        >TTM
        >classes let you create bigger projects
        >other stuff I've been brainwashed with in the software ing. c(o)urse

        public static final Car car = new Car(); // create new car

        sirs?

        is car an immutable object?

        • 2 months ago
          Anonymous

          >reusability
          this is a meme. c is reusable
          >modularity
          this is a meme. you can make "modules" out of anything in any language by writing decent comments and saving code elsewhere for later use.
          >classes
          this is a meme. you're so deep up the OOP butthole that it is as if you have forgotten that these things are abstractions. You are messing around with structures when you could be doing work instead.

      • 2 months ago
        Anonymous

        Why shouldn’t it be used?

        • 2 months ago
          Anonymous

          Anywhere you want performance. Data-oriented programming beats OOP there, and it's not even close.

          Composition is also a lot better than inheritance in a lot of cases. Inheritance is very overused.

          • 2 months ago
            Anonymous

            >Inheritance is very overused
            Composition is more common, and interfaces are everywhere. I don't think I seen any inheritance used outside of frameworks/libraries where you would want to extend something.

          • 2 months ago
            Anonymous

            I see it all the time in machine learning frameworks still.
            Makes much more sense than composition in that context imo.

    • 2 months ago
      Anonymous

      DO NOT REDEEM THE OBJECT SIRS

  5. 2 months ago
    Anonymous

    car
    cdr
    caar
    cddr
    cadr
    caaaddr
    Yeah real high IQ level programming language you got there.

    • 2 months ago
      Anonymous

      stop triggering my scheme ptsd

    • 2 months ago
      Anonymous

      I don't see the problem.

    • 2 months ago
      Anonymous

      This is perfectly readable and compacts a complex concept into a single character.

  6. 2 months ago
    Anonymous

    Unironically never seen anyone code like this, this kind of stuff usually stored in a collection like vector or held in a shared/unique ptr

  7. 2 months ago
    Anonymous

    Car should always be an abstract class.

  8. 2 months ago
    Anonymous

    car1.compare(car2)

  9. 2 months ago
    Anonymous

    auto car = new Car()

  10. 2 months ago
    Anonymous

    Car oldCar = new Car()

  11. 2 months ago
    Anonymous

    auto car = std::make_unique<Car>();

    • 2 months ago
      Anonymous

      auto car{std::make_unique<Car>()};

      Whats the difference?

      • 2 months ago
        Anonymous

        The version without the assignment operator uses uniform initialization
        In this case nothing changes at a low level (check the assembly)

        • 2 months ago
          Anonymous

          If there's no difference, why can you do it two ways? Why use one of the other?

          • 2 months ago
            Anonymous

            retro-coomerpatibility

          • 2 months ago
            Anonymous

            because for initializing new variables, uniform initialization is the C++11 (modern) way to do it, which can result in different way to init a variable in other case than the one described.

          • 2 months ago
            Anonymous

            what's the difference in other cases? is it just to make init more consistent?

  12. 2 months ago
    Anonymous

    auto car{std::make_unique<Car>()};

    • 2 months ago
      Anonymous

      https://i.imgur.com/zmYsTjk.jpg

      auto car = std::make_unique<Car>();

      damn 20 seconds too late

  13. 2 months ago
    Anonymous

    public static void main string args

    AHHHHHH I'M COOOOOODING

  14. 2 months ago
    Anonymous

    console.log('new car');

  15. 2 months ago
    Anonymous

    Nothing wrong with this when you actually know what's happening

  16. 2 months ago
    Anonymous

    Where's the semicolon you Black person.

    • 2 months ago
      Anonymous

      That's not enterprise enough

  17. 2 months ago
    Anonymous

    new carFactory = CarFactory.carFactoryConstructor()
    new car = carFactory.carConstructor()
    new ford = cast<Ford>(car)

    • 2 months ago
      Anonymous

      That's not enterprise enough for my taste

    • 2 months ago
      Anonymous

      >no line about government bribes^W lobbying and subsidies

  18. 2 months ago
    Anonymous

    struct car *car = car_new();

    it really is that simple

    • 2 months ago
      Anonymous

      typedef it, see

      car_t * mine = malloc(sizeof *mine)

  19. 2 months ago
    Anonymous

    C# has it best for once:
    Car car = new();
    You get the readability and none of the duplication.

    • 2 months ago
      Anonymous

      See kotlin here

      val car = Car()

      , with the added advantage of explicit nullability

  20. 2 months ago
    Anonymous

    import car
    my_car = car.gimme()

  21. 2 months ago
    Anonymous

    Car car();

  22. 2 months ago
    Anonymous

    $car = new Car();

  23. 2 months ago
    Anonymous

    > (car car)
    'bonnet

    • 2 months ago
      Anonymous

      under rated

  24. 2 months ago
    Anonymous

    mov eax, [OldCar]
    mov [NewCar], eax
    ret

    NewCar: resd 01h
    OldCar: resd 01h

  25. 2 months ago
    Anonymous

    Car* car = reinterpret_cast<Car*>(&vehicle);

  26. 2 months ago
    Anonymous

    car := Black person.Car.New()

  27. 2 months ago
    Anonymous

    MotorCarImplReal car = AbstractMotorCarFactoryImplMotorCarImplBuilder.build();

  28. 2 months ago
    Anonymous

    let car = Car::new()

    • 2 months ago
      Anonymous

      >let car = Car::new()
      Or better
      let car = Default::default()

      • 2 months ago
        Anonymous

        jesus

      • 2 months ago
        Anonymous

        I'd still write that as
        let car = Car::default()

        • 2 months ago
          Anonymous

          Why would there be any different between Car::default() and Car::new()?

          • 2 months ago
            Anonymous

            Car::new() will normally accept parameters and initialize the struct with those values, Car::default() will initialize a struct with default values.

          • 2 months ago
            Anonymous

            I don't see why new() with zero parameters should do anything differently than default().

          • 2 months ago
            Anonymous

            Coomstructors were a mistake. You have literal Java brainrot.

          • 2 months ago
            Anonymous

            Neither of these are constructors. What's your point?

          • 2 months ago
            Anonymous

            >What's your point?
            That you're trying to force constructor semantics into everything since it's all your sorry ass has ever seen.
            >why have different functions that do clearly different things instead of one function that does different things based on the arguments passed
            >t. brainwormed C++ victims

          • 2 months ago
            Anonymous

            >that do clearly different things
            That's exactly the question I'm asking. It's not clear at all.

            What should an unparameterized new() do except initialise the struct to some sensible default? Is it not common to have a 0-arg new() function?

          • 2 months ago
            Anonymous

            Best option: don't have an unparameterized new at all.

          • 2 months ago
            Anonymous

            Okay, so it isn't idiomatic to have 0 arg new(). That's all I was asking.

          • 2 months ago
            Anonymous

            Not necessarily, String, Hashmap, and Vec all have empty new constructors. :/

          • 2 months ago
            Anonymous

            He is talking bullshit. It's perfectly idiomatic go have 0-arg new, many structures in stdlib do this.
            Another reason for that is that you don't have to import Default trait into scope to use new method. default is usually a part of trait but new is a method of a struct itself.

          • 2 months ago
            Anonymous

            They're basically constructors.

            Why would there be any different between Car::default() and Car::new()?

            They're not different, it's just a weird thing with rust. Default can be nice for deriving if you want to quickly construct something though.

          • 2 months ago
            Anonymous

            I don't see why new() with zero parameters should do anything differently than default().

            They have a little different meaning.
            Foo::new(...)
            >implemented on the struct itself
            >can accept arguments
            >usually the primary way of creating a new instance(aka main constructor)
            Default::default()
            >implemented as part of the Default trait, not the struct implementation
            >doesn't accept any arguments(akin to C++ default constructor)
            >can be automatically derived using Derive macro(if all the struct members also implement Default trait)

            If your main factory method/constructor doesn't take any arguments, you usually make Default::default() just call Foo::new()
            >Why bother?
            Because it allows you to derive Default for the structure that contains Foo as a field.

          • 2 months ago
            Anonymous

            new() can have arbitrary parameters, while default() never takes parameters.
            new() can have an arbitrary return type (e.g. Option or Result), while default() always returns the exact type it's implemented on (and thus should/must be infallible.)
            If new() has no parameters and returns the exact type it's implemented on, it's usually the same as default().
            When new() and default() are the same, you'd normally use new() when working with a concrete type, and default() when working with generic types (with the bound T: Default)

            He is talking bullshit. It's perfectly idiomatic go have 0-arg new, many structures in stdlib do this.
            Another reason for that is that you don't have to import Default trait into scope to use new method. default is usually a part of trait but new is a method of a struct itself.

            >Another reason for that is that you don't have to import Default trait into scope to use new method
            Default is automatically imported.

          • 2 months ago
            Anonymous

            >Default is automatically imported
            It is, huh? IDE imports them for me and I never realized that Default is available by default.

  29. 2 months ago
    Anonymous

    Car myCar=CarFactory.getNew();

  30. 2 months ago
    Anonymous

    Literally all the useful software made in the last 30 years was written in OOP. It’s the most efficient way to write large complex programs and anyone who disagrees is a delusional moron.

    • 2 months ago
      Anonymous

      OOP has been revised so much that it now basically means the same thing that FPgays were saying all along.
      i.e. shallow and wide hierarchies, interfaces and composition over implementation inheritance, and immutable objects preferred

      • 2 months ago
        Anonymous

        This kek. It's fricking hilarious. A pOOP cultist coworker recently told me that anonymous functions are a pOOP pattern akchually.

        • 2 months ago
          Anonymous

          OOP has always had a cope for not having first-class functions, they called it the "strategy pattern". So he's not entirely wrong, but he
          still doesn't know how stupid he is.

    • 2 months ago
      Anonymous

      Useful software like LLVM, Spark, JAX? It's mostly functional.
      >BUT MUH GUIS
      lmao shut up boomer

      • 2 months ago
        Anonymous

        >It's mostly functional.
        LLVM is definitely OOP inside. They might be doing functional things with the objects, but they definitely are using objects.

  31. 2 months ago
    Anonymous

    var carFactory = new CarFactory();
    var car = carFactory.makeCar();

    Am I doing good Saar?! That is clean code right!?

    • 2 months ago
      Anonymous

      Dumbass.

      • 2 months ago
        Anonymous

        I knew I forgot the AbstractFactory! Thank you saar!

      • 2 months ago
        Anonymous

        >t. butthurt saaar

    • 2 months ago
      Anonymous

      I only program casually but I've only ever used a factory model a single time, is it really that widely used? Particularly with no arguments, I would think the only use for a factory would be to create the correct class based on some input.

      • 2 months ago
        Anonymous

        Yes, but not like that. Anon doesn't understand the thing he's making fun of.

    • 2 months ago
      Anonymous

      CarFactory is supposed to be static you moron

      • 2 months ago
        Anonymous

        Not always.

    • 2 months ago
      Anonymous

      >using a factory to create a generic object
      ngmi

  32. 2 months ago
    Anonymous

    def car

    groovy saves the day once more

  33. 2 months ago
    Anonymous

    my other car is cdr, b***h.

    • 2 months ago
      Anonymous

      heheheheh

  34. 2 months ago
    Anonymous

    >thinks he's too smart for oop
    >doesn't even know what dependency injection is or why it's done

    • 2 months ago
      Anonymous

      it's stupid and it's bullshit

    • 2 months ago
      Anonymous

      >global state
      Disgusting

      • 2 months ago
        Anonymous

        Lowest IQ post ITT

    • 2 months ago
      Anonymous

      Why would I inject dependencies? I'm no drug addict or a troony.

    • 2 months ago
      Anonymous

      >dependency injection
      don't you ever talk to me again you filthy pajeet

    • 2 months ago
      Anonymous

      have a nice day nocoder

  35. 2 months ago
    Anonymous

    var car := Car();

  36. 2 months ago
    Anonymous

    (shadow 'car)
    (setf (symbol-function 'car) #'cl:car)
    (defstruct car car)
    (declaim (car car))
    (defvar car #s(car))
    (defvar cars (list #s(car car car) #s(car*~~
    (list (car-car car) car (car cars))

  37. 2 months ago
    Anonymous

    car_t * mine = malloc(sizeof *mine)

    • 2 months ago
      Anonymous

      You're doing it wrong.
      If it's a struct you're free to malloc it and access its members. If it's typedef'd you should stick to the API. Only use typedefs when you want to declare an ADT.

      • 2 months ago
        Anonymous

        fair enough.
        I was copying OP's new, although in that case I probably should've gone with calloc

      • 2 months ago
        Anonymous

        >Only use typedefs when you want to declare an ADT.
        What the frick are you talking about?

        • 2 months ago
          Anonymous

          https://en.wikipedia.org/wiki/Abstract_data_type
          You don't know what a FILE* is and you don't malloc or dereference it. You use fopen, fclose and the other stdio.h functions.

          • 2 months ago
            Anonymous

            My bad, thought you were talking about algebraic data types.

    • 2 months ago
      Anonymous

      malloc is the devil (moloch) and I refuse to use dynamic memory allocation

  38. 2 months ago
    Anonymous

    Car c = new()

  39. 2 months ago
    Anonymous

    struct Car *car = car_create();
    This is the only way.

    • 2 months ago
      Anonymous

      Poo poo

    • 2 months ago
      Anonymous

      meh, I don't like camel case

      • 2 months ago
        Anonymous

        CamelCase for type names
        SCREAMING_SNAKE_CASE for macros
        snake_case for everything else

        • 2 months ago
          Anonymous

          >CamelCase for type names
          how about snake_case_t

          • 2 months ago
            Anonymous

            _t is technically reserved for usage for the C language spec, at least so I've heard.
            I dislike typedefing structs (in cases where I access fields of or have ownership of). All snake_case becomes bit of a snake hazard to read, even with the "bad practice" _t. Having some case contrast is good.
            I also like that it tends to separate my own types from library/c types, as most of them are sanke_case_t. Consistently inconsistent. Just the way I like it. A C developer needs to embrace some chaos and undefined behavior.

          • 2 months ago
            Anonymous

            >_t is technically reserved for usage for the C language spec, at least so I've heard.
            only for identifiers beginning in uint or int, exclusively defined in stdint.h
            posix reserves *_t identifiers generally, but hoo cares about posix

          • 2 months ago
            Anonymous

            Right that's how it was
            > but hoo cares about posix
            I use posix stuff all the damn time though ...
            It also works on windows with mingw64 and such. Great for cross-platforming my stuff.

          • 2 months ago
            Anonymous

            >tfw I have to beg my coworkers to stop using _* and *_t identifiers

          • 2 months ago
            Anonymous

            >_*
            C# suggests this for private fields of a class, it works I guess.

          • 2 months ago
            Anonymous

            a single underscore is fine.
            it only becomes a problem when using _ with a following capital letter.

            Right that's how it was
            > but hoo cares about posix
            I use posix stuff all the damn time though ...
            It also works on windows with mingw64 and such. Great for cross-platforming my stuff.

            >I use posix stuff all the damn time though ...
            well, same. I use Debian, thus glibc, thus a (mostly)posix-compliant libc.
            still, *_t is such a nice identifier suffix that I ignore that piece of posix

          • 2 months ago
            Anonymous

            _t isn't bad because it lets you know on sight that it's a type name. Useful for autocomplete suggestions. You could take it to the extreme and do something like Hungarian notation, which is dogshit, but anything taken to the extreme is usually a bad sign.

          • 2 months ago
            Anonymous

            >_t isn't bad because it lets you know on sight that it's a type name
            It's in the place where types go, of course it's a fricking type.

            It's a waste of two characters in any case. Just use UpperCamelCase for types, ehz pehz.

          • 2 months ago
            Anonymous

            As I said, it's for autocomplete. Easy to find _t. You first need to put the types into the place that they normally go.

          • 2 months ago
            Anonymous

            >autocomplete
            Autocomplete is a sign you're being too verbose. If it takes you longer to type out your code than it does to think of it, then you have a serious problem, and adding _t spam and autocomplete/copilot noncery is not the solution.

            Besides, if you wanted to intellisense that shit out, surely it should be a PREFIX, so when you type "t_", you get a big list of types?

            Anyway what I'm trying to say is that you should drink as much bleach as possible, immediately.

          • 2 months ago
            Anonymous

            >A C developer needs to embrace some chaos and undefined behavior.

          • 2 months ago
            Anonymous

            https://i.imgur.com/pjANkb5.jpg

            >A C developer needs to embrace some chaos and undefined behavior.

            >C developer needs to embrace some chaos and undefined behavior.
            more like you losers need to find a job, because if I wrote code that "embraced" chaos in embedded military hardware I'd be fired ASAP

          • 2 months ago
            Anonymous

            Yes but the U.S. military have been embracing literal cutoff-wiener-troon craziness for decades now. Why would this make it any difference.

          • 2 months ago
            Anonymous

            >cutoff-wiener-troon craziness for decades now
            The US military has none of those issues. Every piece of hardware abides by the CMOSS and software is written with safety in mind following the latest standards.

          • 2 months ago
            Anonymous

            Yes ... and yet ... no. Xe’s undercarriage hardware hardly meets CMOSS requirements

          • 2 months ago
            Anonymous

            It truly makes me laugh, the idea that these troons have in their heads that modern meme languages like Rust are the only way to write safe code. Sure, a few open sores projects have converted several tiny components of their software to Rust for the sake of publicity (though they'll probably revert it back to C/C++ when it inevitably becomes annoying to maintain in conjunction with the other 99% of the codebase), but still to this day, almost all real world, mission-critical software is written in "old", "unsafe", "legacy" languages, and any organization that actually takes itself seriously (such as the U.S. military) would never even consider inserting a meme language into their workflow.

            It's almost as if, if you're not a moronic troon, you can and will avoid memory management issues when the software you're writing is important.

          • 2 months ago
            Anonymous

            Nice copypasta

          • 2 months ago
            Anonymous

            But think of the money the industrial military complex and megacorporations can save, if we can find a way to get away with letting pajeets, women, and "women" write mission-critical code

          • 2 months ago
            Anonymous

            The military uses Ada don't they? At least DOD, Ada is kind of like a derivative C

          • 2 months ago
            Anonymous

            Sort of, but not really. The modern military is heavily privatized and private sector doesn't want to use niche languages (aside from its own NIH abominations).

          • 2 months ago
            Anonymous

            The Ada requirement didn't actually last very long before they relaxed the rules to allow basically anybody to use anything
            Lockheed-Martin got permission to write all the F-35 software in C++, and that worked out greaSegmentation fault (core dumped)

          • 2 months ago
            Anonymous

            Dumbest pattern ever.

            size x{};

            OH NO WHAT COULD THAT POSSIBLY BE BEFORE THE VARIABLE NAME!?

            size_t x{};

            Oh it's a type! That was scary.

    • 2 months ago
      Anonymous

      >not passing in allocator
      it's shit

      • 2 months ago
        Anonymous

        I usually configure that with macros

        • 2 months ago
          Anonymous

          >I was just pretending to be moronic

          • 2 months ago
            Anonymous

            Which is cleaner? Having defined this with a macro once, or having to pass an allocator to every single call to the module/library, and suffering whatever overhead comes from being a dynamic function call?

          • 2 months ago
            Anonymous

            Which is cleaner? Having defined this with a macro once, or having to pass an allocator to every single call to the module/library, and suffering whatever overhead comes from being a dynamic function call?

            Oh also, passing a function doesn't let you do custom runtime checks and debugging as nicely as you could do with making your allocator itself a macro.

  40. 2 months ago
    Anonymous

    public static final Car car = new Car(); // create new car

    sirs?

  41. 2 months ago
    Anonymous

    Make code the DA approved way. Look at sillytaven, authentic, free as in freedom, quality DA software made last year with ZERO pOOP! It features several 10,000 loc js files with free floating functions and variables, and runs worse than a AAA game despite being a simple web interface

  42. 2 months ago
    Anonymous

    Java really do be like
    SimpleBeanFactoryAwareAspectInstanceFactory

  43. 2 months ago
    Anonymous

    Car car;

  44. 2 months ago
    Anonymous

    var car Car
    or
    car := Car{}
    or
    var car = Car{}
    also
    car := new(Car) // declares a pointer of type Car with everything zero, usually zero value of pointer is null

  45. 2 months ago
    Anonymous

    Car car=new V8Car();

    Now what

  46. 2 months ago
    Anonymous

    OOP is fine with a few big classes where data encapsulation is needed anyway, you can use classes instead of structs. Using OOP with trivial classes whose state consists of a couple of variables is usually moronic.

  47. 2 months ago
    Anonymous

    Everything good about OOP was already invented in the 1960s, and we called it modular programming. You can do it with C and structs.

    What post-90s OOP is, it's an encapsulation of these old good ideas, but with dozen (back then) largely untested new ideas which sounded good on paper, such as encapsulating (mixing) data&logic, inheritance, etc.
    These new untested ideas turned out to be disastrous, like any new untested and unproven ideas tend to be.

    • 2 months ago
      Anonymous

      >real OOP is actors with message passing like Alan Kay intended
      >no, real OOP is logicless structs!
      You boys a like a cult.

  48. 2 months ago
    Anonymous

    This is why java was never an option for a white man.

    • 2 months ago
      Anonymous

      What's the white man language? Lately Ive sene a lot of mentally ill white men writing in rust tho hmm. I tried that one, syntax was dogshit never used it again

      • 2 months ago
        Anonymous

        >What's the white man language?
        Black troons obsess about that shit

      • 2 months ago
        Anonymous

        Common Lisp

      • 2 months ago
        Anonymous

        clojure

        • 2 months ago
          Anonymous

          Sir how do I redeem clojure in java?

  49. 2 months ago
    Anonymous

    In C++ its just

    Car car;

    • 2 months ago
      Anonymous

      only for automatic objects, THOUGH

  50. 2 months ago
    Anonymous

    OOP does not a class make

  51. 2 months ago
    Anonymous

    New old = new Old();

  52. 2 months ago
    Anonymous

    (make-instance 'car)

  53. 2 months ago
    Anonymous

    I can't believe nobody has pointed out that this is completely fricking wrong.
    Car* car = new Car();

    • 2 months ago
      Anonymous

      No, except for missing ;, the code is completely fine in jawa saar

  54. 2 months ago
    Anonymous

    Car car = new();
    var car = new Car();
    //choose your way

  55. 2 months ago
    Anonymous

    auto car = new Car();

  56. 2 months ago
    Anonymous

    >new
    No.

    auto car{std::make_unique<Car>()};

    Unicorn initialisers are better than everything else.

  57. 2 months ago
    Anonymous

    :=

  58. 2 months ago
    Anonymous

    auto Car = make_shared<Car>();

  59. 2 months ago
    Anonymous
  60. 2 months ago
    Anonymous

    Car car = Car.CreateCar("car");

    • 2 months ago
      Anonymous

      Could do with some comments.

    • 2 months ago
      Anonymous

      correct answer

  61. 2 months ago
    Anonymous

    interface Car {
    void drive();
    }

    class BasicCar implements Car {
    @Override
    public void drive() {
    System.out.println("driving");
    }
    }

    interface CarFactory {
    Car createCar();
    }

    class BasicCarFactory implements CarFactory {
    @Override
    public Car createCar() {
    return new BasicCar();
    }
    }

    public class Main {
    public static void main(String[] args) {
    CarFactory carFactory = new BasicCarFactory();
    Car car = carFactory.createCar();
    car.drive();
    }
    }

    • 2 months ago
      Anonymous

      Where's your @Bean? Your @Data?

    • 2 months ago
      Anonymous
    • 2 months ago
      Anonymous

      I fricking hate factories.
      They make reading and debugging code a pain in the ass.
      There are use cases for them but shit's often misused.

      • 2 months ago
        Anonymous

        >handmade Black person

    • 2 months ago
      Anonymous

      Our [former] lead developer used to program like this.
      I feel sorry for the team whose codebase he shits into now.

    • 2 months ago
      Anonymous
  62. 2 months ago
    Anonymous

    in haskell this is just
    data Car = Car

    • 2 months ago
      Anonymous

      That's a definition for Car, an instantiation would be car = Car

    • 2 months ago
      Anonymous

      Does anyone even use Haskell seriously anymore?

  63. 2 months ago
    Anonymous

    ns_car_t car = {0};

  64. 2 months ago
    Anonymous

    final CarFactoryServiceImpl carFactoryService = getService(CarFactoryService.class);
    final CarFactory carFactory = carFactoryService.newFactoryInstance();
    carFactory.setOption(CarFactoryOptions.WHEELS, 4);
    carFactory.setOption(CarFactoryOptions.FUEL_ENGINE, Boolean.TRUE);
    carFactory.setOption(CarFactoryOptions.SOME_IRRELEVANT_LEGACY_OPTION,8001L);
    final CarBuilder carBuilder = carFactory.builder();
    final Car car = carBuilder
    .color(CarColor.builder().red(255).green(0).build())
    .build();

    • 2 months ago
      Anonymous

      Ranjeet-certified

    • 2 months ago
      Anonymous

      >service
      >factory
      >builder
      We're getting there. All that is missing is Spring

    • 2 months ago
      Anonymous

      Enterprise grade sirs

    • 2 months ago
      Anonymous

      I would use a factory builder with a fluent interface and not use Boolean constants for no fricking reason, but this is actually pretty good for making whatever.

      // Keep the interface type, not the impl type if you're going to interface your services.
      final CarFactoryService carFactoryService = getService(CarFactoryService.class);
      final CarFactory carFactory = carFactoryService.builder()
      .withOption(CarFactoryOptions.WHEELS, 4)
      .withOption(CarFactoryOptions.FUEL_ENGINE)
      .withOption(CarFactoryOptions.SOME_IRRELEVANT_LEGACY_OPTION, 8001L)
      .build();
      final Car redAmericanCar = carFactory.builder()
      .color(CarColor.builder().red(255).green(0).blue(0).build())
      .spoiler()
      .build();
      final Car blueBongCar = carFactory.builder()
      .color(CarColor.builder().red(0).green(0).blue(255).build())
      .leftHandDrive()
      .gearbox(new Gearbox(MANUAL, 3, COLUMN))
      .build();

  65. 2 months ago
    Anonymous

    let car = Car::new()

  66. 2 months ago
    Anonymous

    Vehicle car = Car.newCar();

  67. 2 months ago
    Anonymous

    Car create car

  68. 2 months ago
    Anonymous

    auto car = make_unique<Car>();

    • 2 months ago
      Anonymous

      >=
      visibledisgust.jpg

  69. 2 months ago
    Anonymous

    I'm learning C# and I do not understand what this is supposed to be. can anyone explain in layman terms?

    • 2 months ago
      Anonymous

      read the filename

    • 2 months ago
      Anonymous

      No, commit suicide.

      • 2 months ago
        Anonymous
    • 2 months ago
      Anonymous

      >can anyone explain in layman terms?
      Yes, but I don't want to because I feel like being an butthole today

  70. 2 months ago
    Anonymous

    Swift doesn't have this issue
    let car = Car()

  71. 2 months ago
    Anonymous

    Anyone who didn't write

    Vehicle car = Car.newCar("mazda");

    Should go back to school. You can omit the interface if there's only one implementation of Car.

  72. 2 months ago
    Anonymous

    String Car;
    Car == “Hello Car!”;
    cout << Car;

  73. 2 months ago
    Anonymous

    In Java:
    CarFactory carFactory = new CarFactory();
    Car car = carFactory.makeCar();

  74. 2 months ago
    Anonymous

    CarSingleton.Car singletonCar = CarSingleton.createInstance().init().setA(a).setB(b).setC(c).shitfrickihatebuilderpatterns();

  75. 2 months ago
    Anonymous

    while (OP.hasAwiener() && OP.isAgayet())
    OP.cutOffBenis();
    else
    OP.anHero();
    xas2

  76. 2 months ago
    Anonymous

    t. first year CS student

  77. 2 months ago
    Anonymous

    >allocating objects one by one from the heap
    That's a yikeroni.

Your email address will not be published. Required fields are marked *