Screw that, this is great. I love that we were in that 'generation' that got to self-learn programming through passion projects like Minecraft modding. I remember starting to learn how to code because I wanted to make a pets mod in 2012 when I was literally 12. Ultimately that set me on the path that I am on today. This is great code for the situation you wrote it in!
And for current projects, we have paired programming AKA reverse plagiarism where you convince someone else to type your bad ideas and commit them in their name.
For Windows Forms - I just experimented a lot (and lots of Google) For Minecraft's authentication mechanism - there's this wiki that explained the entire flow from A to Z (keep in mind they changed the flow a whole lot since they now use Microsoft accounts)
I still have a function in production called “bullshit_payload_detector” that checks HTTP payload for invalid types in fields. It logs to Splunk so every now and then someone will send me a log message and laugh
A custom launcher for Minecraft. Usually to load separate modpacks and such and have different 'profiles'. A lot of it is now in the official Minecraft launcher.
It used to be that loading different minecraft versions required a lot of delving into AppData and copy and pasting files. Custom Minecraft launchers used to automate that.
At least I assume that's the kind of thing OP is referring to
Nothing terrible, but there could be some improvements applied to make code more "enterprise-grade". For example instead of serializing and deserializing JSON manually, OP could used reflection to directly serialize / deserialize JSON using typed objects. Aside from that, without general context it's hard to say something about the code.
Use string.IsNullOrWhiteSpace(x) or string.IsNullOrEmpty(x) instead of manually checking x == ""
Use a JSON serialization library like System.Text.Json (included in .NET Core and above) or Newtonsoft.Json, this way you can write actual classes instead of manually creating JObjects etc, and just call JsonSerializer.Serialize() instead
MessageBox.Show() shouldn't be used to show messages/errors (but this is up to personal taste, really)
These days you can use Microsoft's IServiceCollection to resolve BL-related services as opposed to having it all statically typed in classes such as Processing, WebStuff, or Variables
And of course, the variable naming is.. childish :)
Also that try/catch block is catching the wrong exception. The response was already checked for null, so the only remaining issue would be a parse error.
222
u/Ilan321 Feb 20 '22
To be fair, I was 15 and had little-to-no experience in C# :)
12
u/misterrandom1 Feb 20 '22
Revisiting code from years ago is a very brave move.
3
u/NoNeedleworker531 Feb 21 '22
where did you learn how to do it?
49
u/penguinmandude Feb 20 '22
Oh man I’m gonna start leaving
// this is epiccomments all over my code. Wonder if it’ll get passed review58
u/gobermouche Feb 20 '22
// this is epic.
50
u/SuccessPastaTime Feb 20 '22
jsonShit. I still use variable names like that and I’m 31. 😀
22
u/Knuffya Feb 20 '22
"jsonShit"
41
u/pPandR Feb 20 '22
I love the TODO at the bottom
12
u/RaymondTracing Feb 20 '22
Why is this in bad code? this is epic!
7
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Feb 20 '22
Image Transcription: Code
[The cropped top of another line is visible below, indicating more code is present.]
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
6
u/Espiring Feb 20 '22
Well, was it secure 🧐
4
u/Willinton06 Feb 20 '22
Back in the day I wrote my own Json parser cause I didn’t know there was a standard one
3
u/benwang Feb 21 '22
For me every code have readability is good, I’ve seen worse. This is good.
2
u/circuit10 Feb 20 '22
Doesn’t look that bad
2
u/Kilobyte22 Feb 20 '22
I've seen far worse, even in production.
2
u/yIsSaT Feb 21 '22
The jsonShit
1
u/iiMoe Feb 20 '22
Wut is a Minecraft launcher ?
1
u/CoolAbhi1290 Feb 20 '22
// this is epic.1
u/BaseProfessional1113 Feb 21 '22
// this is epic
Exactly how i felt when i parsed my first json
1
u/tehtris Feb 21 '22
Yea. If it got the job done who cares. This doesn't look bad, it just looks novice.
1
u/BigFuckingCringe Feb 21 '22
jsonShitended me0
u/[deleted] Feb 20 '22
[deleted] — view deleted comment