Un interessante case study sulle questioni relative ai progetti di ridimensionamento che utilizzano un linguaggio dinamico e interpretato può essere trovato in Inizio Scala di David Pollak.
I started searching for a way to express the code in my brain in a simpler, more direct way. I found Ruby and Rails. I felt liberated. Ruby allowed me to express concepts in far fewer lines of code. Rails was so much easier to use than Spring MVC, Hibernate, and the other “streamlined” Java web frameworks. With Ruby and Rails, I got to express a lot more of what was in my head in a shorter period of time. It was similar to the liberation I felt when I moved from C++ to Java...
As my Ruby and Rails projects grew beyond a few thousand lines of code and as I added team members to my projects, the challenges of dynamic languages became apparent.
We were spending more than half our coding time writing tests, and much of the productivity gains we saw were lost in test writing. Most of the tests would have been unnecessary in Java because most of them were geared toward making sure that we’d updated the callers when we refactored code by changing method names or parameter counts. Also, I found that working on teams where there were mind melds between two to four team members, things went well in Ruby, but as we tried to bring new members onto the team, the mental connections were hard to transmit to new team members.
I went looking for a new language and development environment. I was looking for a language that was as expressive as Ruby but as safe and high-performance as Java...
Come puoi vedere, le principali sfide nel ridimensionamento del progetto per l'autore si sono rivelate nello sviluppo di test e nel trasferimento di conoscenze.
In particolare, l'autore approfondisce la spiegazione delle differenze nella scrittura di prova tra le lingue digitate dinamicamente e staticamente nel Capitolo 7. Nella sezione "Coniglietti terribilmente uccisi: l'autore di Dwemthy's Stairs" discute la porta Scala di un particolare esempio di Ruby:
Why the Lucky Stiff... introduces some of Ruby’s metaprogramming concepts in Dwemthy’s Array in which a rabbit battles an array of creatures. N8han14 updated the example to work in Scala...
Compared to the Ruby code, the library parts of the Scala code were more complex. We had to do a lot of work to make sure our types were correct. We had to manually rewrite Creature’s properties in the DupMonster and the CreatureCons classes. This is more work than method_missing
. We also had to do a fair amount of work to support immutability in our Creatures and Weapons.
On the other hand, the result was much more powerful than the Ruby version. If we had to write tests for our Ruby code to test what the Scala compiler assures us of, we’d need a lot more lines of code. For example, we can be sure that our Rabbit could not wield an Axe. To get this assurance in Ruby, we’d have to write a test that makes sure that invoking |^
on a Rabbit fails. Our Scala version ensures that only the Weapons defined for a given Creature can be used by that Creature, something that would require a lot of runtime reflection in Ruby...
La lettura di cui sopra può far pensare che man mano che i progetti crescono, la scrittura di test potrebbe diventare proibitiva. Questo ragionamento sarebbe sbagliato, come dimostrano esempi di progetti di grandi dimensioni di successo menzionati proprio in questa domanda ("Python è usato con successo per ... YouTube").
Il problema è che il ridimensionamento dei progetti non è molto semplice. Progetti molto ampi e di lunga durata possono "permettersi" diversi processi di sviluppo del test, con suite di test di qualità di produzione, team di sviluppo test professionale e altri materiali pesanti.
Suite di test di YouTube o Kit di compatibilità Java sicuro vivi un diverso life di test in un piccolo progetto tutorial come Dwemthy's Array .