Skip to content

Instantly share code, notes, and snippets.

View ZaymonFC's full-sized avatar
🧗

Zaymon Antonio ZaymonFC

🧗
View GitHub Profile
// Dynamic.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include <algorithm>
#include <iostream>
#define INT_MAX 1000
(require '[clojure.set :as set])
(defn vertical-line [board line]
(->> board (map (fn [l] (nth l line)))))
(defn vertical-lines [board]
(->> (range 9) (map (fn [line] (vertical-line board line)))))
(defn subgrids [board]
(let [board (->> board

Thoughts on OOP.

Note: This is written as part of a letter in response to a good friend who asked for my opinion on OOP. This is mostly an off the cuff work in progress:

What a question to try and tackle. I have so much that I want to say but I am going to try and distill my thinking to what I believe are the most relevant points. This might get long because I'm going to use this as a recap of my own understanding on the topic as well 🧠.

Mutable State

By far the most dangerous thing about OOP is the use of mutable state. You've probably noticed in your programming career, especially making the jump to the front-end that mutable state makes everything harder. Every guarantee breaks down. When you have some object with a mutable API, and multiple things holding a reference to that object or it's state, there's no good way to coordinate updates to that object without breaking consumers, especially in a multi-threaded context.

URL: https://www.decware.com/newsite/zkit2.htm
Quantity: 1
Mouser #: 75-516D108M035-E3
Desc: Aluminum Electrolytic Capacitors - Leaded 1000uF 35volts 20%
Quantity: 3
Mouser #: 647-TVX2W330MCD
Desc: Aluminum Electrolytic Capacitors - Leaded 450volts 33uF 18x41 20%
Quantity: 2
Mouser #: 539-150104J400EC
@ZaymonFC
ZaymonFC / gist:d5a15f04b9e89e2ab8cc55a77d1ed3dc
Last active April 15, 2024 18:52
Simulator device set to "iPad Pro"
cleaned: /Users/zaymonfoulds-cook/Projects/dxos/packages/apps/composer-app/build/ios-simulator +577ms
• generated icons +2072ms
• package prepared +1358ms
• building for iOS Simulator +303ms
• ERROR: failed to archive project +37101ms
• Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build CONFIGURATION_BUILD_DIR=/Users/zaymonfoulds-cook/Projects/dxos/packages/apps/composer-app/build/ios-simulator -allowProvisioningUpdates -configuration Debug -scheme Composer-dev -destination "platform=iOS Simulator,OS=latest,name=iPad Pro" CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS= CODE_SIGNING_ALLOWED=NO
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES