>>> def zerodiv(x):
... return 1/x+zerodiv(x-1)
...
>>> zerodiv(50)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
File "<stdin>", line 2, in zerodiv
ZeroDivisionError: integer division or modulo by zero
>>>
Name:
Anonymous2009-05-31 23:08
There's nothing fundamentally wrong with Python except for the fact that Gweedo is afraid of functional programming. The stdlib is a bit of a mess in places, though.
>>10
I suppose it doesn't matter to you that the one way is the easy and obvious way to solve the problem. Of course not, this is /prog/, where if there is one thing we know how to do, it is to take a ridiculously easy problem and optimize in various over-the-top and convoluted ways
Name:
Anonymous2009-06-01 1:42
>>11
There's no such thing as an easy and obvious way to solve a problem.
The easy and obvious way depends on the problem in a case-by-case basis.
>>11
The easy and obvious way to implement a lot of things (for example the Fibonacci and factorial functions) happens to be slow as fuck and incredibly stupid.
Name:
Anonymous2009-06-01 1:47
>>12
What do you think will come first. A different custom crafted solution to every problem in the universe, or a general algorithm that solves all problems?
>>14
Your philosophy is to wing it. That is, don't attack the problem head on, only do the least necessary and give the most half-ass effort possible to solve a problem. Optimize nowhere and create the longest code possible. The whole point of code is to be easiest for the programmer and not optimal for the user and the client. You, the programmer, are the primary beneficiary, the client gets whatever's left of efficiency.
This is what Python/Ruby programmers actually believe.
Name:
Anonymous2009-06-01 2:07
>>16 has not debugged a medium or above sized project
the choice is between readable code ZOMG OPTIMIZED PITA to maintain code comment spam
>>17
That's because you assume only polar opposites.
With FORCED INDENTATION OF CODE you have no choice, there is only most readable code option.
With something like Perl you have the option to have your cake and eat it too.
You can optimize where it matters and have readable code where it matters. Or you can have all readable, and even then, you have options as to what is most readable to the programmer or programming team.
This, my friend, is freedom to optimize what works best for you.
What FORCED INDENTATION OF CODE tries to do is alleviate the issue of different design philosophies by applying a single standard at the expense of efficiency. And by efficiency I don't mean ALL CODE IN ONE LINE extreme. By efficiency I mean the balance between readability and ENTERPRISE OPTIMIZATION.
If you enjoy having purely readable code, that's cool bro. I don't care, but there's a problem when you go out and try to convert people to your new church.
Name:
Anonymous2009-06-01 2:32
With something like Perl you have the option [of readable code] Oh anonymous, you card you.
Name:
Anonymous2009-06-01 2:37
>>18
But Python is not readable. Good python code resembles a parser error.