User: Password:
Subscribe / Log in / New account

GNOME Platform Stormclouds

GNOME Platform Stormclouds

Posted Mar 25, 2004 18:44 UTC (Thu) by mly (guest, #2171)
In reply to: GNOME Platform Stormclouds by tjc
Parent article: GNOME Platform Stormclouds

tjc wrote:
> They show up at compile time in C, which is as fast as it gets!

No it's not! Honestly! For my normal programming, I run my python programs more often than I compile my C or C++ programs during development. I typically write very modular code and change it in small steps, testing it often so that I notice whatever bugs I introduce as soon as I can. Of course, only a fraction of these bugs would have been caught by the compiler anyway.

I haven't programmed so much C or C++ lately, but even if I try to use short cycles there as well, they will still be longer, since I need to type so much more in these languages to produce the same amount of functionality.

But if you like the support of the compiler in C, just use PyChecker as your Python "compiler". I would still suggest proper unit tests though. Python has good unit test support in the standard library, and no compiler or code checker can replace real tests.

> I've written a fair amount of code in both PHP and Tcl

I don't think you can draw too many conclusions about Python from Tcl or PHP. That's a bit like deciding what to think about C based on experience from COBOL.

Strange as it may sound, I mistype much more in C or C++ than in Python. There are several reasons for that. One is naturally that there will be fewer mistypings if there is less typing. Another aspect is that Python's syntax is very simple and consistent. I don't have to remember so much, and
since the code typically looks clean and regular, I'm more likely to directly spot mistakes. Python fits my brain. My little experience of Tcl and PHP suggests that they don't offer the same benefits. I'll quote what Eric Raymond said about his first experiments with Python in Linux Journal:

I noticed (allowing for pauses needed to look up new features in Programming Python) I was generating working code nearly as fast as I could type. When I realized this, I was quite startled. ... it generally means you've achieved mastery of the language. But that didn't make sense, because it was still day one ...

This was my first clue that, in Python, I was actually dealing with an exceptionally good design. Most languages have so much friction and awkwardness built into their design that you learn most of their feature set long before your misstep rate drops anywhere near zero. Python was the first general-purpose language I'd ever used that reversed this process.

Pinched from

(Log in to post comments)

GNOME Platform Stormclouds

Posted Mar 25, 2004 20:25 UTC (Thu) by tjc (guest, #137) [Link]

I don't think you can draw too many conclusions about Python from Tcl or PHP.

All three lack static type checking, which is the *only* thing I was comparing with C. I'd probably have more to say about Python, but I've never had a contract that required it, and C is the only thing I use on my own time.

GNOME Platform Stormclouds

Posted Mar 26, 2004 18:08 UTC (Fri) by maney (subscriber, #12630) [Link]

All three lack static type checking, which is the *only* thing I was comparing with C.

Right, and that's why it's a useless comparison. There's a great deal more that differs among the four languages, and assuming that your experience with PHP and TCL are reliable guides to what Python is like is a bad assumption. I haven't used TCL, but I have worked with PHP at some length - indeed, I worked with it until it seemed to be unable to support the application, which was why I switched to Python. Nor was that the biased reaction of a fan of X who proves that Y isn't much good and finds reverting to X clearly better, as I had had nothing but superficial exposure to either language before beginning. And so I made the mistake of taking at face value all the hype that was going around then (still is, I guess) about how PHP is such a wonderful language for web apps with database backends. Maybe for Joe Hacker's Own CD Catalog it actually is; for the middling complex scheduling app I was working on it made some early, stripped down versions easy, but the cost rose quickly as I tried to add meat to those bones.

Rather more that 20 years after my first chance to use C (anyone else remember BDS C for CP/M?), I find that there are languages that work differently than C (or C++, which in some important ways is just a false front hung in front of C to disguise it), and for these languages the static type checking that is so essential in C - because the static checking, limited as it is, is the only sanity check you get - is simply irrelevant. I know I won't convince you: this is something that everyone has to learn for themselves. At least that has been my experience.

GNOME Platform Stormclouds

Posted Mar 26, 2004 22:57 UTC (Fri) by tjc (guest, #137) [Link]

All three lack static type checking, which is the *only* thing I was comparing with C.

Right, and that's why it's a useless comparison.

It was a useful comparison for my purposes, since I was able to determine from an early stage that quite of few languages would not be very useful to me. This is a lot better than spending a great deal of time learning a new language and then finding out further down the road that it's not going to work very well for a particular purpose or project.

Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds