I struggle to maintain a large system in Python (which, at least, is strongly typed). My major banes are: * performance. You have a hard job retrofitting performance to Python * typos. Typos that survive my Integration Tests which can never have enough coverage. Stuff that just won't compile in a static language becomes a runtime issue on a dynamic language, and they can hide for months outside the happy path e.g. in…
Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
21–30 of 31 posts
Re: Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
#22Earlier quoted context omitted.
Python is actually strongly typed. For example, 1+"1" will fail in python. Type errors will (usually) make the program crash. I believe this is a major plus over javascript when writing and maintaining large programs.
Yes, crash at runtime. That's no good in a production environment when you can have hundreds of code paths and no real way of ensuring they are all correct. Mistakes happen, and code coverage tools are in my experience pretty useless at ensuring all code paths have been exercised (a theoretically futile task as well.) As for strongly typed- yes, that is true, but it is also dynamically typed, and combined with duck t…
JavaScript is missing a stable base, packages, ABCs and interfaces, and a shared testing framework. However many of these are available within separate communities like for example the jQuery community. jQuery provides a stable base, plugins, a good community to share code, a standard testing framework, a way to extend code (plugins) to make it reusable, and now it has a module system which can be shared with other JavaScript frameworks.
I've been on 10+ JavaScript developer projects with 100+ developers over all. I've seen JavaScript code reused by one million+ developers. I've seen open source JavaScript projects with 100+ developers. So I have experienced myself that it can scale up to a certain point.
As long as the team has the best practice skills to do it that is. JavaScript is the ultimate spaghetti making machine in the hands of newbies without direction.
Re: Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
#23Earlier quoted context omitted.
Python is actually strongly typed. For example, 1+"1" will fail in python. Type errors will (usually) make the program crash. I believe this is a major plus over javascript when writing and maintaining large programs.
You call that strong typing ? IMHO it is natural that it fails - what did you want as a result? But 1 + 1.0 works in Python - and I just added float to integer (integer was implicitly converted to float (given sufficiently large integer such behavior will result in erroneous calculation)), which is contrary to what strong typing is about.
Re: Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
#24Earlier quoted context omitted.
Python is actually strongly typed. For example, 1+"1" will fail in python. Type errors will (usually) make the program crash. I believe this is a major plus over javascript when writing and maintaining large programs.
Yes, crash at runtime. That's no good in a production environment when you can have hundreds of code paths and no real way of ensuring they are all correct. Mistakes happen, and code coverage tools are in my experience pretty useless at ensuring all code paths have been exercised (a theoretically futile task as well.) As for strongly typed- yes, that is true, but it is also dynamically typed, and combined with duck t…
You'll have more of the runtime errors in Python, but you're not free from them in other languages either, static typing or not.
Re: Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
#25Earlier quoted context omitted.
True, but large systems are just, well, large. I'm not thinking startup land here, but entrenched applications in bigger businesses that grow organically to meet the need of the business. Python 3 does have type annotations for use by linting tools, but it'll be another 5-6 years before we'll see that filter down into the current Python ecosystem. And even then, it's only as good as the weakest (non-annotated) piece…
>>how do you accurately hint to linters, in a language that encourages duck typing, the type a method parameter is likely to take? You didn't check the Method::Signatures link or do I misunderstand your position? Also check Moose@CPAN, which have typing of object attributes. It isn't like a fully typed language, but it should help a lot. Edit: Link discussing type checking of attributes in Perl. Should be possible to…
Re: Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
#26Earlier quoted context omitted.
Yes, crash at runtime. That's no good in a production environment when you can have hundreds of code paths and no real way of ensuring they are all correct. Mistakes happen, and code coverage tools are in my experience pretty useless at ensuring all code paths have been exercised (a theoretically futile task as well.) As for strongly typed- yes, that is true, but it is also dynamically typed, and combined with duck t…
Python has Abstract Base Classes, and also widely used zope.interfaces. These, along with simplicity, convention(pep8, frameworks), a stable base(stdlib), packages, a standard unittest framework, and a strong internet community help python code bases scale. JavaScript is missing a stable base, packages, ABCs and interfaces, and a shared testing framework. However many of these are available within separate communitie…
Well-thought-out code will always trump bad code; but that's a truism.
Re: Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
#27Earlier quoted context omitted.
Yes, crash at runtime. That's no good in a production environment when you can have hundreds of code paths and no real way of ensuring they are all correct. Mistakes happen, and code coverage tools are in my experience pretty useless at ensuring all code paths have been exercised (a theoretically futile task as well.) As for strongly typed- yes, that is true, but it is also dynamically typed, and combined with duck t…
No, not crash at runtime. Raise exception in runtime. You know, like NullPointerException in Java? Or ClassCastException? Or OutOfMemeoryException. You'll have more of the runtime errors in Python, but you're not free from them in other languages either, static typing or not.
As for the semantics of crashing vs. not crashing, that is a different argument entirely. Do you want your code to suppress a SyntaxError or TypeError exception and "keep going" - probably not? But maybe? It all depends, I suppose. You'll let the unhandled and unexpected exceptions percolate to the top of the stack and then your "main" method will decide what to do next. But putting square pegs into round holes do happen, and the question then becomes: how do you ensure that does not happen as often?
I never made the argument that languages like C#, Ada, Delphi, or Java were immune from runtime errors. Not at all.
Re: Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
#28Earlier quoted context omitted.
>>how do you accurately hint to linters, in a language that encourages duck typing, the type a method parameter is likely to take? You didn't check the Method::Signatures link or do I misunderstand your position? Also check Moose@CPAN, which have typing of object attributes. It isn't like a fully typed language, but it should help a lot. Edit: Link discussing type checking of attributes in Perl. Should be possible to…
I didn't look, tbh. Python 3 already has type annotations, but what interests me if how do you nail down types whilst preserving duck typing, or dealing with a method that is already passed duck typed objects.
(There are easy-to-read abstracts/"synopsis" at the start of both pages.)
Re: Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
#29Earlier quoted context omitted.
Python is actually strongly typed. For example, 1+"1" will fail in python. Type errors will (usually) make the program crash. I believe this is a major plus over javascript when writing and maintaining large programs.
You call that strong typing ? IMHO it is natural that it fails - what did you want as a result? But 1 + 1.0 works in Python - and I just added float to integer (integer was implicitly converted to float (given sufficiently large integer such behavior will result in erroneous calculation)), which is contrary to what strong typing is about.
Re: Anders Hejlsberg Is Right: You Cannot Maintain Large Programs In JavaScript
#30Certainly, large programs are harder to maintain than small programs. Certainly, modularity and encapsulation helps, in any language. The implication that, therefore, choice of language is irrelevant to maintainability is spurious.
Definition of large program is "program, which is hard to maintain". So large programs are hard to maintain by definition.