Skip to main content

Jorge Gamba

Jorge Gamba's Public Library

  • may seem like useful utility methods. In reality, they aren't. In fact, they trick your mind into thinking that null is equivalent to white space, which it isn't.
  • Null isn't equivalent to anything; it's the absence of a value.
  • Various empty and white space strings ("", " ", etc), on the other hand, are values, although, perhaps, not particularly interesting values.

  • using Primitive Obsession is like being seduced by the Dark Side. "I'm only dealing with people's ages in this one method call
  • Next thing you know, your Death Star is getting blown up by a band of irritating yet plucky and photogenic youngsters.
  • No need to make an (oh so lame) Age class

2 more annotations...

  • the thoughtful use of types can make a design more transparent and improve correctness at the same time.
  • Use records or tuples to group together data that are required to be consistent (that is "atomic") but don't needlessly group together data that is not related.

  • we'll look at various ways of connecting these step functions into a single unit
  • For example, consider the validation function
  • two possible cases: either the data is valid (the happy path), or something is wrong, in which case we go onto the failure path and bypass the rest of the steps

19 more annotations...

  • This will deliberately be a very simple data-flow oriented recipe with no special tricks or advanced techniques
  • a very simple use case, namely updating some customer information via a web service.
  • requirements:

25 more annotations...

  • to create a robust real world application you must deal with validation, logging, network and service errors, and other annoyances. 

     So, how do you handle all this in a clean functional way?
  • using a fun and easy-to-understand railway analogy.
  • Any Haskellers reading this will immediately recognize this approach as the Either type, specialized to use a list of a custom error type for the Left case

7 more annotations...

  • Well, class is also an object “template” but in OOP languages it is also basic unit of encapsulation is a class. On the other side, the only role of namespaces is to categorize classes and structs.
  • If you think more about it, namespaces with functions and variables would become nothing else than static classes, just with namespace keywords instead of class.
  • you will be able to use “using static” to import a static class as a namespace, i.e. you will be able to use the methods directly without prefixing them with the class name.

6 more annotations...

  • while working on one project, you need to use another project from within it
  • you want to be able to treat the two projects as separate yet still be able to use one from within the other.
  • Git addresses this issue using submodules

1 more annotation...

  • One of McCabe's original applications was to limit the complexity of routines during program development
  • he recommended that programmers should count the complexity of the modules they are developing, and split them into smaller modules whenever the cyclomatic complexity of the module exceeded 10
  • , the figure of 10 had received substantial corroborating evidence

1 more annotation...

  • Most of these patterns are trivially reduced to elementary functional constructs.
  • both the object-oriented and the functional paradigm have a shared goal - the solution of some problem
  • The difference between the paradigms lies in the underlying abstractions upon which they are established

64 more annotations...

  • is a way to make a language more expressive, while still maintaining full static type-safety
  • a function or a data type can be written generically so that it can handle values identically without depending on their type
  • Such functions and data types are called generic functions and generic datatypes respectively and form the basis of generic programming

  • if you give a function less arguments than it expects you get back another function that only expects the missing arguments
  • its trivially easy to write a 'Curry' function that will return any function you give it in a curried version.
  • Now we can curry our curriedAdd by just supplying one argument and then use our new add5 function as many times as we want:

3 more annotations...

  • are objects which encapsulate state and behavior, they communicate exclusively by exchanging messages which are placed into the recipient’s mailbox
  • actors are the most stringent form of object-oriented programming
  • it serves better to view them as persons: while modeling a solution with actors, envision a group of people and assign sub-tasks to them, arrange their functions into an organizational structure and think about how to escalate failure

8 more annotations...

1 - 20 of 20763 Next › Last »
20 items/page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo