programming language selection

22
Programming Language Selection Dhananjay Nene March 28, 2009 A PuneTech event

Upload: dhananjay-nene

Post on 11-May-2015

11.196 views

Category:

Technology


0 download

DESCRIPTION

Technical and Business factors to be considered when choosing a programming language for a new project / application / initiative

TRANSCRIPT

Page 1: Programming Language Selection

Programming Language Selection

Dhananjay NeneMarch 28, 2009

A PuneTech event

Page 2: Programming Language Selection

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

Page 3: Programming Language Selection

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

Page 4: Programming Language Selection

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 ?

Page 5: Programming Language Selection

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

Page 6: Programming Language Selection

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 ?

Page 7: Programming Language Selection

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#

Page 8: Programming Language Selection

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

Page 9: Programming Language Selection

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 ?

Page 10: Programming Language Selection

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

Page 11: Programming Language Selection

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

Page 12: Programming Language Selection

Extraneous Factors

These are very important factors Customer Preferences Architecture Standards Frameworks and Libraries Community

Page 13: Programming Language Selection

Deployment characteristics

Hardware Requirements Ease of cloud / virtualised hosting Hosting requirements for Small vs. Medium vs.

Big apps Clustering capabilities

Page 14: Programming Language Selection

Adaptability / Agility

How quickly can you change based on changing requirements / objectives Language is only one part of the mix Frameworks Design Processes

Page 15: Programming Language Selection

Costs

Training Writing and Testing code Development Infrastructure Deployment Infrastructure

Page 16: Programming Language Selection

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

Page 17: Programming Language Selection

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

Page 18: Programming Language Selection

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

Page 19: Programming Language Selection

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

Page 20: Programming Language Selection

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

Page 21: Programming Language Selection

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.

Page 22: Programming Language Selection

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