[Discussion]Does using python amount to cheating?

i`d like to know your opinion on whether using python and hence its builtin functions like sort(),len() etc amounts to taking "short cuts" in the learning process.

suppose i am working on string matching algorithms,and since i already know how to implement len() etc,i choose to use builtin,but when do you think it crosses the line? the python code for the problem is around 20 lines whereas a native c code takes around 150-180 lines.

argument for using python would be 1.there is no need to reinvent the wheel.

would like your opinion

EDIT:this has nothing to do with course material/college

7 comments · 42% upvoted · other discussions

comments

Kilora

Part of being an excellent developer, I've been told, is knowing how to do things efficiently, and which tools are the best to use in each situation. I can't imagine a supervisor being happy that it took you 3 days to program something, whereas your co-worker did it in an hour because he knew which "tools" to use (and didn't re-invent the wheel).

When learning (be it college, personal learning, etc) I prefer to understand things as in-depth as possible. Knowing the functions is excellent; knowing exactly how they work? Even better. As an example: Knowing how to use data structures is great. Knowing when to use them, why you're using them, and what they are doing is even better.

lolfunctionspace

Why don't we all just learn assembly and machine code then?

cdcformatc

In my job I don't need to know how to find the length of a list, or how to sort stuff. I need to get something done in the most efficient way. So that is how I approached learning python. One of the benefits to using Python in the first place is that it is batteries included, using the datetime module will be hundreds of times faster, and likely to be correct out of the box. I have had to implement my own date and time system and it is a nightmare, and probably wrong.

If you are learning to program, or trying to judge someone's understanding of programming, yeah maybe you will want to get them to reinvent the wheel.

[deleted]

I think that would entirely depend on what the specification of the assignment was and what the desired learning outcomes were.

wlu56 [OP]

i forgot to mention , this isnt an assignment/college thing at all.it is all an exercise by me to improve programming and to learn stuff for the sake of learning and not for grades

[deleted]

[deleted]

JefeSabot

I'm in a similar position to OP. Off the top of my head, enumerate would seem like an easy way to defined a custom len() function... but wouldn't that still be "cheating" in the same sense? So what's the reasonable challenge; do it just using for loops?

sanedave

So another thing you could do is dig into the python source code, and understand how the len function is actually implement.

In fact, I see this suggestion of learning the python source suggested as a method of learning python quite often in this subreddit.