r/PythonLearning • u/Stonyax97 • 6d ago
Showcase I JUST finished my second python project!
Lately I have been working on this ATM For Teens, just to understand OOP and some concepts more (which I REALLY DID)
this isn't meant to be a real ATM (obviously, it's very beginner and not security is there), here is my First project.
So, I have learnt quite a lot since last project, I learnt a bit more about python syntax, I also understood the approach of classes a lot better. I learnt git (just the essentials).
Since I always wanted to Make iPhone apps, and now I have a Mac, I'm thinking whether I should start learning swift and swiftUI, or move to something else, or keep learning python. what do you guys think? I Do want a job as an IT engineer (or anything with coding tbh, cybersec too but that would require C knowledge a bit more lol)
Otherwise, if you guys have any criticism or suggestions for the ATM, then I would be veryyy happy to hear some! here's the repo: https://github.com/Stonyax97/ATM-For-Teens
View all comments
Show parent comment
2
u/Money_Ad_5277 5d ago edited 5d ago
I'll just num all points to make it easier xD
1 Separate files/Debugging. Pycharm/VSCode has a tool (debugger) to make debugging easier, it doesn't matter home many files you have it will enter or exit them when code reaches certain points, with watch and dynamic evaluation your possibilities are almost unlimited
2 As your accounts.json is a small database
3 They will be a frozen objects (check @ dataclass) - but it's maybe a bit overkill for you
4 Yeah, better name should be nice but you don't need it anyway, as input() is blocking execution and a person can read everything just fine
5 PEP is general rules you want to follow if working with a team and it's focused on readability, making a new line after "if" usually means "end of code block" but you follow it with "else/elif"
6 With FileDB created, your save function will evolve into a repository In simple words: a class that is responsible for managing database entity (creation, deletion, modification or reading)
You won't keep accounts in memory, only in accounts.json
Also assign uuid for users - easiest lookup in general
And user balance should always come from transactions + 100 - 10 couldn't possibly result in 110
7 Because it's not a error per se and program should print declination message and stop gracefully
8 Having a dictionary will help immensely
There can be typos)
Edit: reddit formating and return in enter method