Sjmarf to Programmer Humor@programming.dev • 1 year agoYou wouldn’t get itsh.itjust.worksimagemessage-square44fedilinkarrow-up1435arrow-down139
arrow-up1396arrow-down1imageYou wouldn’t get itsh.itjust.worksSjmarf to Programmer Humor@programming.dev • 1 year agomessage-square44fedilink
minus-square@RonSijm@programming.devlinkfedilink16•edit-21 year agoIs it Java? It looked like Microsoft Java C# to me… public static void Main(string[] args) { var meme = new Meme(); var joke = GetTheJoke(meme); } public static Joke GetTheJoke(Meme theMeme) { var memeType = typeof(Meme); var jokeField = memeType.GetField("Joke", BindingFlags.NonPublic | BindingFlags.Instance); return (Joke)jokeField.GetValue(theMeme); }
minus-square@PoolloverNathan@programming.devlinkfedilinkEnglish4•1 year agoThere isn’t an unnecessary level of capitalization; seems to be regular Java with Allman braces.
minus-square@hydroptic@sopuli.xyzlinkfedilink3•1 year agoFrankly it’s been a while since I wrote either one. I just assumed Java because of the naming convention, and I didn’t see anything I took as obviously un-Java in the class definition
minus-square@noproblemmy@programming.devlinkfedilink1•1 year agoIf you have to cast your joke it isn’t funny?
minus-squareKaryoplasmalinkfedilink1•1 year agoCould just change it to public static Object GetTheJoke, no?
Is it Java? It looked like
Microsoft JavaC# to me…There isn’t an unnecessary level of capitalization; seems to be regular Java with Allman braces.
Frankly it’s been a while since I wrote either one. I just assumed Java because of the naming convention, and I didn’t see anything I took as obviously un-Java in the class definition
Because C# is a Java clone
If you have to cast your joke it isn’t funny?
Could just change it to public static Object GetTheJoke, no?