最近开始了解一种新的函数式+对象式语言——scala,以后我会分篇在这里记下自己的心得。

本文主要内容摘自《Programing in scala  2nd Edition》。

 

Functional programming is guided by two main ideas:

The first idea is that functions are first-class values.

In a functional language,

You can

  • pass functions as arguments to other functions
  • return them as results from functions
  • store them in variables
  • define a function inside another function
  • define functions without giving them a name

 

functions that are first-class values provide a convenient means for abstracting over operations and creating new control structures.

The second main idea of functional programming is that

the operations of a program should map input values to output values rather than change

data in place. In other words,  methods should not have any side effects. They should communicate

with their environment only by taking arguments and returning results. a method without any side effects are called referentially transparent.

Functional languages encourage immutable data structures and referentially transparent methods.

 

 


 

readable angular tests

In this post, I'll provdes some tips to create readable angular test.### General Tips#### Use describe or nested describe to structure sp...… Continue reading

Exposing event stream from monolith

Published on September 18, 2017