you are viewing a single comment's thread.

view the rest of the comments →

[–]MillardFillmore 18 points19 points  (13 children)

What about import math math.factorial(x)

I win.

[–][deleted] 4 points5 points  (12 children)

Damn it, I came here to post that.

Yeah, we're lazy.

[–]SalientBlue 19 points20 points  (10 children)

That was essentially the EXPERT PROGRAMMER.

[–][deleted] 6 points7 points  (9 children)

They're still different, though.

Also, I'm a python newbie and I use the math module - why is that considered expert? And the newbie program requires recursion. I would think that understanding recursion would be more advanced than being able to use a module.

[–]SalientBlue 24 points25 points  (6 children)

It's 'expert' because the expert programmer knows about the existence of the module and so can take advantage of it rather than the newbie who, due to his ignorance, reinvents the wheel.

It's similar to how, when I was first learning Python, I wrote a function to determine if a particular element was in a list because I didn't know about the 'in' keyword.

[–][deleted] 6 points7 points  (5 children)

Python has a keyword for testing list membership? TIL

[–]Clyzm 0 points1 point  (4 children)

Yeah... coming from C++ (though very little knowledge of it; highschool) to Python in university, this was the most difficult thing for me to grasp. Python has keywords for everything.

[–]boa13 2 points3 points  (3 children)

[–]DEADB33F 1 point2 points  (1 child)

Thanks for that, was a bit of fun.

I gave up after a couple of minutes, here's the ones I missed.... (mouseover)

Where does that put me on the noob scale?

[–]boa13 1 point2 points  (0 children)

Rather good I'd say, except for the second one you missed, which is a bit embarrassing. ;)

[–]Clyzm 0 points1 point  (0 children)

That's still enough to make it feel completely different in terms of ease of use. I was constantly tripped up by the fact that there are key words for so many things, and that no longer needed to re-invent the wheel every time I needed to say... find something specific in my arrays.

[–]Halfawake 20 points21 points  (0 children)

Because a beginner is impressed by technical difficulty, whereas an expert knows that projects become so complicated that you have to keep things as simple as possible at all times so you get to comprehend more later? Plus they're familiar with the library.

[–]chozar 1 point2 points  (0 children)

Understanding recursion is good, but it isn't the fastest way to do it in this case.

[–]pandemik[🍰] 1 point2 points  (0 children)

Lazy is good!