chhotii: (Default)
[personal profile] chhotii
Python is, in most ways, a great language. You get used to the syntactically-significant whitespace and, with a reasonable editor, it doesn't eit you.

What I love is that you can fill a dictionary with arrays of dictionaries filled with arrays... That's something I've found horribly painful in Perl. It opens up some great possibilities, coding-wise. I'm not sure I can ever go back to Perl again, on account of that.

What bites me over and over, though, is the complete lack of typing. I don't like that you don't declare variables, because I'm not strong at spelling (or consistency in my spelling). But you catch those pretty fast, when something is "used before initialized". But it really got me when I intended something to be a float, but oops, I assigned an int to it, so then, for example, 1/5 results in zero. Trying to take the log of zero... very very painful! (See, my native language is C. I'm used to declaring once and for all that something is float, and then it's perfectly fine to say foo = 1, the compiler KNOWS I mean foo = 1.0.)

I'm still reeling with exhaustion after beating myself over THAT stupid bug.

Date: 2009-05-09 03:50 pm (UTC)
From: [identity profile] chain saw with a magician (from livejournal.com)
You might like "from __future__ import division", which makes / *always* do floating-point division regardless of the operands, and requires you to use // for integer division.

Date: 2009-05-09 04:45 pm (UTC)
ext_197373: (Default)
From: [identity profile] blipvert.livejournal.com
What bites me over and over, though, is the complete lack of typing.

It isn't typing per se that's biting you, it's the presence of type-overloaded operators in a dynamically-typed language. Unfortunately, this insanity is par for the course in every dynamically-typed scripting language developed in the last 15 years. Perl is the only one I know of which gets it right; it has such a dauntingly huge list of built-in operators solely to avoid having any sort of overloaded semantics.

Another nit I have with these languages is any sort of meaningful function prototyping. Any C/C++ programmer appreciates the value of catching these errors at compile time. Not possible in Python, etc., and doing so robustly at run time involves cumbersome manual type checking. Perl is actually unique in giving you even limited function prototyping.

Profile

chhotii: (Default)
chhotii

July 2023

S M T W T F S
      1
2345678
9101112131415
16 171819202122
23 242526272829
3031     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 22nd, 2025 05:53 pm
Powered by Dreamwidth Studios