4 ms·
"Ultimately, a programming language that's useful for large-scale programming projects needs to have clear, unambiguous grammar and syntax so that any developer
by praptak 16y ago
"Ultimately, a programming language that's useful for large-scale programming projects needs to have clear, unambiguous grammar and syntax so that any developer familiar with the project and the language can instantly figure out what's going on."
I have a hard time swallowing the necessity to rely on restricting the expressive power of the language to prevent people from creating code that is hard to understand. My current project is in the order of 100 KLOC in Python (the horror, you can even redefine methods of single objects at runtime!) and so far none of the problems we've got can be tracked to language abuse.
- RiderOfGiraffes 16y agoTurning that around, you think that in the presence of a powerful and expressive language it is nevertheless somehow easy or straight-forward to force people to create code that's easy to understand? I'd be interested to read more of your thinking in this matter.
- praptak 16y agoNo, it is neither easy nor straightforward. And if you think of it as "forcing", then you have already lost. The key factor is good people (this itself makes it not easy, sorry to disappoint.) If you have a competent team you don't need a dumbed down language to keep them in check. If you have incompetent people, then you may use a restrictive language as a crutch. But don't expect good results.
- tomh- 16y agoWell, take a look at this sample (http://dispatch.databinder.net/Common_Tasks http://dispatch.databinder.net/Common_Tasks) and see if you can figure out what all those operators do just by looking at them :) Thats the kind of abuse possible with languages such as Scala, Haskell or c++ templates.
- fogus 16y agoTake a look at this sample (http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/aop/package-summary.html http://static.springsource.org/spring/docs/2.5.x/api/org/spr...) and see if you can figure out how to use these classes just by looking at them. That's the kind of abuse possible with languages such as Java. --- Seriously. Every new API that you intend to use has a learning curve, some more significant than others. Every new API is a new "language".
- Stormbringer 16y agoIt's not really a fair objection. AOP isn't part of Java, it is an ugly hack that someone bolted onto the outsides of it. Seriously. You write your Java code, you compile it, and then in the night the evil AOP pixies sneak in and slip chunks of bytecode into your compiled classes.
- scott_s 16y agoThe library tomh linked to is not a part of the Scala language or the standard library.
- nl 16y agoI think if you are familiar with the domain that API applies to (Aspect Oriented Programming) then you will instantly understand how to use them. If every API is a new language then you are doing it wrong - the API should respect the conventions of both the computer language it is in, and the domain-specific terminology of the domain it serves.
- akeefer 16y agoPython as a language does not lend itself to the same syntatic abuses as either Scala or C++ (or, for that matter, Perl). While you can certainly do some sketchy things, there's a pretty strong Python tradition of there being one standard way to do something, which is one of the language's strengths in my opinion, especially as you scale it up to larger projects. I'd also suggest that 100k is not a particularly large project; it's reasonably on the order of what a good developer can more or less be familiar with, and the real problems with expressive abuse come into play an order of magnitude or so above that that level, where it's impossible to be familiar with everything. Hence why the article was talking about the problems with bringing Scala into an existing, large project; if your code base is 10k LOC it's not nearly as problematic as if you have 1MM LOC, because with 10k you can reasonably remember anything (and obviously 100k is somewhere along the continuum). If you'd said you worked on a 1MM LOC C++, Scala, or Perl project where you didn't have to establish strict coding standards to avoid the code base descending into madness, I'd be pretty shocked.
- chromatic 16y agoIf you'd said you worked on a 1MM LOC C++, Scala, or Perl project where you didn't have to establish strict coding standards to avoid the code base descending into madness, I'd be pretty shocked. If you've worked on a 1MM SLOC project in any language where you didn't have to establish coding standards, you were exceptionally fortunate to have such a disciplined, single-minded team. Python as a language does not lend itself to the same syntatic abuses... Syntactic abuses are the least of my maintainability worries--if they're truly a factor in your development environment, you need to have a friendly discussion with the antisocial sociopaths who write deliberately obfuscated code. Python's good at enforcing a particular indentation style. That's never been interesting to me with regard to coding standards.