6. Most like it Static and Strong
● Dynamic :
○ Duck typing (No help from Compiler)
○ Late binding (Runtime is the King)
○ Polymorphism by capability
● Weak :
○ Not agnostic about types while code
execution (Recipe for all disasters)
○ Allow weird operations ( [ ] + { } )
○ Implicit conversions ( “2” * “3” = 6 )
● Static typing does not mean that TDD/BDD
can be ignored
● Productivity due to
○ Duck typing
○ Map/JSON over concrete object
7. Other Accusations
My reply against Accusation for To reactions by Newbies
Yep it sucks. Use “yield” instead Callbacks WTF ???
Better syntax and error handling but use
“yield” instead
Promises Really ?? WTF ???
Corporate vs Open specification trade off
Are your requirements clear ?
Evaluate case by case basis.
Fragmented community at least
hundred options of libs and
frameworks for given task
What to choose ?
Why to choose ?
Why isn’t there a standard ?
Understand Concurrency vs Parallelism.
Little slower at computation but much
better at memory usage and IO
multiplexing than JVM/CLR.
No synchronization problems. period.
Single threaded and Slow Execution is slow because its
dynamic language !
What ? It does not have
multithreading support???
Atom, Visual Code, ESLint, TypeScript ? IDE, Compiler Basic and Refactoring support ?
Procedural, functional and event driven Multiple Paradigm confusion OO, Prototypal, functional, event ?
8. Paradigms and Disciplines
● Structured [ Edgar Dijkstra : Go To Statement Considered Harmful ]
○ Avoid “goto” statements
○ Embrace block structures, for/while loops and small functions/subroutines
● Object Oriented [ Simula and Simula-67 language]
○ Avoid pointer to functions
○ Embrace code reuse - Inheritance and (Parametric and Subtype) Polymorphism
● Functional [ John McCarthy : LISP ]
○ Avoid variables, use only constants (Referential Transparency)
○ Avoid mutation or IO side effects (or reduce it by wrapping it inside a Monad)
○ Embrace Higher Order functions, Recursion, Persistent data structures, CT
● Event Driven [CSP, Actor Model]
○ Avoid function/subroutine call by direct reference
○ Embrace communication between isolated components by generating an event
and registering callback function/subroutine
10. What they ignore (or less aware of)
➔ Application reload within milliseconds during development and deployment
➔ PM2 process manager for painless deployment and monitoring
➔ V8 engine performance
➔ Serving Tens of thousands of network connections with little memory overhead
➔ ES6 “yield” is here. ES7 “async” and “await” is not necessary
➔ Using Babel (transpiler) to emit ECMAScript 5 code
➔ RamdaJS and date-fp - functional replacement for collection and date API
➔ Programmable Module level polymorphism using CommonJS
➔ Isomorphism - Mobile devices, Browser, Server and NoSql DB query
➔ NodeJS Long Time Support - https://github.com/nodejs/LTS
12. ECMAScript 6
● No semicolons
● Fat arrows (with bind feature)
● Template strings
● let - control scoping
● const - control assignments
● Destructuring
● Generator
○ Lazy collections
○ Avoid callbacks
○ Avoid promise (use but not creation)
● for-of loop
All features :- http://es6-features.org/
13. Must Have ESLint and FP plugin
● eslint - Takes care of JS language quirks
● eslint_plugin_fp - JS as pure FP language
fp/no-arguments fp/no-mutating-methods
fp/no-class fp/no-mutation
fp/no-delete fp/no-nil
fp/no-events fp/no-proxy
fp/no-get-set fp/no-rest-parameters
fp/no-let fp/no-this
fp/no-loops fp/no-throw
fp/no-mutating-assign fp/no-unused-expression
no-var fp/no-valueof-field
15. C S P for Dummies
➔ Don't communicate by sharing state, share state by communicating
➔ Communicating
◆ Conversation over channel/queues/distributed queues
◆ Remote procedure calls
➔ Sequential
◆ Execution flow
➔ Processess
◆ Coroutines
◆ Green threads (scheduled by VM)
◆ Real threads (scheduled by OS)
◆ OS Process
◆ Machines
◆ Cluster of Machines
➔ Original Paper - http://usingcsp.com/cspbook.pdf
16. CSP vs Actor Model
CSP Actor Model
Process Identity Anonymous Concrete
Message Passing Synchronous Asynchronous
Communication Channels/Queues Direct
Composition NA Applicable
Fault Tolerance Easy to built with Distributed
Queue
Hierarchy of Local and
Distributed Supervisors
➔ Hybrid approach is also viable and more practical
18. Data - Structure and Types
● Data is all we have
● Data is what we need to transform in order to create a user experience
○ Photoshop without the images is nothing
○ Word is nothing without the characters
● Instructions are data too
● Immutability matters
○ Value - Always Immutable
○ State - Snapshot. Value of something at certain point of time
○ Identity - Stable logical entity associated with a series of different values over time
○ Time - Relative term, not physically measurable
19. Computation - Function and HOF
● Higher Order Function (does either or both)
○ Accepts a function
○ Returns a function
● Higher order abstraction for
○ Computation
○ Combinators
○ DSL - Composition of computation and combinators
20. Thinking functionally
● Use function as first class citizen to build abstraction
● Avoid mutation of variable(memory pointer handle) and data (state)
● Chant this mantra every morning, “null is a billion dollar mistake”
● Favour recursion over iteration
● Procure laziness with Streams
● Use expressions over statements
● Composition over inheritance
● Many identical functions for few data structures than few different functions for many
data structures
21. RamdaJS HOF Abstraction
● Auto Currying
● Abstraction Categories
○ Object
○ Function
○ List
○ Math
○ Logic
○ Relation
○ Type
● Transducers
http://ramdajs.com/docs/
23. Software Architecture in a nutshell
“ In most successful software projects, the expert developers working
on that project have a shared understanding of the design.
This shared understanding is called ‘Architecture.’
This understanding includes how the system is divided into
components and how the components interact through interfaces.
These components are usually composed of smaller components, but
the architecture only includes the components and interfaces that
are understood by all the developers ”
- Martin Fowler
24. Abstraction and Indirection
“ The essence of abstractions is preserving information that is relevant in a given context,
and forgetting information that is irrelevant in that context ”
– John V. Guttag
“ In computer programming, indirection is the ability to reference something using a name,
reference, or container instead of the value itself ”
“ All problems in computer science can be solved by another level of indirection ….”
- David Wheeler
25. “ ….. except the problem of too many
layers of indirection ”
“ Making something easy to
change makes the overall
system a little more complex,
and making everything easy to
change makes the entire system
very complex.
Complexity is what makes
software hard to change “
27. Architecture decisions starts with
“ Optimism is an occupational hazard of programming;
feedback is the treatment. ”
- Kent Beck
● Initial market research for given Business Domain
● Security
● Transaction capability and boundaries
● Online active users growth - total vs active vs online users
● Data growth
● Testability (and hence modularity)
● External integration points
● Response generation eagerness - sync, or async
28. Micro Services done right
● It’s more social than technical
● Always start with monolith and scale gradually
● Scaling few business use cases
○ Computational complexity
○ Number of requests and responsiveness
● Scaling a business module
○ Computational complexity
○ Software as a Service
● Scaling a team
○ Programming platform expertise
○ Business Domain expertise
○ Maintenance
● Embrace async flow and Distributed Message Queues
30. KoaJS
● By authors which gave us ExpressJS
● ES6 Framework
● Promise continuation based on “co” library
● Modular Architecture
● Composable
● Compatible with NodeJS 4.x and later
● Various community plugins
http://koajs.com/
31. PM2 Process Manager
● Superior version of “cluster” module
● Load Balancing & Zero second Downtime Reload
● Compatible with almost all major web frameworks
● CPU Process monitors
● Log monitors
http://pm2.keymetrics.io/
34. Cordova Apps
● Written in HTML, CSS and JS
● Single codebase for multiple target platforms
○ Internet Browsers - IE, firefox, Chrome, Safari etc.
○ Mobile devices - Android, iOS, Windows etc.
● Webview - Chrome browser engine
● Fast development cycles compared to Native apps
● HTML5 Canvas for Game Programming
● Modern WebViews are as responsive as Native platform
● Access various device features through cordova plugins
https://cordova.apache.org
35. Features/Characteristics Hybrid Native
Runs on Chrome browser runtime OS runtime
Additional Runtime Crosswalk for 4.x, Not required for 5.x and later Not required
Approximate Software artefact
download size for say 10 screens
4.5 MB for 4.x, 3 MB for Android 5.x and later 4 MB
Increase in download Size due to
additional runtime
23 MB (one time) for Android 4.x and iOS 7 ZERO
Development HTML, CSS and JS, More widely adopted tools Java for Android, Swift for iOS
Required Tech Skills Anyone who knows web programming specific skill according to platform and
native SDK
Supported Platform Android, iOS, Windows, Symbian etc. only one platform
Relative Development and Debugging
time and responding to frequently
changing business requirements
1x 2x to 3x
Performance
Responsive. can be tuned to minute level of browser runtime
Best in class. Can be tuned to minute
level to OS runtime
Security Issues:
Insecure local data storage
Weak SSL implementation
Unintended data leaks
Reverse Engineering
Code Injection
Can be dealt Can be dealt
Additional features supported Only major features are supported. here is the detailed list
https://cordova.apache.org/docs/en/latest/guide/support/
All of which device is capable of
37. ClojureScript
● by Rich Hickey
● Compiles to JS
● LISP - Code is Data is Code
● Macros - Homoiconicity
● Immutable Data Structures - Referential transparency
● Higher Order Functions - Sheer joy of computation
● Google Closure compiler - Lots of goodies including dead code elimination
● Figwheel - Interactive development
● Nice interop with JS and NPM
● Higher learning curve but worth it
https://clojurescript.org/
38. Reagent
● Based on React
○ Functional
○ Component based architecture
○ Higher order components
● Hiccup (embed HTML)
● reagent-utils
● re-frame
https://reagent-project.github.io
39. core.async
● CSP implementation for Clojure(Script)
● First class Goroutines support inspired by Go lang
● Being Reactive
○ Responsive - Rapid and consistent response time with reliable upper bounds
○ Resilient - replication, containment, isolation and delegation.
○ Elastic - responsive under varying workload, ability to add
○ Message Driven - loose coupling, isolation and location transparency.
http://www.reactivemanifesto.org/