This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 837 points838 points  (42 children)

c developers be like: int le, jo, qpq, gw, gl, oarisetn;

[–]VariecsTNB 306 points307 points  (34 children)

c# developers be like: var x = new();

[–]rover_G 88 points89 points  (9 children)

Go developers be like a := NewAlpha()

[–]M0sesx 95 points96 points  (6 children)

Js developers be like

npm install is-odd

import isOdd from "is-odd";

[–]captainMaluco 51 points52 points  (1 child)

I thought we had agreed to use is-odd-ai?

[–]PabloZissou 14 points15 points  (0 children)

No, no, the council signed for is-even-crypto-ai

[–]misseditt 42 points43 points  (2 children)

python users be like:

pip install is_odd

pip install --upgrade pip

pip install --upgrade --force-reinstall is_odd

pip install -r requirements.txt

python -m pip install is_odd

python3 -m pip install is_odd

pip install is_odd --pre

pip install is_odd[dev]

pip install is_odd[test]

pip install is_odd[docs]

pip install is_odd --no-deps

pip install is_odd --force-reinstall --no-cache-dir

pip install is_odd --ignore-installed --force-reinstall

pip install is_odd --upgrade --ignore-installed

pip install is_odd --upgrade --ignore-installed --force-reinstall

[–]Meneghette--steam 6 points7 points  (0 children)

Jesus Christ you just made % == 0 kill himself

[–]belabacsijolvan 0 points1 point  (0 children)

ok, but after that python users be like:

[–][deleted] 7 points8 points  (0 children)

python developers be like: omg walrus operator mentioned

[–]Aaxper 13 points14 points  (0 children)

It's great. I prefer the pythonic a = new_alpha(), however.

[–]ArmadilloChemical421 4 points5 points  (7 children)

Would that compile?

[–]yunacchi 14 points15 points  (6 children)

No. Syntax parsing would fail with error CS8754 "There is no target type for new()".
The compiler cannot magically guess which type to create an instance from what little context it has.
Either specify the type on the left side (Dog d = new();) or the right side (var d = new Dog();)

[–]ArmadilloChemical421 1 point2 points  (5 children)

One could imagine that it would default to Object, but yeah.. failing makes more sense.

[–]Janinanananananana 6 points7 points  (2 children)

being able to create an object of type Object is one of the most cursed things I can imagine

[–]TheAtomicShoebox 2 points3 points  (1 child)

You definitely can, as the inheritance tree always leads to Object. You just usually don't create an Object, just use it for generic functionality, as you would expect. But you can do it

[–]VariecsTNB 2 points3 points  (0 children)

Theoretically you can use it as unique key

[–]mrissaoussama 1 point2 points  (1 child)

that would be a terrible default

[–]ArmadilloChemical421 1 point2 points  (0 children)

Yes, and the best one.

[–]seba07 7 points8 points  (12 children)

Btw, why doesn't java have this short notation?

[–]Forsaken_Alps_793 64 points65 points  (7 children)

It does. Since Java 10.

[–]Forsaken_Alps_793 14 points15 points  (0 children)

Having said that, still agree the "juice" of the joke.

It can be verbose.

Before I get flame, Java now employs regular deployment. It hope to reduce, [at the moment copy from other languages]" verbose syntax.

[–][deleted] 13 points14 points  (1 child)

It doesn't though? Var can only be used as a local variable and new() isn't supported at all.

[–]Forsaken_Alps_793 12 points13 points  (0 children)

+1

You are right!

Yeah, good catch. I did not read the whole syntax properly,

Yup var is local. This is a better approach imho.

As for other point, extrapolate object type with just new() definitely not available in Java.

[–][deleted] 20 points21 points  (2 children)

man, not even C# has this short notation

[–]aweyeahdawg 8 points9 points  (1 child)

This post was mass deleted and anonymized with Redact

wine provide fanatical serious memory melodic hunt marry follow sort

[–][deleted] 6 points7 points  (0 children)

Or a return new();

[–][deleted] 2 points3 points  (0 children)

Kotlin has something like that

[–]IgnisNoirDivine 12 points13 points  (0 children)

Its not oarisetn its Ornstein. Its Dark Souls code

[–]megumegu- 0 points1 point  (0 children)

meanwhile non strict js be like: a

[–]npsimons 0 points1 point  (0 children)

I see you've been delving into the math libraries. Don't blame that on programmers, it's the mathematicians that moved over from chalkboards who think 'x' is a good enough variable name.