4 ms·
The programming languages that would make me the most sad/angry/annoyed I don't use, so it's difficult to make a choice. I suppose I'll have to go with Javascri
by lubutu 15y ago
The programming languages that would make me the most sad/angry/annoyed I don't use, so it's difficult to make a choice. I suppose I'll have to go with Javascript because it's the de facto 'Web language' which people use to force me to evaluate arbitrary code whenever I want to read anything on the Web. Even with a sandbox that seems a terrible idea.
If we're talking about programming languages I hate but still use, I'd have to go with Python. I spend most of my time writing Haskell, and Python's dynamic typing puts me on edge. I might spend half an hour evaluating a Python script only for it to throw an AttributeError because I mistyped some function name or passed the wrong type.
Does anyone know a static analysis tool for Python? I found one a while back but when I tried it it threw (you guessed it) an AttributeError on NoneType.
- reinhardt 15y agopylint catches most such common errors.
- shanemhansen 15y agoEmacs with flymake mode or pycharm both do a great job at giving you real-time feedback on issues like that.
- mumphster 15y agoSublimetext 2 + sublime lint plugin makes for a very nice python programming experience
- bhickey 15y agoI'm going to sign in as a partisan here. I firmly believe that Python is the worst language that people actually use. DuckTyping is the most deeply misguided aspect of python. With the discover of Hindley-Milner type inference 40 and 30 years ago, this sort of sloth is simply inexcusable. Pythonistas will say "Oh, I don't care if it's a duck or a swan, as long as it quacks." Guess what? You can treat function calls as a statement that an object is an instance of some typeclass and that typecheck that. With a sufficiently intelligent compiler/interpreter author this is transparent to the programmer.
- cpeterso 15y agoI enjoy Python's aesthetics and extensive libraries, but wish it had (practical) static type inference. (RPython isn't really practical.) And to confuse matters, Python 3 added optional type annotations that are ignored by the runtime!
- TylerE 15y agoWith fairness, no you can't, not truly. Please point me to the version of HM the works with inheritance. Plus, due to stuff like __getattr__, the interpreter may not know until the method is called if it even exists. It would be totally possible in python to write a class where when any arbitrary method is called on a class, a function is randomly generated and called, with a random number of arguments, etc. It doesn't even have to be consistent from call to call. How on earth would H-M type inference cope with that?
- bhickey 15y agoI never said inheritance, or method for that matter. You can do H-M on typeclasses. Philip Wadler has a paper on it and it's alive and well in GHC: http://homepages.inf.ed.ac.uk/wadler/topics/type-classes.html http://homepages.inf.ed.ac.uk/wadler/topics/type-classes.htm... The fact that Python allows you to do something absurd is simply an argument against its design. Edit: Uh oh, looks like I ruffled some snakeskin!
- TylerE 15y ago