+ 1

I was rated 5 out of 10 for this code

Any feedback for this code of odd even printing using two threads? I discussed initially and got feedback that it is only worth of 5 out of 10. Feel free to share your suggestions to improve this code. https://sololearn.com/compiler-playground/cY6n1J39OmTj/?ref=app

12th Feb 2025, 11:35 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
3 Antworten
+ 1
Any point is fine. Code readability, code quality, performance enhancement etc. One point I got is the functional paradigm and global variables. It could have been avoided
12th Feb 2025, 7:15 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
it feels over-engineered for such a simple task. But for demonstrating thread synchronization, i think it's ok.. maybe it was rated by people who were taught using namespace std is bad. I have no problem with it. For small demo scripts, I feel it reduces the visual clutter and improves readability. Just as long as one is aware that it's a footgun for bigger codebases. as for it being functional, it's actually a plus for me. OOP is overused and adds a lot of unnecessary boilerplate. Functional and imperative styles go straight for the problem.
13th Feb 2025, 12:50 AM
Bob_Li
Bob_Li - avatar
0
What's the criteria? Improve in which direction?
12th Feb 2025, 4:51 PM
Bob_Li
Bob_Li - avatar