RSSAmplifier

Blog

Software for Days | AI, Functional Programming & Philosophy

Software for absolute days.

softwarefordays.comRSS feed ↗15 posts

Latest posts

Making GitHub Actions Suck a Little Less

Do you find yourself babysitting your CI environment because of transients failures like ETIMEDOUT . ECONNRESET . npm ERR! network . 502 Bad Gateway ? Yeah us too. Our problem has gotten even worse lately because of all the AI coding agents under our command. Great throughput requires great responsibility. The Solution: A Simple Auto-Retry Workflow # This retry loop: name : Auto - Retry Failed…

Software is Mostly All You Need

Over the last 6 months and the last 6 weeks in particular, AI coding agents have shown to be incredibly capable at writing software. Tasks that traditionally required weeks of human labor can now be done in days if not hours. Even more incredibly, software systems that are designed from the start to harness AI coding agents exhibit many of the characteristics of the neural nets that were integral…

Paradigmatic Advantages of Functional Programming

Excerpted from Functional Programming and the Semantics of Change, State & Time because sometimes 100 words are worth a 1000. There are many advantages to functional programming. Programs that deal with mutation are “drastically more difficult” to reason about than ones that do not. Referential transparency is violated when we include set! [i.e. assignment operations] in our computer language.…

Object Names Changeability

Excerpted from Functional Programming and the Semantics of Change, State & Time . Changeability implies an object. The rational number “2/3” cannot change, for example. Change the denominator of “2/3” from 3 to 5 and its identity changes as well to “2/5”. Neither can the integer “24.” Increase the number of units represented by “24” and it may change to “25.” const HOURS_IN_DAY = 24 ; /** * NOT…

Functional & Object-Oriented Programming are Diametrically Opposed

Excerpted from Functional Programming and the Semantics of Change, State & Time . That functional programming opposes object-oriented programming in some fundamental way is a widely-held programming cliche. We list features like immutability, functions and composition in contrast to mutability, classes and inheritance. We tout Clojure and Haskel as functional languages on one end of the spectrum…

Using JavaScript to Implement the Same Stateful Program in both Object-Oriented and Functional Styles

Excerpted from Functional Programming and the Semantics of Change, State & Time . Some real programs are designed to produce output based solely on input. Ideally, compilers output the same binaries provided the same input files, for example. More frequently, however, programs require state, and user input together with the current state of the program determine the next state or output of the…

Resolving the Time Paradox Implied by Functional Programs

Excerpted from Functional Programming and the Semantics of Change, State & Time . “No man can ever cross the same river twice.” Because what’s a river? I mean, we love this idea of objects; like there’s this thing that changes. Right? There’s no river. Right? There’s water there at one point-in-time. And another point-in-time, there’s other water there. — Rich Hickey, Are We There Yet , quoting…

Functional Programming as a Scientific Revolution

Excerpted from Functional Programming and the Semantics of Change, State & Time because sometimes you need to see the waterfall to want to take the hike. We were all object-oriented programmers at one point in time — Rich Hickey, The Value of Values Assimilation of functional semantics with any regular conception of the physical world is no easy task. Look again around the room, bus or park and…

Hello, World

Had a good run using Medium as my blogging platform. It served as a “google doc,” a web-based document editor with automatic content uploads, and a content-management system, publishing drafts that correspond one-to-one in appearance with the published form. Medium was seemingly optimized for a reader-writer experience, including clean styling out-of-the-box, draft-sharing, and gist and other…

Functional Programming and the Semantics of Change, State & Time

The “functions vs. objects” cliche is an artifact of a profound truth about program structures and semantics. They are indeed opposites on some almost physiological level much like oil and water. And the choice between them has dramatic implications for our programs, installing differing world-views about concepts as fundamental as identity, change, state and even time. The object-oriented version…

Watch, watchGroup, watchCollection and Deep Watching in AngularJS

The Many Layers of Change Detection in Angular 1.x # A user clicks the “upvote” button, attempting to increase the vote count to 1034. An action $apply ed through an ng-click < i class = " icon upvote " ng-click = " vm.user.upvote(vm.answer) " > </ i > would trigger a $digest cycle under the hood, which checks all registered $watch es for changes. Then, an expression providing “voted” styling for…

Where Javascript Memory Management Ends and Angular $destroy Begins

A brief look inside the source code inspired by this SO question # Keep this example controller function in mind: angular . module ( 'myModule' ) . controller ( 'fileUploadCtrl' , function ( $scope , FileUploader ) { $scope . uploader = new FileUploader ( { settings : { } } ) ; var reader = new FileReader ( ) ; reader . onload = function ( event ) { var img = new Image ( ) ; img . onload =…

AngularJS 1.x: Building Reusable Directives

Angular offers many benefits to developers building complex web applications. Expressive HTML, model and view syncing and dependency injection are a few of the most powerful. But the true power of Angular comes from the whole being greater than the sum of its parts. This is something that is difficult to relay in its entirety through a blog post or a single example (and difficult to grasp…

Active Record Join Tables: “Plain Vanilla” to Many-to-Many Self-Join

(For a summary, visit my SO post .) Plain Vanilla Join Table # Ordinarily, a join table works to account for a many-to-many relationship between two otherwise independent models. As an example, a Player may be a member of many :teams over the course of a career. Conversely, each Team may have many :players. Each Contract joins a Player to a Team . app/models/team.rb class Team < ActiveRecord ::…

From Law to Code

I had a birthday this year despite disliking my job. Apparently, my daily fight against workflow did not slow down time. Practicing law is not a peculiar result for someone who went to law school, but nonetheless that’s what it felt like to me, and increasingly so, every week, month and year that passed. In retrospect, the seed that ultimately grew into my career move was planted in college. When…