About

Welcome to Panela, Matt Harrison's take on mostly Open Source, Linux, Python, innovation in those areas, other buzzwords and Dick Proenneke. It comes complete with the illustrations as needed. Note the opinions expressed here are merely my opinions and not the opinions of my employer.

about Matt

Calendar

««Aug 2008»»
SMTWTFS
      12
3456789
10111213141516
17181920212223
24
25
2627282930
31

My Top Tags

                                       

Mailing List

My RSS Feeds








Gnome devs too lazy for python?

posted 2007.10.31 Wed

Some interesting thoughts about testing and python found among gnome developers. Joe Shaw was explaining how most new gnome apps these days are written in either python or C#. They choose C# for their app (Beagle) because "[they] wanted a strongly typed language" (I think he meant static typing but we get the point). Joe claims to have been burned by not having the compiler find "bugs".

His next two sentences are very telling:

Writing real applications in Python requires a discipline that unfortunately most people (including myself) are unwilling to adhere to, and this easily leads to buggy and hard to maintain programs. You have to be very diligent about unit tests and code coverage for every line of code, because you can’t rely on the compiler to catch errors for you.
. If I read this with my cynical glasses on, I'm assuming that many java/c# developers think that testing consists of compiling the program. How sad.

In a rebuttal to Joe's dislike of dynamic typed languages, Thomas Vander Stichele claims that any language should have tests and coverage. And provides two reasons for it:

  • Confidence
  • Refactoring
Here, here, Thomas!

One wonders why all those redhat and canonical developers aren't on the static typed bandwangon for their apps, why weren't they distracted by the mono diversion?....

tags:            

links: digg this    del.icio.us    reddit




1. Cowmix left...
2007.10.31 Wed 11:30 am

I love Python.. so I would personally use Python over any language for a Gnome based app..

In any case, I would shy away from Mono / C# just based on the fact you don't know how much of MSFT's IP you are using when implementing programs based on the Mono stack.


2. Patrick left...
2007.10.31 Wed 12:08 pm

Wow, that's really sad that they rely on compiling to fix their bugs. I know some people who work in java shops - testing is every bit as important there as it is anywhere else. Actually, didn't unit testing hit java before it hit python? WTF.

Compiling (in this case static typing) catches one kind of error, and if you are a decent programmer it's not an error you make often. The REASON i can't use beagle is because of their poor language choice. Mono is huge and unwieldy, and I don't have the space or memory to install it. Maybe it's gotten better since I tried it a few years ago, but I just don't like the platform.

I am very leery of their software if they aren't properly testing their code.


3. Krys left...
2007.10.31 Wed 9:01 pm :: http://krys.ca

For the record, I have written several "real" applications in Python and they do not have unit tests. (I've been lazy too.) They run just fine and the people that rely on them are happy.

I'm not saying that testing is unnecessary. I think it is very important. What I am saying is that you don't need to be so incredibly disciplined to program in Python.

Compiling is a implementation detail. And an annoying one at that. I've been burned just as often (or perhaps more so) when I used to code in C++ and Java. Static typing does not buy you anything.

Just my $0.02. But he seems to make it out to be some monumentally huge ordeal to not get burned in Python. And that is simply not true.

Anyway, to each his own.


4. Juri Pakaste left...
2007.11.01 Thu 1:02 am :: http://www.juripakaste.fi/blog/

Of course, Joe also replied to Thomas's posting and explained his position a bit better.

For what it's worth, I use Python (and several other dynamically typed languages) a lot, and still enjoy using static typing for projects where it's suitable and think that it does actually help quite a bit in catching errors. Not to say you can't catch those errors with unit tests too or that it doesn't have its downsides, especially if the type system isn't good enough.

I don't think there's a simple easy answer.


5. Menno Smits left...
2007.11.01 Thu 4:25 am :: http://freshfoo.com/blog/

Bruce Eckel's article Strong Typing vs. Strong Testing is very relevant here. Static type checking alone is a very poor substitute for comprehensive unit and functional tests.


6. Joe Shaw left...
2007.11.02 Fri 1:30 pm :: http://joeshaw.org

Hi,

As I've mentioned elsewhere, there is no substitute for writing tests for your application. The blog post wasn't principally about Python or development methodologies, so I didn't think it was necessary to say that testing is important in all cases. Are there really people out there who believe that?

I don't disagree with anything that Thomas said, in fact I agree with him wholeheartedly. My experience with that project (incidentally, my first ever with Python) has vividly reinforced the importance of code coverage and unit tests.

In rereading my original post, I see that the parenthetical statement "including myself" implies that I presently don't think this is important. That was a mistake. I didn't have that discipline on that previous project; I definitely do now.

I've had a bit of a back-and-forth in the comments over at Lennart Regebro's blog about this. Hopefully it does a better job of explaining my position:

http://regebro.wordpress.com/2007/11/01/the-compiler-doesnt-help-you-find-b ugs/

Thanks, Joe


7. Matt left...
2007.11.02 Fri 2:02 pm

wmix- there's still some uncertainty (perhaps it's FUD) around IP issues and Mono. I was hoping Joe would post the reasons he chose C#. I'm not convinced of the static typing argument yet....

patrick- Testing is good for all software. You'd be surprised how much software out there lacks tests... (or maybe you wouldn't)

krys- Thanks for admitting that it's possible to be a lazy programmer. I've also programmed (in python) without tests and said programs tend to run. I'm not buying that python takes more discipline to program than C#/Java. Certainly there isn't a IDE to hold your hand (perhaps that is THE benefit of static typing), but the core language is so succinct you don't really need an ide... (ok emacs perhaps is an IDE).

juri- But aren't the errors your compiler is finding going to be found through basic testing?

menno- Yes, The Eckel's article is sort of a must read. Especially as it's coming from a very respected C++/Java guru.

joe- Thanks for your clarification. I'm still waiting on good reasons for static typing. I'm not buying the compilation argument yet. (I'd like to think that I'm open to being convinced of it...)


8. Joe Shaw left...
2007.11.02 Fri 2:03 pm :: http://joeshaw.org

Hi again,

Also, you're rather selectively quoting me, which I don't really appreciate:

  • They choose C# for their app (Beagle) because " wanted a strongly typed language"

(You are right about my mistake of "strongly typed" rather than "statically typed".) That was but one of the reasons, and not even the major one. Which is why I listed it third of the three I posted, although I didn't mention that they were in order of preference. The biggest reasons were (a) that we wanted to use Mono because we thought it was a fun, interesting, and new thing to use (and Miguel is very good about getting people excited about things) and (b) because more of the supporting code was there. We used the frequently renamed once-and-again Lucene.Net for indexing, which was a straightforward C# port of the Apache Lucene in Java. At that time, Lucy (the Python port) wasn't as functional, although I think it has caught up now.

For the record, at Novell we were never forced into using Mono; we were free to choose whatever technology we wanted and thought was best. I quite enjoy Python and I tend to use it as my normal "go to" language.

Regards,

Joe


9. Matt left...
2007.11.02 Fri 2:26 pm :: http://panela.blog-city.com/

Joe- I didn't mean to selectively quote you. I apologize for any offense. My interest (and reason for the blog post itself) was because of the typing/compilation issue, which wreaked of FUD to me. It's fine (and quite reasonable) that you don't to use C for desktop apps. I like using new technology too, so I applaud you for living on the edge.


10. Toby left...
2007.12.12 Wed 12:59 am :: http://telegraphics.com.au/sw/

> Miguel is very good about getting people excited about things

What a shame they are invariably the wrong things.

Mono/Miguel/MS are worse than a nuisance: They're downright dangerous.