RE: Python vs. C#

Discussion in 'Python' started by Brian Quinlan, Aug 13, 2003.

  1. > > I think that depends on how efficient you are at writing tests.
    > > Python offers a great testing framework to help you.

    >
    > No, writing tests consumes time.


    Of course. The question is whether writing tests results in less net
    development time (due to more rapid bug discovery and elimination). My
    experience is that it usually does.

    > C++ style compiler checking helps.


    You are changing the subject of discussion; we were talking about C#
    (and Python; see the subject of this thread). C++ has templates and STL
    uses them to provide type-safe containers and algorithms. .NET languages
    are not required to support templates (VB doesn't and neither did the
    first release of C#) so the class libraries are not type safe. Having
    written tens of thousands of lines of C# code I can tell you that the
    compiler seldom saves me from making a type error.

    > I've never met anyone who thinks
    > otherwise. Pythonistas just habitually claim it doesn't have merit

    and
    > complain about burdens imposed. To us C++ guys, it is no big deal.


    That is because C++ programmers naturally use C++ design patterns to
    code in C++. Those design patterns preclude the use of any features not
    found in the language. If, on the other hand, you were accustomed to a
    different language, you would probably notice the "big deal" when your
    favorite design patterns are rendered impossible by static typing.

    BTW, notice that you are arguing for the inclusion of static typing,
    which catches only a small fraction of bugs and greatly reduces design
    flexibility and against type checking, which imposes no design
    restrictions and can catch more classes of bugs.

    Cheers,
    Brian
    Brian Quinlan, Aug 13, 2003
    #1
    1. Advertising

  2. Brian Quinlan

    Max M Guest

    Brian Quinlan wrote:

    >>>I think that depends on how efficient you are at writing tests.
    >>>Python offers a great testing framework to help you.

    >>
    >>No, writing tests consumes time.

    >
    > Of course. The question is whether writing tests results in less net
    > development time (due to more rapid bug discovery and elimination). My
    > experience is that it usually does.


    Yeah. The main idea behind test is that they catch errors faster, and
    ensures a better design for your code.

    A rule of thumb says that a bug that is caught later one requires a lot
    longer time to debug as a function the size of the codebase.

    roughly:

    debug_time = n_bugs * size_of_code

    So there are *big* savings in catching bugs early. That is why tests
    saves time. And a lot of time at that.

    Also they help you catch bugs as you create them and the test suite
    expose them.

    Only thing is that the saving only shows up later in the project as less
    delay ... ;-)


    regards Max M
    Max M, Aug 13, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    729
  2. Paul Moore
    Replies:
    0
    Views:
    600
    Paul Moore
    Mar 1, 2008
  3. Martin v. Löwis
    Replies:
    0
    Views:
    641
    Martin v. Löwis
    Mar 1, 2008
  4. Senthil Kumaran
    Replies:
    0
    Views:
    562
    Senthil Kumaran
    Jan 17, 2011
  5. R. David Murray
    Replies:
    0
    Views:
    744
    R. David Murray
    Jan 17, 2011
Loading...

Share This Page