Building a Convention Based Routes in Node.js

Convention over configuration (also known as coding by convention) is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, and not necessarily losing flexibility. It seems in programming, if we haven’t learned the basic practices of others, we’ll end of repeating those practices; discovering them on our own. This isn’t necessarily a bad thing. It can be a good way to learn. [Read More]

CSS Media Object

I just finished attending the RockIt Bootcamp (12 week program). It’s a program that teaches the LAMP full stack development (Linux, Apache, mySQL, PHP). In the next little while I will be going over some of the things which I learned. The css media object was first coined by Nicole Sullivan in 2010. It is still one of the most basic constructs to learn and understand in created good CSS content. [Read More]

Angular.js vs React.js vs Mithril.js

Apparently Facebook has a bunch of functional-style programmers, not writing in ClosureScript though! https://www.youtube.com/watch?v=IVvHPPcl2TM http://youtu.be/nYkdrAPrdcw?t=40m30s > [Starts at 40 minute 30 seconds. Person asks question then Jing Chen > laughs at question, she must know how much Pete doesn’t like Angular.] > So, the question was comparing and contrasting…React plus Flux and > Angular. …[T]hey do solve some of the same > problems but they go at it in very different ways. [Read More]

bilby.js & lenses

In JavaScript nearly everything is mutable. This can cause problems in your code when you think you have a new object or variable but instead you are operating on the referenced object. So, we create patterns to alleviate this problem. Or we use libraries like underscore.js or lodash.js which incorporate the functional concepts. Unfortunately they don’t always use immutable objects either. Bilby.js solves the mutability problem by using lenses. Using the lenses pattern one can access and change one’s objects in a safe and immutable manner. [Read More]

Match Expression for JavaScript?

Sometimes (or rather most of the time) it would be nice to have more concise code in JavaScript. I was working with a function that needed quite a bit of if statements. if was awfully cluttered. I had looked at bilby.js examples and hadn’t realized that you can do multiple ternary expressions in a row. So, instead of, if (0){ return 0 } else if (1){ if (2) { return 1 } else if (3) { return 2 } else { return 3 } } else { return 4 } You can do, [Read More]

A Distributed & Robust Feedly

In light of the recent attack on Feedly.com I thought it might be interesting to see other ways we could propogate data accross the Interent without being succeptible to attacks, or, at least less accessible. With the approach outlined below we need to use an actual app instead of being able to use a browser (there might be a way to use a browser also, not sure how it would work though). [Read More]

JavaScript

I’ve jumped ship from Excel programming over to JavaScript (in a functional manner). I’ve also gone the way of Linux away from Windows. I love Excel and its power. But I see the writing on the wall and am moving to where I can hopefully get some work and starting making some moolah. You can follow my new blog over at http://thisisafiller.ghoster.io/. If anyone is interested in the products I’ve made let me know how you like them and send me an e-mail. [Read More]

Prototypes & Compositions with Objects

I was trying to figure out the best way to have functions be both compatible with an object oriented paradigm and a functional oriented paradigm when working on objects. My implementations are probably naive, but instructive nevertheless. It seems that lo-dash and other libraries have done a good job bridging those worlds. Let’s say you have an object O such that function O(a, b){ this.a = a this.b = b } var o = function(a, b){ return new O(a, b) } Now, you want to extend the object but you also want the option to use the object in a more fuctional way with compose. [Read More]

Functional Immutability in JavaScript

This is taken from Michael Fogus’ book Functional JavaScript in the chapter Purity, Immutability, and Policies for Change. Immutability is impossible to achieve in JavaScript without using Object.freeze but it only performs makes the object immutable shallowing, you have to roll your own deepFreeze if you would like to make the object truly immutable. So there are some practices you can do to make your functions and variables perform in a more immutable manner. [Read More]

Functional or Object Oriented JavaScript?

When people are first exposed to JavaScript and its minimal set of tools (functions, objects, prototypes, and arrays), many are underwhelmed. Therefore, in order to “modify” JavaScript to conform to their idea of what it takes to model software solutions, they very often seek out or re-create class-based systems using the primordial ooze. - Michael Fogus Functional Programming Of course, the next sentence he softens that quote, I just enjoyed the first part though. [Read More]