Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When I use C, I don't have to worry about subtle type errors cropping up at runtime. Should we all ditch dynamic-typing for Haskell?


I don't understand this analogy, unless either C or Haskell allows invisible characters copied and pasted incorrectly to cause semantic errors. (I've used both Haskell and C for non-trivial purposes and can never recall that to be the case.)


> reformatting making code that was correct suddenly and subtly incorrect

and

> invisible characters copied and pasted incorrectly to cause semantic errors

are two different issues. Reformatting doesn't insert (unexpected) invisible characters[1].

As to copy-pasting, this issue already exists in other forms with other languages. How long would it take most people to find the error here:

  my $variable = “(#`д´)ノ”;

[1] I guess I should specify "if you are using a decent editor".


Perl points that out very nicely:

    C:\Users\Mithaldu>perl -e "  my $variable = “(#`д´)ノ”;"
    Unrecognized character \x93; marked by <-- HERE after ariable = <-- HERE near column 18 at -e line 1.


That may be, but this thread seems to be "Python is a language with serious deficiencies because whitespace!" If that's the case, then people are pitting Python up against all other languages, not just Perl.

That being said, even with the helpful Perl error message, the less experienced developers may have issues trying to determine why Perl doesn't like their double-quote before they figure out what the real issue is.

I guess I should be clear, that I'm not hating on Perl. It's more that I see the "OMG! Semantic whitespace in Python!" argument as a bit of a red herring if that's your only reason for not using the language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: