Reflection is sometimes a necessary evil. At least it makes it harder to abuse the class and if you do, then you are responsible if something goes wrong.
Yea, what @hydroptic@sopuli.xyz posted is actually Java
What even is the point of creating standards if you design backdoors to them
If you're building in a backdoor anyways, why would the backdoor require 5 lines of weird reflection to get the type, type info, fieldinfo with the correct binding flags, and then invoking the method?
I think it's kinda neat compared to C#, just being able to say "Ignore private/protected/internal keywords"
41 Comments
victorz@lemmy.world · 82 pts · 2y
Ha. Cause there's no getter. I get it. I think?
dohpaz42@lemmy.world · 65 pts · 2y
No you don’t; there’s no getter.
victorz@lemmy.world · 29 pts · 2y
Oh, now I get it.
Wait...
Batman@lemmy.world · 6 pts · 2y
You don't get the context of this joke
fsxylo@sh.itjust.works · 6 pts · 2y
var context = getContext();
lightnegative@lemmy.world · 3 pts · 2y
var context = RuntimeSingletonFactory.getCurrentFactory().getCurrentRuntimeSingleton().getContext()
4am@lemm.ee · 23 pts · 2y
It’s also an inside Joke
intensely_human@lemm.ee · 2 pts · 2y
And the Joker gets it, but you don’t.
sik0fewl@lemmy.ca · 69 pts · 2y
Upon reflection, I do get the joke now.
rimjob_rainer@discuss.tchncs.de · 6 pts · 2y
This one gets it
JustBrian7872@feddit.de · 47 pts · 2y
They don't call me AbstractJokerAdapterFactoryProxy for nothin'
hydroptic@sopuli.xyz · 34 pts · 2y
RonSijm@programming.dev · 16 pts · 2y
Is it Java? It looked like
Microsoft JavaC# to me...PoolloverNathan@programming.dev · 4 pts · 2y
There isn't an unnecessary level of capitalization; seems to be regular Java with Allman braces.
hydroptic@sopuli.xyz · 3 pts · 2y
rimjob_rainer@discuss.tchncs.de · 2 pts · 2y
Because C# is a Java clone
Hazzia@discuss.tchncs.de · 2 pts · 2y
hydroptic@sopuli.xyz · 2 pts · 2y
rimjob_rainer@discuss.tchncs.de · 1 pts · 2y
Reflection is sometimes a necessary evil. At least it makes it harder to abuse the class and if you do, then you are responsible if something goes wrong.
RonSijm@programming.dev · 1 pts · 2y
Yea, what @hydroptic@sopuli.xyz posted is actually Java
If you're building in a backdoor anyways, why would the backdoor require 5 lines of weird reflection to get the type, type info, fieldinfo with the correct binding flags, and then invoking the method?
I think it's kinda neat compared to C#, just being able to say "Ignore private/protected/internal keywords"
noproblemmy@programming.dev · 1 pts · 2y
If you have to cast your joke it isn't funny?
Karyoplasma@discuss.tchncs.de · 1 pts · 2y
Could just change it to public static Object GetTheJoke, no?
BassaForte@lemmy.world · 32 pts · 2y
public Joke Joke { private get; set; }Xylight@lemdro.id · 18 pts · 2y
i hate this programming pattern with a passion.
someonesmall@lemmy.ml · 26 pts · 2y
Setters and Getters?
Xylight@lemdro.id · 5 pts · 2y
yes.
someonesmall@lemmy.ml · 7 pts · 2y
So what is a better paradigm in your opinion?
Xylight@lemdro.id · 8 pts · 2y
immutable objects, i like functional programming
sudo@programming.dev · 4 pts · 2y
Immutable members. Set in constructor then read only. The Builder pattern is acceptable if you're language is an obstacle.
AVincentInSpace@pawb.social · 7 pts · 2y
found the functional programming purist
sudo@programming.dev · 1 pts · 2y
✅
Piafraus@lemmy.world · 3 pts · 2y
So do you create new objects every time you need to change state?
sudo@programming.dev · 3 pts · 2y
You avoid having mutable state as much as possible. This is a pretty standard concept these days.
Piafraus@lemmy.world · 2 pts · 2y
Can you please give me an example - let's say I have a big list of numbers and I need to find how many times each number is there.
I would expect a mutable dictionary/map and a single pass through. How would you do that without mutable datastructure?
purplemonkeymad@programming.dev · 3 pts · 2y
Where getter?
mexicancartel@lemmy.dbzer0.com · 5 pts · 2y
Well you wouldn't get it
intensely_human@lemm.ee · 4 pts · 2y
Java?
JayDee@lemmy.ml · 14 pts · 2y
Is it possible to get the joke at runtime using the spectre exploit?
coloredgrayscale@programming.dev · 5 pts · 2y
Not required. Looks like Java, just use reflection.
Kolanaki@yiffit.net · 7 pts · 2y
Stop making private jokes and start posting them publicly. We wanna laugh too, ya selfish bastid.
reverendsteveii@lemm.ee · 4 pts · 2y
throw new SameJokeException();
BassaForte@lemmy.world · 2 pts · 2y
LinearArray@programming.dev · 1 pts · 2y
now i get it, do i?