Car car = new Car()

>Car car = new Car()

Attached: xY2xDxo.jpg (811x1082, 176K)

Other urls found in this thread:

benchmarksgame-team.pages.debian.net/benchmarksgame/faster/csharp.html
yegor256.com/2015/03/09/objects-end-with-er.html
twitter.com/NSFWRedditImage

>not being able to tell from a glance that this is creating a new Car object named "Car"

fuck OOP

Car car2 = new Car(car)

C++ doesn't have this prob-
auto car = new Auto;

This is why I love C#. you only have to call the class name on the right side of initialization:

var car = new Car();

C# is for gays

>implicit typing

nigger

Is this board really filled with primjeets?

plees to be using jawa

var data = new Dictionary()

>pretending that's how the language is commonly used

[/code]
Old New = new Old()
[/code]

Attached: konata thinks.jpg (263x192, 13K)

Does C# have type erasure?
If it does, then having the type info on the left makes more sense, since the generic type makes no bearing on the object under construction, only to the caller.

What a fucking nigger

Imagine actually being proud of being an in#Cel

>nigger
>has a well paying job developing with C#
wew

also can't use var on property declarations for some reason so I have shit like
public Dictionary CalculatedTechnicals { get; set; } = new Dictionary();
in my code

You can do this in Java 10+ too sweetie

Poo.init()

>(car (cdr Car))

What if I want manual?

But that's not what it's doing. It's creating a new Car named "car" (lowercase).

>let c = Car

new Car

You language faggots make everything complicated lmao.

Dog dog = new Dog();
mindblown

this. the fact that you can create infinite cars makes OOP great

local car = Car{}

C# doesn't use type erasure. Generics are in actually the run time.

The coolest thing about this actually trying to explain this to students who are just getting into OOP and watch their faces in dread and confusion.

Attached: 1533779051888.png (810x793, 576K)

>Generics are in actually the run time.
EWWWWWWWWWWWWWWW WTF
Imagine the amount of fucking overhead ewwwww

>I love C# because it has $(trivial type inference available in any language worth shit in 2018).
Stupid nigger

I'm not a programmer but how could you know what that's doing if you haven't seen what the Car-class actually is?

dumb frog poster

Car car();
Car *car = new Ferarri();

C++ is best++

Attached: DmmW8kMXgAoOCVd.jpg (750x563, 34K)

Not best practice you pajeet

(int, int, int, (int,int,(int,int))) function(){
return (1,2,3,(4,5,(6,7)));
}

>Car car();
>actually impossible to figure out if it's function or variable declaration

C++ at its best that's for sure.

#include "car.h"
#include

using namespace std;
Class car
{
private:
void engine ();
void transmission();
void ecu();
void fuelPump();
void waterPump();
void timing();
void fuckGF();
void speedometer();
public:
void fillGas();
void lockDoor();
void openDoor();
string color;
string colorChoose(string);
void changeTire();
void changeOil();

};

#include

