Hacker News new | ask | show | jobs
by eckyptang 5002 days ago
It is also true when testing is included and pylint are used, which is the issue.

I can write a 500 line C# program and it works reliably first time with no crashes, type inference errors or framework exceptions thrown. The only errors will be algorithmic or functional (i.e. based on requirements).

The same is not true with python.

I have the same experience with both. Go figure.

2 comments

Your tests should be picking the majority of your algorithmic and functional errors, so I'd have to assume you're talking about the state of the code before thorough testing.

What's it like after that testing? How's the long term maintainability? I'm much more interested in possible problems - and it could go either way - in the long term than before I've finished writing it.

They do.

I tend not to write oodles of test cases up front in favour of simple scenario based tests applied later on. I add pre/post/invariant-condition checks in the code as I write it. It is tested incrementally by hand.

The condition checks prevent the what if's and tell you why something broke. The scenario tests ensure that it does what is asked of it.

I rarely get bugs raised against my code (7 this year out of about 112,000 lines of c# written). Not bad!

It's been my experience that python (or any other similar language) is less prone to type errors when testing and pylint are used. I still prefer C++ and a strong type system when I do more critical work, but I can get by with the fast, more reckless languages too. There's a place for both.