Definitely an uncomfortable feeling for sure, but it's nice that you learned from your past.
Many people get trash talked for bad code they post here (despite the subreddit being "bad code"), so I try my best for shifting the focus of the OPs towards the positive changes they made and can see that their code is bad and why it is bad.
Edit: fixed my phone butchering their into there and code to core.
I've used tic-tac-toe for over 20 years as my learning program of choice. I knew what this code was for immediately, lol. It's a really great program to try out new languages and frameworks with because it has lots of interesting optional complexity. Using the same program gives a good chance to compare how things are done differently in different systems.
When you stop looking back on your old code in horror it means you've stopped learning. Stick with it!
Transcriptions can be useful for a wide range of people;
Blind or visually impaired people who rely on screen readers to browse the internet - that technology can't read the text in an image, so we transcribe it to machine-encoded text so it can read it.
People with bad internet connections who can't load the image for that reason
People who use third-party clients, mobile apps and/or text-based browsers that have trouble loading the image at high quality or at all
People who have trouble reading small, blurry, or oddly formatted text
There are many more reasons, these are just the main ones that come to mind right now. =)
I also personally enjoy transcribing; it helps me relax a bit. As to how I do it, once I've claimed the post over at r/TranscribersOfReddit, I just sit down and type it into the appropriate format. I like code ones especially because they're generally quite easy; it's mostly just typing the characters I see with no interpretation on my part.
I’ve always wondered what software do transcribers use, because AFAIK there is no software that can reliably transcribe image to text. Especially for memes.
Now that I know that transcribers are mostly doing this manually, I want to thank you peoples.
It will not only help peoples who have difficulty understanding image, but will also be a real valuable resource for machine learning system developers. (Just like mannequin challenge did to human posture recognition)
Afaik there's a WIP bot that transcribes code, but it's not very accurate. Some transcribers use it and correct the mistakes, it can make the job easier.
How many blind people are there that code? Now I'm curious whether there any statistics on this... I know that they can do it, I saw video of a guy some time ago.
There's quite a few things, typical of someone starting out. Some are very minor linting mistakes like a double ;;. But the big one is the amount of repetition. If you see the two code blocks they are extremely similar, and from another message it sounds like OP repeats the pattern a lot more. That becomes tiring and confusing to read, adds huge complexity for nor reason and becomes hard to maintain and debug.
So what you do instead is you abstract the repeated functionality into one or two functions, and pass the bits that differ as parameters. In this case, the main difference is B1, B2, B3, etc. Instead of writing the same code 3 times, you write it once as a function and just pass each of the Bs as necessary.
If each B is quite similar, you would put them into one array, and instead of running the function as many times as there are Bs, you would loop through the B array and run the function on each.
Naming could also be improved. If you don't know the app, you can't tell what each element is or does. Code should be self-documenting, so naming something in a way that tells you what it is or does, can hugely help maintain things.
Obviously I'm guessing here without the rest of the code, and the implementation may vary (maybe an array would not be the right thing for the Bs, whatever they are), but you get the general spirit. Decrease repetition, improve clarity, abstract and compose where possible, rather than do everything in one place, name things explicitly.
Setting variable, checking, setting variable based on the check then setting things, maybe if it was in a code block, you might have noticed the additional steps?
44
u/Zentrosis Aug 02 '21 edited Aug 02 '21
Wait... Is the mod just to determine player 1 vs player 2?
... How many more action listeners like this are there?
Am I right to assume there is one of these for every single space on a checkerboard or something?
Edit: it's tic-tac-toe, I get it now
16
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Aug 02 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
5
u/Lord_of_codes Aug 02 '21
You are able to feel shame because of that code. You learned something, be proud!
1
u/ForArms Aug 02 '21
Is this action script?
3
u/[deleted] Aug 02 '21
Can someone explain what would have been better here? I'm new...
3
u/MisterFor Aug 02 '21
Seeing your old code is like playing San Andreas after playing GTA V, you remembered it looking better. 😂
Last week I found some code I wrote 15 years ago. It was much worse than I remembered…
11
u/[deleted] Aug 02 '21
get the fuck out
1
u/Willinton06 Aug 02 '21
2 tab indentation? Good lord
1
u/EddieFromIndia Aug 03 '21
Haha. I can feel you 😅
1
u/[deleted] Aug 03 '21
People that use if without a code block are crazy
Setting variable, checking, setting variable based on the check then setting things, maybe if it was in a code block, you might have noticed the additional steps?