ALL
Understanding an interesting JavaScript map function question
With the evolvement of JavaScript, lots of new features have been added this old but robust language. Among them are lots of functional programming language related functions like map, filter, each etc. In this post, we will cover one function map and its interesting behavior.Before dive into the details, let first take an example, do you know the output of below function call?['1', '7', '11'].map(parseInt)You may think that it's easy and the output would be[1, 7, 11]Can you try to run this by yourself and you may be surprised of the output. The actual result is[1, NaN, 3]What's happenin...
3,689 0 MAP JAVASCRIPT FUNCTIONAL PROGRAMMING
Functional Programming in C++
Probably everyone reading this has heard “functional programming†put forth as something that is supposed to bring benefits to software development, or even heard it touted as a silver bullet. However, a trip to Wikipedia for some more information can be initially off-putting, with early references to lambda calculus and formal systems. It isn’t immediately clear what that has to do with writing better software.My pragmatic summary: A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states t...
2,546 0 C++ FUNCTIONAL PROGRAMMING
First steps with Scala, say goodbye to bash scripts…
Those who know me are aware that I’ve been following play framework, and actively taking part of it’s community, for a couple of years.Playframework 2.0 is right around the corner, and it’s core is programmed in Scala, so it’s a wonderful opportunity to give this object-oriented / functional hybrid beast a try…Like many others, I will pick a very simple script to give my first steps…Finding an excuse to give Scala a tryWith a couple of friends we are on the way to translate play framework documentation to spanish (go have a look at it at http://play...
2,677 0 SCALA FUNCTIONAL PROGRAMMING BASH SCRIPT REPLACEMENT
Functional Programming For Object Oriented Programmers
After recently remarking about how I finally "got" functional programming I was asked by one of my millions of twitter followers... ¬_¬ to write up an explanation of a small F# program spoken in terms that fellow O-O programmers would understand. Before I become too entrenched into the functional programming way of thinking, that is, and can't explain it anymore. As a former tutor this is one of the major problems with being able to teach something once you understand it. You've forgotten how not to make sense of the concept and what finally helped you get over the me...
1,851 0 FUNCTIONAL PROGRAMMING OOP F# PATTERN