Perl done right? Now there's a misnomer.
|
Reminds me of Linus Torvalds talking about Subversion: "The project started off with the tagline 'CVS done right', when you start with that there's nowhere you can actually go" (paraphrasing).
Thankfully, it's not the slogan for Ruby. Ruby's is "A Programmer's Best Friend", and based from personal experience, it's damn close.
There are just too many flaws, one is of course the type checking. I can feed a Python function a number where a string was supposed to go and it won't complain. I've never been part of writing a huge software system, but I'd guess that is not acceptable in such a system.
|
This is riduclous, sure, it will take it at runtime. Don't people TEST their damn code before putting it into production? That's exactly what that whole phase of development is FOR.
Sure, you don't catch type errors as easily as when using the "write, compile, test" cycle, but you should still be catching them relatively quickly with the "write, test" workflow. If you aren't accounting for type errors in your unit tests, you're doing it wrong.
Personally, I prefer to have more rigid checks in unit-tests and not have to deal with memory leaks/corruption, buffer overflows, dangling pointers, etc... Especially when you are trying to just get something *finished* so you can move on to something else more important.
Neither workflow is necessarily "better", you just need a different mindset when working in each, but it all boils down to personal preference.
And I HATE the indentation. Using brackets to indicate where the body of a loop begins and ends doesn't kill your readability. When a bracket is missing the error is obvious. When you're one whitespace of it's not so obvious and it makes for an unbelievably annoying error. |
Uniformed opinion: when you incorrectly indent in Python, the interpreter throws an "IndentationError" and tells you exactly which line it's on. Takes 3 seconds to fix.
How readable is this in C/C++? This code compiles just fine, how easy is it to understand though?
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
if(something)
if(something)
function1();
else
function2();
else if(somethingElse)
if(moreSomething)
function3();
else if(evenMoreSomething)
function4();
else
function5();
else
function6();
|
The flow of control here is so confusing, even I didn't know how it worked at first glance. And yes, code that looks horrible like this *does* exist. I've worked with dozens of so-called "professional" programmers during my career and abhorations like that are a lot more common than you think.
Monstrosities like this are *impossible* with Python because it forces you to write structured code. Just because you write nicely formatted C++ code doesn't mean everyone else does (check any code posted from beginners on this forum for examples), but by enforcing a style in the language grammar then ALL code looks the same stylistically and is much easier to read because of consistency.
Writing my code in a specific way is a small price to pay in order to have everyone else write their code in the exact same way so we can all understand eachother.