pasithea: glowing girl (Default)
pasithea ([personal profile] pasithea) wrote2010-03-09 12:14 am

Dear Python

Dear Python,

Everyone says you're great and I'd like to believe them. I'd like to ignore that you are dynamically typed like every language ever conceived of by a visual BASIC programmer, and I'd give you the benefit of the doubt on your Fortran-like indention weirdness and your stupid grammar in IF statements that isn't like any other c-like language around for really no good reason.

But seriously Python, I could forgive all that if you'd actually just f***ing work when I go to use you. But no. I do something with 2D arrays and you do something funky with copying memory here and there because you can't decide if you're pass by reference or pass by value. I have some fantasy about pickling some data and shipping it to memcached to get around a bad schema someone else made but no. Inexplicably I can pickle the data but not unpickle it. You have to be broken.

And you're constantly broken, Python. Sure the basic stuff more or less functions but I go to use something more complex and it's buggy, broken, or implemented in some weird half-assed way. You're a slacker language, Python. I've experienced less frustration debugging other people's PERL code to writing stuff in you. You are coy, seductive, seemingly simple and beautiful but it's all a lie isn't it Python? I should have known better than to trust a language that couldn't even keep consistent internal syntaxes.


No love,
me
zeeth_kyrah: A glowing white and blue anthropomorphic horse stands before a pink and blue sky. (Default)

[personal profile] zeeth_kyrah 2010-03-09 09:40 am (UTC)(link)
At this point, I think I'm waiting for Python 3000.

[identity profile] cargoweasel.livejournal.com 2010-03-09 01:32 pm (UTC)(link)
but python is perfect in all respects! So says everyone!!

God, people who think Mac users are rabid unquestioning cultist fanboys have never met python fans.

[identity profile] dv-girl.livejournal.com 2010-03-09 06:01 pm (UTC)(link)
I'm so glad I'm not the only person with that opinion.

Don't get me wrong. I don't hate it. It's definitely not the WORST language I've ever used and once I get past the reek of VisualBasic, it's more or less tolerable and some parts are even kind of neat and it's certainly more friendly than PERL on the surface. But every time I've gone to do something big and new in it, the obvious approach turns out to be the wrong approach because of some brokeness or weird behavior pattern and there's some convoluted way you should do it instead. At least with PERL, the obvious method could usually be made to work even if it wasn't the most efficient and the convoluted logic was used for optimization.

PERL is the sort of language Scotty would use on the old Enterprise.
Python is more like some language invented on the holodeck in ST:TNG.

[identity profile] dv-girl.livejournal.com 2010-03-09 06:01 pm (UTC)(link)
... And can we pretend I didn't say something that completely dorky?

Here is how I do it

[identity profile] schlake.livejournal.com 2010-03-09 01:53 pm (UTC)(link)
def wrap( s ):
return base64.urlsafe_b64encode( pickle.dumps( data ) )

def unwrap( s ):
return pickle.loads( base64.urlsafe_b64decode( data ) )

I hate Python too, but what what few things it does do well it does really well, so I end up using it because of how easy it is.
Edited 2010-03-09 13:53 (UTC)

Re: Here is how I do it

[identity profile] dv-girl.livejournal.com 2010-03-09 06:04 pm (UTC)(link)
It's the unpickle of the data that's broken though.
If I cut out the memcached entirely and say

x=pickle.dumps(my_dict)
new_dict=pickle.loads(x)


The second line pukes for this library object.