roxen.lists.pike.general

Subject Author Date
Pike & Python (was: Re: Pike documentation) Dave Walton <dw-pike[at]digger[dot]net> 11-12-2008
[feel free to holler if this is drifting off topic for the list]

Martin Bähr wrote:
> 
> you are not going wrong here :-) pike and python are similar enough so
> that if you know neither it does not matter much where you start first

But with one of them, I feel like I'm reading BASIC.  :)

> if anything, pike is easier in the long run because python has more
> complex features (generators, decorators, metaclasses) and more
> confusing constructs. (self for object scope vs class or local scope)
> 
> would be interested in your experience and comparison of learning pike
> and python at the same time. i am learning python now after using pike
> for more than 10 years and while i have yet to find anything that python
> does better than pike i suspect that is because i am looking at python
> through pike eyes (ie i have no problem using python features that are
> equivalent to pike but i don't yet get things like generators or
> metaclasses)

I've found that my eyes start to glaze over when -ors (generators,
iterators, etc, etc) are mentioned, regardless of the language involved.
 Whenever I've tried to understand those sorts of things, they always
seem to introduce far more complexity than they are worth to me.

A few early Python impressions...

whitespace:	don't get me started!

if (0 < x < 10):	handy.  kinda wish PHP and Pike could do that.

doctest:	unit tests inline with the functions being tested,
	instead of off in some other file somewhere.  I like it!  and it
	inspired a little googling that found a PHP module called
	Testing_DocTest that similarly lets you embed unit tests in your
	phpdoc comments.  might have to start using that at work...

Dave