struct Car {
void car();
};
void Car::car() {
std::cout

Ha, best you too it!

You can only do this for custom data types inside of functions, is it the same as well in c#?

I love me some pointers.

It should be "Car *carPointer = new ~~~~"

auto car = new Car();

>objects

>auto mobile

>using Fortran

>Imagine the amount of fucking overhead ewwwww
Lel it's exactly why .net generics have higher performance.

>Car car = CarFactory.newInstance();

Attached: f93.png (898x790, 279K)

Ffffffuck you

Fag OP = new Fag();

Needs to be a pointer.

Fag *finger[magicNumber];

Fag *fagPointer = new faggot();

What a fucking nigger

That is why .Net performance is worse

That factory better be a singleton.

benchmarksgame-team.pages.debian.net/benchmarksgame/faster/csharp.html

why?

If you don't call everything by the same name OOP will be less likely to make you want to blow your brains out.

Being more cleaver than me.

>c shart
>braindead retarded
Nothing new here

(car Car)

>Car car = new Car()

using namespace Car;

You can't.

You would need to see the constructor for Car with the signature Car(Car car) to see what it actually does.

It's likely it takes the variables from the car argument and applies them to the new instance car2.

car: Car = Car::new();

Vehicle car = VehicleFactory
.setVehicleClass(VehicleClasses.CONSUMER)
.setVehicleType(VehicleTypes.SEDAN)
.setWheelDrive(VehicleWheelDriveTypes.FWD)
.setVehicleEngine(VehicleEngines.V4)
.setVehicleDoors(VehicleDoorNumbers.4)
.setVehicleMake(VehicleMakers.HYUNDAI)
.setVehicleModel(VehicleModels.ACCENT)
.setVehicleColor(VehicleColors.FF0000FF)
.setVehicleYear(VehicleYears.2006)
.newInstance();

Should be called builder tbqh

Why not just

Car *car = malloc(sizeof(Car)); is the only correct solution

Attached: 1479363468710.jpg (512x512, 18K)

this:

Because the class/API should have documentation telling you what it does so you can use it without going through every single line of the Car class

get rekt

fucking nigger
Car *car = malloc(sizeof *car);

yegor256.com/2015/03/09/objects-end-with-er.html

Car *car->init = &init_this(car);
car->init();

Attached: 1532755470056.jpg (644x616, 69K)

car->delete_this(car);

Attached: 28gy0q.jpg (530x298, 37K)

No. This guy couldn't be more retarded if Charles II buttfucked himself and the child sprang from his asshole fully clothed in additional chromosomes.
He's oversimplifying and ignorant fucks are going to write shitty stupid code trying to keep in line with his "principle".
Objects that accept a variety of other objects and act as a "job title"-er abstraction over them are fucking great for encapsulating generic workflows over plugin-able objects. They make reasoning simple and pull complex tasks out into it's own specialized code.
Yeah, his example of sorted() is better named sorted than sorter, but if he was using an interim object to create that sorted list by adding items from various streams to it, guess what, now he needs a sorter(), because .add( whatever )'ing isn't something you can do on a sorted() instance, because that doesn't fit. Then you can .get_sorted() or whatever and pull your sorted() out of the sorter()
But fuckers like you are going to swallow his bullshit whole and post links to it that I'm then obliged to read and recant
So fuck him

code nazis should go off themselves.

imposing your preferences on others is the exact definition of what a modern nazi is .

Attached: 46a.png (645x729, 97K)

struct Car *car = malloc(sizeof(*car))
Hiding structs, hiding pointers and omitting sizeof parenthesis are for weenies

choose Car or struct car, but don't use struct Car. That's just ugly.

Omitting parens for a sizeof avoids syntactic noise, and it highlights the difference between an expression and a typename. It's good style.

THIS:

you probably use vi instead of emacs, too

I don't agree with his "principle" but the obvious retort to your argument would be to use sort() rather than sorter(), makes perfect sense both ways.

if your code is relatively understandable by the average programmer, you don't need to bother with specifics.

fucks who take the time to make these "principles" are clearly not working enough.

You'd use "sort()" to create an object you can add items to from various streams?
>you don't need to bother with specifics
"naming things isn't important. I name my variables random names and names from the big bang theory because its funny and maintainability is a meme"

What if you want to change your malloc implementation or use a memory arena? You would have to go back and change everything.

Also, I seriously hope you're not doing thousands of individual mallocs like this because that's slow.

Attached: 1536624729643.jpg (762x900, 161K)

Yeah, you'd be much happier if you added a template parameter for an allocator type you can inject. c:

If you have thousands of points in your code where you're allocating, you probably should have structured your shit better so you could allocate arrays of data structures early on and then designate them to tasks or resources or whatever.
If a program has to malloc much past initialization, it's underspecified. There are exceptions, but they're fewer than not.

>templates
Just a wrapper function would be enough.

Attached: mig.jpg (300x298, 21K)

wow so mature

Attached: vVkoPPU.gif (250x250, 992K)

Nice

inefficient

You can change it once you're sure which allocator you're using.

Attached: mo.gif (598x598, 1.68M)

#define CAR_PLZ() Car *c = malloc(100000000); // enough memory to hold a very large car, even a truck

int main(int argc, char *argv[]) {
CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ() CAR_PLZ()
return 0;
}

do { Car * c = malloc(100000000); } while (0), you fucking pleeb

>leaking memory
lmao

Attached: PSX_20180912_120748.jpg (413x416, 38K)

>Ferarri

kek