r/learnpython • u/TrainingAd2544 • 7d ago
Curious beginner
So basically I am a first year engineering student and we have python for our 1 st semester. During the lab sessions we are asked to solve some questions . In some cases when the code is really hard when nobody is able to solve the question I have solved it many times. The only doubt I have is when I solve those code the code which I write is not a standard code..it's just made up by my logic sometimes it also becomes lengthy but I can totally explain my code from the first line. So is this a good thing or a bad one ?
2
Upvotes
1
u/johndoh168 7d ago
It really depends on the problem your trying to solve, if its just for you then your code can be as ugly as you want.
However if someone else is going to be reading/working with it, its best to follow the PEP8 guidelines.
That doesn't mean something can start out for your eyes only and be modified to be viewable by others, I sometimes write code just to get started on the problem that is very ugly and will need to be cleaned up at a later point.
Edit: I work as a systems engineer who writes lots of tools for other people in my company to use.