Programming Language Selection
-
Upload
dhananjay-nene -
Category
Technology
-
view
11.200 -
download
0
description
Transcript of Programming Language Selection
Programming Language Selection
Dhananjay NeneMarch 28, 2009
A PuneTech event
Why language selection ?
There is no universally superior language Language selection is fitment of language
strengths and weaknesses to a context Language selection often has long term
implications including those of business capability, cost and technology lock-in
It is therefore a technology + management decision
Dimensions of Selection
Capability : What the languages can / cannot do
Productivity : How efficiently can one write programs using the languge
Ramp Up : How easily can you get online Extraneous Factors Costs : What are the costs of using the
language
Questions to be answered
Can the language deliver on expectations ? What is the cost of delivering on expectations
How long does it take to write and debug code ?
If I don't already have the skill sets what is the cost and time required to build them ?
What is the support structure available from community and corporate groups ?
What are the hardware and deployment costs ?
Capability
Style Object Orientation Function Orientation /
Higher Order Functions
Typing Static Dynamic
Reflection Metaprogramming
Memory Usage Performance Generic Classes Garbage Collection Integration Error Handling Multi-threading Library coverage and
support
Object Orientation
Encapsulation / Information Hiding Inheritance Polymorphism Are all types objects ? Are all operations performed by sending
messages to objects ? Are all user defined types objects ?
Functional Programming Elements
Higher Order Functions Code Blocks Generators (potentially infinite data, lazy
evaluation) List operations eg. map / reduce etc Closures Traditional : Haskell,Erlang Upcoming : Scala, Clojure, F#
Static or Dynamic Types ?
In static typing, type is associated with a variable, in case of dynamic typing, it is associated to the runtime value
Thus dynamic typing cannot often infer type until at runtime
Static typing catches more errors at compile time. Makes debugging easier
Dynamic types allows more flexibilities (eg metaprogramming) and lower compile idle times
Metaprogramming
Inspect existing classes / methods Instantiate classes / Invoke methods using
dynamic class / method structures Create new classes / functions / methods on
the fly ? Modify existing classes / methods on the fly ?
Productivity
Expressiveness Eg Wikipedia : Comparison of Programming Langs
C / C++ =>1, JAVA => 1.5, Perl => 6, Python => 6.5
Speed of writing code LOC per hour can also vary based on language
http://page.mi.fu-berlin.de/prechelt/Biblio/jccpprt2_advances2003.pdf
Compilation overheads IDE speeds Refactoring capability
Performance / Scalability / Reliability
Performance : How fast can the programs run for given hardware
Scalability : How easily / cost effectively can the software be scaled to handle higher loads
Reliability : How fault tolerant can the resultant software be
Extraneous Factors
These are very important factors Customer Preferences Architecture Standards Frameworks and Libraries Community
Deployment characteristics
Hardware Requirements Ease of cloud / virtualised hosting Hosting requirements for Small vs. Medium vs.
Big apps Clustering capabilities
Adaptability / Agility
How quickly can you change based on changing requirements / objectives Language is only one part of the mix Frameworks Design Processes
Costs
Training Writing and Testing code Development Infrastructure Deployment Infrastructure
Checklist
What do my customers want What does my architecture body state
Can I meet performance / memory / app specific constraints ? What is the performance sensitivity
How critical is time to market How critical is adaptability and agility
How critical are the budget constraints How quickly can I ramp up
What is the available community
My opinions on language futures
These are my own These are empirical These are subjective Languages under pressure :
Java under pressure due to productivity issues PHP under pressure due to performance / hardware
/ cormplex topologies Python / Ruby under pressure due to smaller
installed base and multicore concerns
Trends
Innovation in Web development is maturing Web and Pre-web architectures are both
starting to get used The VM is the new OS CPUs/Disks/RAM/Networks have grown fast
enough for traditional transaction processing Service Integration becoming critical Scaling, Multicore becoming important issue for
many apps
Java
The big daddy - #1. But high entry barriers Long time to train, high requirements to deploy
Low development productivity Superb performance, scalability, community Multi threading powerful but tough Considerable risk from other languages on the
JVM eg. Jython, JRuby, Groovy, Scala, Clojure Likely to loose share to competition
PHP
Language with lowest entry barriers Easy to learn, easy to train
Large community and supporters Phenomenally wide libraries coverage Scaling up is feasible but costs prohibitive Tougher acceptance when web + non web are
used together Unlikely to change share much due to a defined
niche
Python / Ruby
High productivity and capability languages Have small but vibrant communities. Finding
trained people can be tougher Excellent Framework support Current runtimes have difficulties in multi
threading Lot of investments still continuing in VM
development. Likely to continue to grab more share.
Functional Programming Langs
Lot of current interest. Am studying these with great interest.
Primarily useful for computation / algorithm intensive apps. As yet am unable to find them useful for typical CRUD apps
Maturing still in progress. Too much rethinking and retraining required currently. Many items still unclear (eg. ORMs, state maintenance, performance)
Invest in short term only if very obvious benefits Suggest incremental FP usage to learn more