-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss.xml
More file actions
11554 lines (11179 loc) · 764 KB
/
rss.xml
File metadata and controls
11554 lines (11179 loc) · 764 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title><![CDATA[Fezcodex]]></title>
<description><![CDATA[A personal blog by Ahmed Samil Bulbul]]></description>
<link>https://fezcode.com</link>
<image>
<url>https://fezcode.com/logo512.png</url>
<title>Fezcodex</title>
<link>https://fezcode.com</link>
</image>
<generator>RSS for Node</generator>
<lastBuildDate>Tue, 17 Mar 2026 23:29:28 GMT</lastBuildDate>
<atom:link href="https://fezcode.com/rss.xml" rel="self" type="application/rss+xml"/>
<pubDate>Tue, 17 Mar 2026 23:29:27 GMT</pubDate>
<copyright><![CDATA[2026 Ahmed Samil Bulbul]]></copyright>
<language><![CDATA[en]]></language>
<managingEditor><![CDATA[samil.bulbul@gmail.com (Ahmed Samil Bulbul)]]></managingEditor>
<webMaster><![CDATA[samil.bulbul@gmail.com (Ahmed Samil Bulbul)]]></webMaster>
<ttl>60</ttl>
<item>
<title><![CDATA[The Lost Art of the Tactile: Why 90s Cinema Ruined Modern Movies]]></title>
<description><![CDATA[[object Object]]]></description>
<link>https://fezcode.com/blog/the-lost-art-of-the-tactile-90s-cinema</link>
<guid isPermaLink="false">https://fezcode.com/blog/the-lost-art-of-the-tactile-90s-cinema</guid>
<dc:creator><![CDATA[Ahmed Samil Bulbul]]></dc:creator>
<pubDate>Wed, 11 Mar 2026 00:00:00 GMT</pubDate>
<content:encoded><![CDATA[<h1>The Lost Art of the Tactile: Why 90s Cinema Ruined Modern Movies</h1>
<p>I just finished a double feature of <strong>The Hunt for Red October</strong> and <strong>Die Hard</strong>, and I am vibrating with a specific kind of cinematic rage. If you look at the screen today, everything is "perfect." It’s 8K, it’s color-graded to within an inch of its life, and it’s completely, utterly <strong>weightless</strong>.</p>
<p>We need to talk about why the late 80s and 90s were the absolute zenith of "The Real," and how we traded it all for digital convenience.</p>
<h2>1. The Geometry of the Action (The McTiernan School)</h2>
<p>John McTiernan (<strong>Die Hard</strong>, <strong>Predator</strong>, <strong>The Hunt for Red October</strong>) is a god of spatial awareness. When John McClane is crawling through a vent, you know exactly where he is in relation to the terrorists. When the <em>Red October</em> is playing cat-and-mouse with the <em>Dallas</em>, you understand the depth, the sonar pings, and the crushing pressure of the water.</p>
<p>This is <strong>Methodology 101</strong>: Geography. </p>
<p>Modern cinema often suffers from "Digital Chaos Syndrome." Because cameras are now tiny and CGI is "limitless," directors move the camera in ways that are physically impossible. If the camera is doing a 720-degree corkscrew through a crumbling building, my brain checks out. In <strong>Die Hard</strong>, every shot feels like it was taken by a human being standing in a room. That grounded perspective creates <em>stakes</em>.</p>
<h2>2. The Analog Weight (Celluloid vs. Sensors)</h2>
<p>Let's talk tech. <strong>The Hunt for Red October</strong> was shot on 35mm film (Anamorphic). </p>
<ul>
<li><strong>Analog:</strong> Light hits silver halide crystals. It’s a chemical reaction. It has "grain," which is basically the heartbeat of the image. It handles shadows (chiaroscuro) with a richness that digital sensors still struggle to replicate without looking "noisy."</li>
<li><strong>Digital:</strong> Light hits a Bayer pattern filter on a CMOS sensor. It’s math. It’s clean. Too clean.</li>
</ul>
<p>When you watch <strong>Terminator 2: Judgment Day</strong> or <strong>Jurassic Park</strong> (1993), the CGI is limited. It had to be blended with practical animatronics. Because the CGI was expensive and hard, they used it sparingly. The result? The T-1000 feels like it has <em>mass</em>. When it hits the floor, you feel the impact. </p>
<pre><code class="language-mermaid">graph LR
A[Practical Effects] --> C[Physical Presence]
B[Early CGI] --> C
C --> D[Cinematic Weight]
E[Modern 100% CGI] --> F[Visual Noise]
F --> G[Weightlessness]
</code></pre>
<h2>3. The "School of Dirt" vs. The "School of Clean"</h2>
<p>In the 90s, things were <strong>dirty</strong>. Look at <strong>The Fugitive</strong> or <strong>Seven</strong>. The environments felt lived-in. There was steam, there was grime, there was real sweat (not just a spray bottle).</p>
<p>Modern "Volume" filming (using LED screens like in <em>The Mandalorian</em> or <em>Ant-Man</em>) creates a lighting environment that is technically perfect but emotionally sterile. In <strong>The Hunt for Red October</strong>, the lighting inside the sub is oppressive. It’s red, it’s blue, it’s dark. You can almost smell the diesel and the unwashed sailors. </p>
<h2>4. The Great Movie List of "Realness"</h2>
<p>If you want to remember what it’s like to feel a movie in your teeth, go back to these:</p>
<ol>
<li><strong>Heat (1995):</strong> The shootout. No music. Just the actual sound of blanks echoing off real buildings in LA.</li>
<li><strong>Starship Troopers (1997):</strong> Hundreds of physical props and incredible creature work that still looks better than most Marvel movies today.</li>
<li><strong>Speed (1994):</strong> They actually jumped a bus. You can see the bus landing. You can see the suspension screaming.</li>
<li><strong>Point Break (1991):</strong> Real skydiving. Real surfing. Real adrenaline.</li>
<li><strong>Ronin (1998):</strong> The car chases. No "fast-forward" editing. Just real drivers doing 100mph through narrow Parisian streets.</li>
</ol>
<h2>The Verdict</h2>
<p>We’ve traded <strong>texture</strong> for <strong>fidelity</strong>. We have more pixels than ever, but less "soul" in the frame. The 90s were the sweet spot where technology was advanced enough to realize grand visions (like <strong>Titanic</strong> or <strong>The Matrix</strong>) but still tethered to the physical world by the limitations of film and practical stunts.</p>
<p>Go watch <strong>Die Hard</strong> again. Watch the way the glass cuts his feet. That’s not a digital asset. That’s cinema.</p>
<p>Stay tactile, folks.</p>
<hr>
<h3>Tactical HUD & CRT Protocols</h3>
<p>If you want to experience the phosphor-glow of 80s cinema for yourself, check out these utilities:</p>
<ul>
<li><strong><a href="/apps/crt-tactical-map">CRT Tactical Map</a>:</strong> Immerse yourself in a high-fidelity submarine command center. Draw vectors and plot telemetry with authentic 80s phosphor physics.</li>
<li><strong><a href="/apps/github-thumbnail-generator">Github Thumbnail Creator</a>:</strong> Generate tactical repository headers using the <code>TACTICAL_MAP</code> theme, complete with Ankara-locked coordinates and strategic HUD elements.</li>
</ul>
<p><a href="https://fezcode.com/blog/the-lost-art-of-the-tactile-90s-cinema">Read more...</a></p>]]></content:encoded>
</item>
<item>
<title><![CDATA[The Side Character Conspiracy: Solving the Sitcom's Greatest Mystery]]></title>
<description><![CDATA[[object Object]]]></description>
<link>https://fezcode.com/blog/side-character-conspiracy-sitcom-rant</link>
<guid isPermaLink="false">https://fezcode.com/blog/side-character-conspiracy-sitcom-rant</guid>
<dc:creator><![CDATA[Ahmed Samil Bulbul]]></dc:creator>
<pubDate>Sun, 08 Mar 2026 00:00:00 GMT</pubDate>
<content:encoded><![CDATA[<h1>The Side Character Conspiracy: Solving the Sitcom's Greatest Mystery</h1>
<p>The rain is pouring outside the office of my mind, and I’m staring at a crime scene that’s been repeated for decades. The victim? Your attention span. The perpetrator? A bland, milquetoast "Main Character" who is supposedly the reason we’re all here.</p>
<p>But I’ve been looking at the clues, and the math doesn't add up.</p>
<p>In every legendary sitcom, the "protagonist" is actually a Trojan Horse. They are a boring container used to smuggle in the real stars: the weirdos, the creeps, and the one-note wonders living in the margins.</p>
<h2>The Case File: Protagonist vs. Side Character</h2>
<p>Let’s look at the evidence. Why is the person with the most screen time usually the least interesting person in the room?</p>
<table>
<thead>
<tr>
<th align="left">Attribute</th>
<th align="left">The Main Character (The "Victim")</th>
<th align="left">The Side Character (The "Suspect")</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><strong>Motive</strong></td>
<td align="left">Wants love, a career, or "to grow."</td>
<td align="left">Wants a specific sandwich or to chaos-agent.</td>
</tr>
<tr>
<td align="left"><strong>Arc</strong></td>
<td align="left">Forced to change, becoming less funny.</td>
<td align="left">Stays exactly the same (Perfect).</td>
</tr>
<tr>
<td align="left"><strong>Relatability</strong></td>
<td align="left">High (and therefore exhausting).</td>
<td align="left">Low (and therefore legendary).</td>
</tr>
<tr>
<td align="left"><strong>Screen Time</strong></td>
<td align="left">80% (mostly pining/complaining).</td>
<td align="left">5% (pure, uncut comedy gold).</td>
</tr>
<tr>
<td align="left"><strong>The "Hook"</strong></td>
<td align="left">Moral compass.</td>
<td align="left">Complete lack of a compass.</td>
</tr>
</tbody></table>
<h2>Exhibit A: The "Straight Man" Trap</h2>
<p>The mystery begins with the <strong>Straight Man Trap</strong>. To have a sitcom, you need a "grounded" center. Think <strong>Ted Mosby</strong>, <strong>Ross Geller</strong>, or <strong>Leonard Hofstadter</strong>. These men aren't characters; they are <em>narrative infrastructure</em>. They exist to ask "Why are you doing that?" so the side character can do something funny.</p>
<p>But here is the crime: over time, the infrastructure starts to crumble. We get tired of Ted’s search for "The One." We get exhausted by Ross’s divorces.</p>
<h3>The Gravity of Interest</h3>
<pre><code class="language-mermaid">pie title Who are you actually laughing at?
"Main Character's Romantic Problems" : 10
"Side Character's Unhinged One-Liner" : 60
"The Background Extra doing something weird" : 15
"The Theme Song" : 15
</code></pre>
<h2>Exhibit B: The Suspects (The Real MVPs)</h2>
<p>I’ve rounded up the usual suspects. If these people weren't in their respective shows, the "Main Characters" would be standing in a silent room staring at a wall.</p>
<ol>
<li><strong>Creed Bratton (The Office):</strong> Michael Scott is the "lead," but Creed lives in a different dimension. He has four lines an episode, and three of them imply he’s committed international war crimes. He doesn't need an "arc." He needs a fake ID.</li>
<li><strong>Jean-Ralphio & Mona-Lisa Saperstein (Parks & Rec):</strong> Leslie Knope is the engine, but the Sapersteins are the nitro. They are human garbage, and every time they enter a frame, the show’s IQ drops by 40 points while the entertainment value triples.</li>
<li><strong>Gunther (Friends):</strong> While Ross and Rachel were busy "being on a break" for the 900th time, Gunther was silently pining in the background, serving coffee and harboring a dark, beautiful hatred for everyone in the room.</li>
<li><strong>The Waitress (It's Always Sunny):</strong> In a show about five leads, the side characters like Rickety Cricket and The Waitress provide the only metric of how truly demonic the leads are. They are the "mirrors" of the crime.</li>
</ol>
<h2>The Mystery Solved: Why the "Side" is "Better"</h2>
<p>After years of investigation, I’ve found the smoking gun. It’s called <strong><a href="/vocab/trope-purity">Trope Purity</a></strong>.</p>
<p>A main character has to be "human." They have to suffer, they have to learn lessons (bleh), and they have to be someone the audience wants to see succeed. This <strong>"Success Requirement"</strong> is the death of comedy.</p>
<p>A side character has no such burden. They can be a total monster. They can be a one-dimensional caricature of a specific human flaw. Because they only appear for 30 seconds at a time, they never overstay their welcome. They are the <strong>"Joker Cards"</strong> of the writers' room.</p>
<h2>The Verdict</h2>
<p>We don't watch sitcoms for the "journey" of the lead. We watch them for the moments when the weird guy from the apartment downstairs knocks on the door and says something so nonsensical it breaks the reality of the show.</p>
<p><strong>The Main Character is the steak; necessary, but heavy. The Side Character is the <a href="/vocab/msg">MSG</a>. And let’s be honest—we’re all just here for the <a href="/vocab/msg">MSG</a>.</strong></p>
<p>Case closed.</p>
<p><a href="https://fezcode.com/blog/side-character-conspiracy-sitcom-rant">Read more...</a></p>]]></content:encoded>
</item>
<item>
<title><![CDATA[Wave Function Collapse: Taming Entropy in Procedural Generation]]></title>
<description><![CDATA[[object Object]]]></description>
<link>https://fezcode.com/blog/wave-function-collapse-explained</link>
<guid isPermaLink="false">https://fezcode.com/blog/wave-function-collapse-explained</guid>
<dc:creator><![CDATA[Ahmed Samil Bulbul]]></dc:creator>
<pubDate>Sat, 07 Mar 2026 00:00:00 GMT</pubDate>
<content:encoded><![CDATA[<p>Wave Function Collapse (WFC) is one of those algorithms that feels like magic when you first see it in action. Originally popularized by Maxim Gumin, it’s a powerful tool for procedural generation that can create complex, non-repeating patterns from a small set of example tiles and adjacency rules.</p>
<p>Despite the name—which is borrowed from quantum mechanics—the algorithm itself is purely combinatorial and constraint-based.</p>
<h2>The Core Intuition</h2>
<p>Imagine you are trying to fill a grid with tiles. Each tile has specific rules about what can be next to it (e.g., a "Coast" tile can be next to "Sea" or "Land", but "Sea" cannot be directly next to "Land").</p>
<p>WFC approaches this by maintaining a state of <strong>superposition</strong> for every cell in your grid. Initially, every cell could be <em>any</em> of the available tiles. As we make decisions, we "collapse" these possibilities until only one remains for each cell.</p>
<h3>Key Terms</h3>
<ol>
<li><strong>Superposition</strong>: A state where a cell has multiple possible tiles it could be.</li>
<li><strong>Entropy</strong>: A measure of uncertainty. In WFC, cells with fewer possible tiles have lower entropy.</li>
<li><strong>Collapse</strong>: The act of picking a single tile for a cell from its list of possibilities.</li>
<li><strong>Propagation</strong>: The process of updating the possibilities of neighboring cells based on a newly collapsed cell.</li>
</ol>
<h2>The Algorithm Loop</h2>
<p>The WFC algorithm follows a simple but effective loop:</p>
<pre><code class="language-mermaid">graph TD
A[Start] --> B[Initialize Grid: All tiles possible everywhere]
B --> C{Any uncollapsed cells?}
C -- Yes --> D[Select cell with Lowest Entropy]
D --> E[Collapse cell: Pick 1 possible tile]
E --> F[Propagate Constraints to Neighbors]
F --> G{Contradiction?}
G -- No --> C
G -- Yes --> H[Backtrack or Restart]
C -- No --> I[Finished!]
</code></pre>
<ol>
<li><strong>Observation</strong>: Find the cell with the lowest non-zero entropy (the one with the fewest possible tiles left). If there's a tie, pick one randomly.</li>
<li><strong>Collapse</strong>: Pick one of the remaining possible tiles for that cell (often weighted by frequency).</li>
<li><strong>Propagation</strong>: Since that cell is now fixed, its neighbors might have fewer valid options. Update them. If their options change, update <em>their</em> neighbors, and so on.</li>
</ol>
<hr>
<h2>Visualizing Propagation</h2>
<p>Imagine a 3-tile system: <strong>Land (L)</strong>, <strong>Coast (C)</strong>, and <strong>Sea (S)</strong>.</p>
<p>Rules:</p>
<ul>
<li><strong>L</strong> can touch <strong>L</strong> or <strong>C</strong>.</li>
<li><strong>C</strong> can touch <strong>L</strong>, <strong>C</strong>, or <strong>S</strong>.</li>
<li><strong>S</strong> can touch <strong>C</strong> or <strong>S</strong>.</li>
</ul>
<p>If we collapse a cell to <strong>Sea (S)</strong>:</p>
<ol>
<li>Look at its neighbors.</li>
<li>The neighbors originally could be {L, C, S}.</li>
<li>Because they are next to <strong>S</strong>, and <strong>L</strong> cannot touch <strong>S</strong>, we remove <strong>L</strong> from their possibilities.</li>
<li>The neighbors are now {C, S}. Their entropy has decreased.</li>
</ol>
<hr>
<h2>Implementation: JavaScript</h2>
<p>Here is a simplified 1D implementation to demonstrate the logic. In a 1D world, "neighbors" are just left and right.</p>
<pre><code class="language-javascript">const TILES = ['LAND', 'COAST', 'SEA'];
const RULES = {
LAND: ['LAND', 'COAST'],
COAST: ['LAND', 'COAST', 'SEA'],
SEA: ['COAST', 'SEA'],
};
function wfc1D(size) {
// Initialize grid with all possibilities
let grid = Array(size).fill(null).map(() => [...TILES]);
while (grid.some(cell => cell.length > 1)) {
// 1. Find cell with lowest entropy (minimal length > 1)
let minEntropy = Infinity;
let candidates = [];
grid.forEach((cell, i) => {
if (cell.length > 1 && cell.length < minEntropy) {
minEntropy = cell.length;
candidates = [i];
} else if (cell.length === minEntropy) {
candidates.push(i);
}
});
if (candidates.length === 0) break;
// 2. Collapse
const index = candidates[Math.floor(Math.random() * candidates.length)];
const pick = grid[index][Math.floor(Math.random() * grid[index].length)];
grid[index] = [pick];
// 3. Propagate (Simplified 1D propagation)
for (let i = 0; i < size; i++) {
if (i > 0) {
// Update current based on left neighbor
grid[i] = grid[i].filter(t =>
grid[i-1].some(prevT => RULES[prevT].includes(t))
);
}
if (i < size - 1) {
// Update current based on right neighbor (requires a second pass usually)
// For simplicity, we just loop a few times or use a stack
}
}
}
return grid.map(c => c[0]);
}
console.log(wfc1D(10).join(' -> '));
</code></pre>
<hr>
<h2>Implementation: Golang</h2>
<p>In Go, we can take a more structured approach, which is better for performance and 2D grids.</p>
<pre><code class="language-go">package main
import (
"fmt"
"math/rand"
"time"
)
type Tile string
const (
Land Tile = "L"
Coast Tile = "C"
Sea Tile = "S"
)
var Rules = map[Tile][]Tile{
Land: {Land, Coast},
Coast: {Land, Coast, Sea},
Sea: {Coast, Sea},
}
type Cell struct {
Possible []Tile
Collapsed bool
}
func main() {
rand.Seed(time.Now().UnixNano())
size := 10
grid := make([]Cell, size)
// Initialize
for i := range grid {
grid[i] = Cell{Possible: []Tile{Land, Coast, Sea}}
}
for {
// Find lowest entropy
minIdx := -1
minEntropy := 100
for i, cell := range grid {
if !cell.Collapsed && len(cell.Possible) < minEntropy {
minEntropy = len(cell.Possible)
minIdx = i
}
}
if minIdx == -1 {
break // All collapsed
}
// Collapse
c := &grid[minIdx]
c.Collapsed = true
pick := c.Possible[rand.Intn(len(c.Possible))]
c.Possible = []Tile{pick}
// Propagate (1D Simple)
propagate(grid)
}
for _, c := range grid {
fmt.Printf("%s ", c.Possible[0])
}
fmt.Println()
}
func propagate(grid []Cell) {
for i := 0; i < len(grid); i++ {
if i > 0 {
grid[i].Possible = filter(grid[i].Possible, grid[i-1].Possible)
}
if i < len(grid)-1 {
// In a real WFC, this would be a stack-based propagation
// that ripples through the whole grid.
}
}
}
func filter(current []Tile, neighborPossibilities []Tile) []Tile {
var next []Tile
for _, t := range current {
valid := false
for _, nt := range neighborPossibilities {
for _, allowed := range Rules[nt] {
if t == allowed {
valid = true
break
}
}
}
if valid {
next = append(next, t)
}
}
return next
}
</code></pre>
<h2>Challenges: The Contradiction</h2>
<p>The hardest part of WFC is the <strong>Contradiction</strong>. This happens when propagation removes <em>all</em> possibilities from a cell. If a cell has 0 possible tiles, the algorithm has failed.</p>
<p>There are two main ways to handle this:</p>
<ol>
<li><strong>Restart</strong>: Throw away the progress and start from scratch (easy but slow).</li>
<li><strong>Backtracking</strong>: Undo the last few collapses and try different choices (complex but robust).</li>
</ol>
<h2>Conclusion</h2>
<p>Wave Function Collapse is a beautiful marriage of logic and creativity. While the implementation can get tricky with 2D/3D grids and complex rotation/symmetry rules, the core principle remains: <strong>listen to your neighbors and reduce your options until the world reveals itself.</strong></p>
<p>Try implementing it for a 2D dungeon generator—you might be surprised how "designed" your random levels start to look!</p>
<p><a href="https://fezcode.com/blog/wave-function-collapse-explained">Read more...</a></p>]]></content:encoded>
</item>
<item>
<title><![CDATA[The Deep End: Distributed Systems, Consensus, and State]]></title>
<description><![CDATA[[object Object]]]></description>
<link>https://fezcode.com/blog/distributed-systems-consensus-and-state</link>
<guid isPermaLink="false">https://fezcode.com/blog/distributed-systems-consensus-and-state</guid>
<dc:creator><![CDATA[Ahmed Samil Bulbul]]></dc:creator>
<pubDate>Tue, 03 Mar 2026 00:00:00 GMT</pubDate>
<content:encoded><![CDATA[<p>When you write a single-threaded program running on a single machine, life is easy. You write a variable to memory, and the next line reads it back. It's there. It's correct. </p>
<p>When you move to a distributed system, you are essentially trying to make a fleet of independent, unreliable machines scattered across the globe pretend they are just one big, reliable computer. This is a brilliant illusion, and maintaining it requires overcoming the fundamental laws of physics.</p>
<p>Let's turn over every rock in the landscape of Distributed Systems, Consensus, and State.</p>
<hr>
<h2>1. Time: The Ultimate Enemy</h2>
<p>In a single machine, we have a CPU clock. In a distributed system, every machine has its own quartz crystal. These crystals vibrate at slightly different frequencies, meaning clocks <em>drift</em>. </p>
<p>If Server A says an event happened at <code>10:00:00.001</code> and Server B says an event happened at <code>10:00:00.002</code>, we <strong>cannot</strong> guarantee Server A's event actually happened first. Network Time Protocol (NTP) helps, but it only synchronizes to within a few milliseconds. In a computer context, a millisecond is an eternity.</p>
<h3>Logical Clocks</h3>
<p>Since we can't trust wall-clock time, we use <em>logical time</em>. We only care about causal ordering: did event X cause event Y?</p>
<p><strong>Lamport Timestamps</strong>
Proposed by Leslie Lamport in 1978. Every node keeps a simple integer counter.</p>
<pre><code class="language-go">type LamportClock struct {
time int32
mu sync.Mutex
}
func (l *LamportClock) Tick() int32 {
l.mu.Lock()
defer l.mu.Unlock()
l.time++
return l.time
}
func (l *LamportClock) SendEvent() int32 {
return l.Tick()
}
// When receiving a message, update your clock to be strictly
// greater than the sender's clock.
func (l *LamportClock) ReceiveEvent(receivedTime int32) int32 {
l.mu.Lock()
defer l.mu.Unlock()
if receivedTime > l.time {
l.time = receivedTime
}
l.time++
return l.time
}
</code></pre>
<p><em>Rule:</em> If A -> B (A causes B), then L(A) < L(B). However, the reverse is not true. If L(A) < L(B), we don't know if A caused B or if they are just concurrent events that happened to occur in that order.</p>
<p><strong>Vector Clocks</strong>
To solve the concurrency ambiguity of Lamport clocks, we use Vector Clocks. Instead of a single integer, a vector clock is an array of integers, one for each node in the system.</p>
<pre><code class="language-go">type VectorClock struct {
nodeID int
vector []int32
mu sync.Mutex
}
func NewVectorClock(nodeID, totalNodes int) *VectorClock {
return &VectorClock{
nodeID: nodeID,
vector: make([]int32, totalNodes),
}
}
func (v *VectorClock) Tick() {
v.mu.Lock()
defer v.mu.Unlock()
v.vector[v.nodeID]++
}
func (v *VectorClock) SendEvent() []int32 {
v.Tick()
v.mu.Lock()
defer v.mu.Unlock()
copyVec := make([]int32, len(v.vector))
copy(copyVec, v.vector)
return copyVec
}
func (v *VectorClock) ReceiveEvent(receivedVector []int32) {
v.mu.Lock()
defer v.mu.Unlock()
for i := 0; i < len(v.vector); i++ {
if receivedVector[i] > v.vector[i] {
v.vector[i] = receivedVector[i]
}
}
v.vector[v.nodeID]++
}
</code></pre>
<p>If Vector A is strictly less than Vector B (every element in A is <code><=</code> the corresponding element in B, and at least one is strictly <code><</code>), then A casually precedes B. If neither is strictly less, they are <strong>concurrent</strong>! Systems like Amazon DynamoDB and Cassandra use variations of this to detect and resolve write conflicts.</p>
<hr>
<h2>2. The Unsolvable Problems</h2>
<h3>The Two Generals Problem</h3>
<p>Imagine two generals on two hills, trying to coordinate an attack on a valley below. They can only communicate by sending messengers through the valley, where they might be captured.</p>
<ul>
<li>General A sends: "Attack at dawn."</li>
<li>General B receives it, but A doesn't know if B got it. So B sends an ACK: "I will attack at dawn."</li>
<li>B doesn't know if A received the ACK. If A didn't, A might abort the attack, leaving B to fight alone. So A sends an ACK to the ACK.</li>
<li>This creates an infinite loop of uncertainty.</li>
</ul>
<p><em>Theorem:</em> In a network with unreliable communication (messages can be dropped), <strong>it is impossible to guarantee consensus.</strong> We build systems that are "good enough" probabilistically, using timeouts and retries, but absolute mathematical certainty is impossible over a faulty network.</p>
<h3>The Byzantine Generals Problem</h3>
<p>What if the messengers get through, but some of the generals are traitors? A traitor might tell General A "attack" and General B "retreat". </p>
<p>Systems that can survive nodes actively lying or sending corrupted data are <strong>Byzantine Fault Tolerant (BFT)</strong>. Bitcoin and blockchain networks are BFT systems (using Proof of Work to make lying computationally expensive). Most enterprise databases (like Zookeeper, etcd, or Postgres) are <strong>Crash Fault Tolerant (CFT)</strong> — they assume nodes might die or packets might drop, but nodes don't maliciously lie.</p>
<hr>
<h2>3. The CAP Theorem & PACELC</h2>
<p><strong>CAP Theorem:</strong> In a distributed data store, you can only guarantee two of the following three:</p>
<ul>
<li><strong>C</strong>onsistency: Every read receives the most recent write or an error.</li>
<li><strong>A</strong>vailability: Every request receives a (non-error) response, without the guarantee that it contains the most recent write.</li>
<li><strong>P</strong>artition Tolerance: The system continues to operate despite an arbitrary number of messages being dropped by the network.</li>
</ul>
<p><em>Reality Check:</em> You cannot sacrifice Partition Tolerance. Network partitions <em>will</em> happen. Someone will trip over a router cable. Therefore, you must choose between C (CP systems) and A (AP systems) when a failure occurs.</p>
<ul>
<li><strong>CP System (e.g., Zookeeper, MongoDB with strong consistency):</strong> If a network link breaks, the system stops accepting writes to prevent data divergence.</li>
<li><strong>AP System (e.g., Cassandra, DynamoDB):</strong> If a link breaks, both sides keep accepting writes. You get high availability, but the data will diverge (requiring Eventual Consistency and conflict resolution later).</li>
</ul>
<p><strong>PACELC Theorem:</strong> An extension of CAP. It states: If there is a Partition (P), how does the system trade off Availability and Consistency (A and C); <strong>Else (E)</strong>, when the system is running normally, how does the system trade off <strong>Latency (L)</strong> and <strong>Consistency (C)</strong>?</p>
<hr>
<h2>4. Consensus Algorithms: How Machines Agree</h2>
<p>How do multiple nodes agree on a single value (or a sequence of values, i.e., a replicated log)?</p>
<h3>Paxos: The Grandfather</h3>
<p>Created by Leslie Lamport, Paxos is mathematically beautiful but notoriously difficult to understand and implement correctly.</p>
<p>Phases:</p>
<ol>
<li><strong>Prepare/Promise:</strong> A Proposer generates an ID (N) and sends <code>Prepare(N)</code> to a quorum (majority) of Acceptors. If N is higher than any ID the Acceptor has ever seen, it promises to not accept proposals <code>< N</code> and returns its highest previously accepted value.</li>
<li><strong>Accept/Accepted:</strong> The Proposer looks at the Promises. If an Acceptor returned a value, the Proposer MUST propose that value. Otherwise, it can propose its own. It sends <code>Accept(N, Value)</code> to the quorum. If the Acceptor hasn't promised to a higher N in the meantime, it accepts it.</li>
</ol>
<p><em>Pseudocode for a Paxos Acceptor in Go:</em></p>
<pre><code class="language-go">type Promise struct {
Status string
AcceptedProposal int
AcceptedValue any
}
type Acceptor struct {
minProposal int
acceptedProposal int
acceptedValue any
mu sync.Mutex
}
func (a *Acceptor) ReceivePrepare(n int) Promise {
a.mu.Lock()
defer a.mu.Unlock()
if n > a.minProposal {
a.minProposal = n
return Promise{
Status: "PROMISE",
AcceptedProposal: a.acceptedProposal,
AcceptedValue: a.acceptedValue,
}
}
return Promise{Status: "REJECT"}
}
func (a *Acceptor) ReceiveAccept(n int, value any) string {
a.mu.Lock()
defer a.mu.Unlock()
if n >= a.minProposal {
a.minProposal = n
a.acceptedProposal = n
a.acceptedValue = value
return "ACCEPTED"
}
return "REJECT"
}
</code></pre>
<h3>Raft: Consensus for Humans</h3>
<p>Created by Diego Ongaro and John Ousterhout specifically to be understandable. It powers systems like <code>etcd</code> (the brain behind Kubernetes) and Consul. It divides consensus into three subproblems: Leader Election, Log Replication, and Safety.</p>
<p><strong>1. Leader Election</strong>
Nodes are Followers, Candidates, or Leaders. Time is divided into <em>Terms</em>.
If a Follower hears nothing (no heartbeat) for a randomized timeout (e.g., 150-300ms), it becomes a Candidate, increments the Term, votes for itself, and requests votes from others.
If it gets a majority, it becomes the Leader.
<em>Randomized timeouts are crucial</em> to prevent split votes where multiple nodes become candidates simultaneously forever.</p>
<p><strong>2. Log Replication</strong>
The Leader accepts client requests. It appends the command to its log.
It sends <code>AppendEntries</code> RPCs to all followers.
Once a majority of followers acknowledge the write, the Leader <em>commits</em> the entry and applies it to its state machine, then tells followers to apply it.</p>
<p><em>Pseudocode for Raft Leader Log Replication in Go:</em></p>
<pre><code class="language-go">func (l *RaftLeader) HandleClientRequest(command any) string {
entry := LogEntry{Term: l.currentTerm, Command: command}
l.mu.Lock()
l.log = append(l.log, entry)
l.mu.Unlock()
var wg sync.WaitGroup
var mu sync.Mutex
acks := 1 // Self acknowledges automatically
for _, follower := range l.followers {
wg.Add(1)
go func(f *Node) {
defer wg.Done()
// Real implementation uses timeouts and handles RPC errors
success := l.sendAppendEntries(f, entry)
if success {
mu.Lock()
acks++
mu.Unlock()
}
}(follower)
}
wg.Wait() // Wait for responses
// Wait for Quorum (N/2 + 1)
if acks > (len(l.followers)+1)/2 {
l.mu.Lock()
l.commitIndex = len(l.log) - 1
l.applyToStateMachine(entry.Command)
l.mu.Unlock()
return "SUCCESS"
}
return "FAIL_NO_QUORUM"
}
</code></pre>
<p><strong>Safety (Log Matching Property)</strong>
If two logs contain an entry with the same index and term, then the logs are identical in all entries up through the given index. The Leader forces followers' logs to match its own exactly.</p>
<hr>
<h2>5. Split Brain & Fencing Tokens</h2>
<p>What happens if the network partitions, and the old Leader is separated from the majority? The majority elects a New Leader. But the Old Leader doesn't know this! It still thinks it's the leader (Split Brain).</p>
<p>If a client talks to the Old Leader, it will try to write data. However, in Raft, the Old Leader cannot get a majority of ACKs (because it's physically isolated), so the write fails. The core system is safe!</p>
<p>But what if the Old Leader is interacting with an <strong>external</strong> system (like an S3 storage bucket or an email API) that doesn't understand Raft consensus?</p>
<ol>
<li>Old Leader pauses due to a long Garbage Collection spike.</li>
<li>Majority detects timeout and elects New Leader.</li>
<li>New Leader writes to the Storage Bucket.</li>
<li>Old Leader wakes up, still thinks it's leader, and writes to Storage Bucket, overwriting the New Leader's data!</li>
</ol>
<p><strong>Solution: Fencing Tokens</strong>
Every time a Leader is elected, it gets a monotonically increasing token (e.g., its Raft Term number).
It passes this token to the Storage Service with <em>every single write</em>.
The Storage Service remembers the highest token it has ever seen.
If the Old Leader (Token 5) tries to write, but the Storage Service has already seen the New Leader (Token 6), the Storage Service rejects the Old Leader's write. </p>
<hr>
<h2>6. Distributed Transactions: 2PC vs Sagas</h2>
<p>What if you need to update a Postgres Database and publish a Kafka message transactionally? </p>
<p><strong>Two-Phase Commit (2PC)</strong>
A coordinator asks all databases: "Can you commit?" (Prepare phase).
If ALL say "Yes", the coordinator says "Commit!" (Commit phase).
<em>The Problem:</em> It's heavily blocking. If a database locks a row during the Prepare phase and the coordinator crashes before sending the Commit command, the row is locked forever. It scales terribly in microservice architectures.</p>
<p><strong>The Saga Pattern</strong>
Used in modern, highly scalable microservices. A long-running transaction is broken into localized, independent transactions.
If step 1 (Deduct Funds) succeeds, we trigger step 2 (Ship Item).
If step 2 fails, we DO NOT rollback the database transaction (it already committed locally). Instead, we issue a <strong>Compensating Transaction</strong> (Refund Funds).
It embraces <em>Eventual Consistency</em>.</p>
<p><em>Pseudocode for a Choreography-based Saga in Go:</em></p>
<pre><code class="language-go">// In the Inventory Service
func HandleOrderPlacedEvent(event OrderEvent) {
err := inventoryService.ReserveItems(event.Items)
if err != nil {
// The compensating action trigger
publishEvent(OrderFailedEvent{
OrderID: event.OrderID,
Reason: "No Stock",
})
return
}
publishEvent(InventoryReservedEvent{OrderID: event.OrderID})
}
// In the Payment Service
func HandleOrderFailedEvent(event OrderFailedEvent) {
// This explicitly undoes the successful payment step
paymentService.RefundCustomer(event.OrderID)
}
</code></pre>
<hr>
<h2>7. The Golden Rule: Idempotency</h2>
<p>Because networks drop packets, a client might send a POST request to "Charge $50". The server receives it, charges $50, but the response back to the client is dropped by a faulty router. The client, thinking it failed, retries. Does the user get charged $100?</p>
<p>To prevent this, every destructive operation in a distributed system must use an <strong>Idempotency Key</strong>.</p>
<pre><code class="language-go">func ChargeCard(ctx context.Context, userID string, amount float64, idempotencyKey string) (*Result, error) {
// Check if we already successfully processed this exact request
var previousResult Result
err := db.QueryRowContext(ctx, "SELECT result FROM idempotency_table WHERE key = $1", idempotencyKey).Scan(&previousResult)
if err == nil {
return &previousResult, nil // Return cached result, do NOT charge again
}
// Begin database transaction
tx, err := db.BeginTx(ctx, nil)
if err != nil {
return nil, err
}
defer tx.Rollback() // Safe to defer, no-op if committed
result, err := stripeAPI.Charge(userID, amount)
if err != nil {
// If external call failed, don't save the key, so the client can safely retry
return nil, err
}
_, err = tx.ExecContext(ctx, "INSERT INTO idempotency_table (key, result) VALUES ($1, $2)", idempotencyKey, result)
if err != nil {
// Might happen if two identical requests slipped past the SELECT at the exact same time
// (A unique constraint on idempotency_table.key handles this safety net)
return nil, err
}
tx.Commit()
return &result, nil
}
</code></pre>
<h2>Conclusion</h2>
<p>Building distributed systems is the art of strategic paranoia. You must assume every network packet will be dropped, every server will randomly restart, every clock is fundamentally wrong, and every dependent service will go down at the worst possible time. </p>
<p>By utilizing logical clocks, consensus algorithms like Raft, Quorums, Fencing Tokens, the Saga pattern, and Idempotent APIs, we can tame the inherent chaos of the network and build systems that appear flawless, coherent, and singular to the end user. </p>
<p>Welcome to the deep end.</p>
<p><a href="https://fezcode.com/blog/distributed-systems-consensus-and-state">Read more...</a></p>]]></content:encoded>
</item>
<item>
<title><![CDATA[MBTI & Astrology: The Modern Quest for Identity]]></title>
<description><![CDATA[[object Object]]]></description>
<link>https://fezcode.com/blog/mbti-and-astrology-modern-identity</link>
<guid isPermaLink="false">https://fezcode.com/blog/mbti-and-astrology-modern-identity</guid>
<dc:creator><![CDATA[Ahmed Samil Bulbul]]></dc:creator>
<pubDate>Mon, 02 Mar 2026 00:00:00 GMT</pubDate>
<content:encoded><![CDATA[<p>Humans are wonderfully, hopelessly complex. We are walking paradoxes, changing our minds, our moods, and our habits from one day to the next. So, it's really no surprise that we are constantly searching for a map to navigate our own minds. </p>
<p>Historically, we looked up. For millennia, <strong>Astrology</strong> has offered a poetic framework for understanding ourselves. The idea that the cosmic dance of planets and stars at the exact moment of our birth could imprint upon our personality is undeniably romantic. Even if we don't actually believe that a retrograde Mercury is the reason our code won't compile or why we spilled our coffee, the archetypes of the Zodiac provide a shared vocabulary. It gives us a way to say, <em>"I'm feeling a bit fiery and impulsive today,"</em> by simply saying, <em>"Well, I'm an Aries."</em></p>
<p>But as society modernized and moved into office buildings, we needed a new system. A system that looked a bit more scientific, a bit more structured, and preferably one that came with a multiple-choice questionnaire. </p>
<p>Enter the <strong>Myers-Briggs Type Indicator (MBTI)</strong>. </p>
<h3>The Corporate Zodiac</h3>
<p>If you've spent any time on the internet or in a corporate team-building seminar, you've encountered the four-letter acronyms: INTJ, ESTP, ENFP, and so on. Based on the fascinating (though largely unempirical) theories of Carl Jung, the MBTI categorizes humanity into 16 distinct personality types. </p>
<p>It is, in many ways, modern astrology. </p>
<p>Instead of asking for your birth time, it asks if you prefer parties or quiet evenings. And just like astrology, it assigns you to a neat little box with a flattering description. </p>
<p>Which brings us to an interesting observation about both systems: <strong>they are universally complimentary.</strong></p>
<h3>The "No A**hole" Rule</h3>
<p>Have you ever noticed that nobody ever takes a personality test and gets the result: <em>"You are fundamentally a bit of a jerk, and you don't listen to people"</em>? </p>
<p>Both Astrology and MBTI rely heavily on something called the <strong><a href="/vocab/barnum-effect">Barnum Effect</a></strong> (or Forer Effect)—the psychological phenomenon where individuals believe that generic personality descriptions apply specifically to them. These systems are designed to highlight our strengths and reframe our weaknesses as quirky, endearing traits. </p>
<p>It is incredibly common to hear someone say, <em>"Oh my god, I am so an INTP, I just get lost in my own thoughts!"</em> or <em>"I can't help being stubborn, I'm a Scorpio!"</em> They provide us with a comfortable, pre-packaged identity that validates how we already want to see ourselves. It gives us permission to be who we are, with all the rough edges smoothed out by a nice-sounding label.</p>
<h3>A Kind Conclusion</h3>
<p>Now, this isn't to say these systems are bad. Far from it! While we might not believe that the stars dictate our destiny, or that 16 boxes can accurately capture the entire spectrum of human consciousness, they serve a beautiful purpose. </p>
<p>They are tools for introspection. They prompt us to think about how we interact with the world, what energizes us, and what drains us. They help us empathize with others by reminding us that not everyone thinks the way we do. </p>
<p>So, whether you are a Libra, an ENFJ, or just a human trying to figure it out, it's all okay. We shouldn't take the labels too seriously, but if they help us understand ourselves and be a little kinder to one another, then there's no harm in finding a bit of magic in the stars—or in a questionnaire.</p>
<p><a href="https://fezcode.com/blog/mbti-and-astrology-modern-identity">Read more...</a></p>]]></content:encoded>
</item>
<item>
<title><![CDATA[The Encyclopedia of Bad Arguments: A Guide to Logical Fallacies]]></title>
<description><![CDATA[[object Object]]]></description>
<link>https://fezcode.com/blog/encyclopedia-of-bad-arguments</link>
<guid isPermaLink="false">https://fezcode.com/blog/encyclopedia-of-bad-arguments</guid>
<dc:creator><![CDATA[Ahmed Samil Bulbul]]></dc:creator>
<pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate>
<content:encoded><![CDATA[<h1>The Encyclopedia of Bad Arguments: A Guide to Logical Fallacies</h1>
<p>If you read my previous colossal rant on logic, you know that the foundation of a good argument requires sound premises and valid structure. But what happens when things go wrong? Welcome to the dark side of reasoning.</p>
<p>*(Want to put this knowledge to the test while surviving the internet? Play <strong><a href="/apps/logical-fallacy-bingo">Logical Fallacies Bingo</a></strong>!)*</p>
<p>Today, we are taking a comprehensive tour through the Hall of Shame: <strong><a href="/vocab/logical-fallacy">Logical Fallacies</a></strong>.</p>
<p>A logical fallacy is, quite simply, a flaw in reasoning. It's a trick of logic—an illusion of thought—that makes a bad argument look good, or a good argument look bad. Sometimes they are used accidentally by people who don't know any better. Often, they are used intentionally by politicians, marketers, and internet trolls to manipulate you.</p>
<p>To defend your mind, you must know your enemy. Let's break them down.</p>
<hr>
<h2>Part I: Formal vs. Informal Fallacies</h2>
<p>Before we get to the fun stuff, we need to understand the two main categories of fallacies.</p>
<h3>1. Formal Fallacies (The Math is Wrong)</h3>
<p>A formal fallacy means the actual structure of the argument is broken. It doesn't matter what you are arguing <em>about</em>; the logic itself is fundamentally flawed. These usually occur in <a href="/vocab/deductive-reasoning">Deductive Reasoning</a>.</p>
<p><strong>Example: Affirming the Consequent</strong></p>
<ul>
<li><strong>Premise 1:</strong> If it is raining, the streets are wet. (If A, then B)</li>
<li><strong>Premise 2:</strong> The streets are wet. (B is true)</li>
<li><strong>Conclusion:</strong> Therefore, it is raining. (Therefore, A is true)</li>
</ul>
<p><em>Why it's broken:</em> The streets could be wet because a fire hydrant exploded, or someone is washing their car. The structure assumes the effect <em>only</em> has one cause.</p>
<h3>2. Informal Fallacies (The Content is Garbage)</h3>
<p>Informal fallacies might actually have a valid structure, but the content of the premises is flawed, irrelevant, or deceptive. This is what you see 99% of the time in daily life.</p>
<p>Let's dive into the most common offenders.</p>
<hr>
<h2>Part II: The Heavy Hitters (Informal Fallacies)</h2>
<h3>1. The Ad Hominem (Attacking the Person)</h3>
<p>Translates to "to the man." Instead of engaging with the argument, you attack the character, motive, or other attribute of the person making the argument.</p>
<ul>
<li><strong>The Setup:</strong> "We need to reform the tax code to help the middle class."</li>
<li><strong>The Fallacy:</strong> "Why should we listen to you? You're a wealthy elite who has never worked a blue-collar job in your life!"</li>
<li><strong>Why it's wrong:</strong> The person's wealth has zero bearing on the mathematical or economic validity of the tax proposal.</li>
</ul>
<p><strong>Sub-variant: Tu Quoque ("You Too")</strong>
Answering criticism with criticism instead of addressing the point.</p>
<ul>
<li>"You shouldn't eat so much fast food, it's bad for your heart." -> "Well, you smoke a pack a day, so shut up!"</li>
</ul>
<h3>2. The Straw Man vs. The Steel Man</h3>
<p><strong>The Straw Man</strong> occurs when someone takes an opponent's argument, drastically exaggerates or misrepresents it, and then attacks that fake, weakened version (the "straw man").</p>
<ul>
<li><strong>Person A:</strong> "I think we should put more money into public schools."</li>
<li><strong>Person B:</strong> "Oh, so you want to defund the military and leave our country completely defenseless? That's treasonous!"</li>
</ul>
<p><strong>The Antidote: The Steel Man</strong>
The opposite of a Straw Man is a "Steel Man." To steel man an argument means to reconstruct your opponent's argument in the strongest, most charitable way possible before you try to defeat it. If you can defeat the <em>strongest</em> version of their argument, you've actually won.</p>
<ul>
<li><strong>Person A:</strong> "I think we need to raise taxes on large corporations."</li>
<li><strong>Person B (Steel Manning):</strong> "It sounds like your primary concern is wealth inequality and ensuring that highly profitable companies contribute their fair share to public infrastructure and services. Is that an accurate summary? Assuming that's true, here is why I think raising the corporate tax rate might actually harm the middle class..."</li>
</ul>
<h3>3. The Slippery Slope</h3>
<p>Assuming that a relatively small, often harmless first step will inevitably lead to a chain reaction of catastrophic events.</p>
<ul>
<li><strong>The Fallacy:</strong> "If we let students choose their own reading material, next they'll be ignoring the curriculum entirely, then they'll drop out of school, turn to a life of crime, and society will collapse!"</li>
<li><strong>Why it's wrong:</strong> It assumes extreme causality without evidence. A does not automatically equal Z.</li>
</ul>
<h3>4. The False Dilemma (Black-and-White Thinking)</h3>
<p>Presenting only two extreme options as the <em>only</em> possibilities, when in reality, a spectrum of options exists.</p>
<ul>
<li><strong>The Fallacy:</strong> "You are either completely with us, or you are a traitor to the cause."</li>
<li><strong>Why it's wrong:</strong> It artificially limits the debate. You can agree with a cause but disagree with the methods, or remain neutral.</li>
</ul>
<h3>5. No True Scotsman (Appeal to Purity)</h3>
<p>This happens when someone makes a universal claim ("All X do Y"), gets presented with a counter-example, and instead of admitting they were wrong, they shift the definition of the group to exclude the counter-example.</p>
<ul>
<li><strong>Alice:</strong> "No Scotsman puts sugar on his porridge."</li>
<li><strong>Bob:</strong> "But my uncle Angus is Scottish, and he loves sugar on his porridge."</li>
<li><strong>Alice:</strong> "Ah, yes, but no <em>true</em> Scotsman puts sugar on his porridge."</li>
<li><strong>Why it's wrong:</strong> It's an <strong><a href="/vocab/ad-hoc">ad-hoc</a></strong> rescue of a flawed argument. You change the rules mid-game to avoid being wrong.</li>
</ul>
<hr>
<h2>Part III: The Causation Conundrum</h2>
<p>Human brains are pattern-recognition machines. We love finding connections, even when they don't exist. This leads to massive errors in <a href="/vocab/inductive-reasoning">Inductive Reasoning</a>.</p>
<h3>1. Post Hoc Ergo Propter Hoc (After this, therefore because of this)</h3>
<p>Assuming that because Event B happened <em>after</em> Event A, Event A must have <em>caused</em> Event B.</p>
<ul>
<li><strong>The Fallacy:</strong> "The rooster crows at 5:00 AM. The sun rises at 5:05 AM. Therefore, the rooster's crowing causes the sun to rise."</li>
<li><strong>Why it's wrong:</strong> Chronology does not equal causality.</li>
</ul>
<h3>2. Cum Hoc Ergo Propter Hoc (With this, therefore because of this)</h3>
<p>Also known as confusing <strong><a href="/vocab/correlation-vs-relation">correlation</a></strong> with causation. Assuming that because two things happen at the same time, one causes the other.</p>
<ul>
<li><strong>The Fallacy:</strong> "Ice cream sales and shark attacks both spike in July. Therefore, eating ice cream attracts sharks."</li>
<li><strong>The Reality:</strong> There is a hidden third variable: Summer heat. People eat ice cream when it's hot, and they swim in the ocean when it's hot.</li>
</ul>
<h3>3. The Texas Sharpshooter</h3>
<p>Imagine a cowboy shooting his gun randomly at the side of a barn. Afterward, he walks up, paints a bullseye around the tightest cluster of bullet holes, and claims he's a sharpshooter. </p>
<p>This fallacy occurs when a person emphasizes similarities in data but ignores the differences, artificially creating a pattern where none exists. (This is common in conspiracy theories and numerology).</p>
<ul>
<li><strong>The Fallacy:</strong> "Look at these three successful tech CEOs. They all dropped out of college, they all drink green tea, and they all own golden retrievers. Therefore, dropping out of college and drinking green tea with a golden retriever is the secret formula for building a billion-dollar startup!"</li>
<li><strong>Why it's wrong:</strong> The speaker is ignoring the thousands of college dropouts with green tea and golden retrievers who went bankrupt, cherry-picking only the data points that fit their desired narrative.</li>
</ul>
<hr>
<h2>Part IV: Weapons of Distraction</h2>
<p>These fallacies aren't really about logic; they are about changing the subject to avoid losing.</p>
<h3>1. The Red Herring</h3>
<p>Introducing a completely irrelevant topic into an argument to distract attention from the original issue.</p>
<ul>
<li><strong>Interviewer:</strong> "Senator, your new environmental bill seems to have a massive loophole for corporate polluters."</li>
<li><strong>Senator:</strong> "What we really need to be talking about is the devastating impact of video game violence on our youth!"</li>
<li>(The name comes from the old practice of dragging a smelly fish across a trail to distract hunting dogs).</li>
</ul>
<h3>2. Whataboutism (A modern variant of Tu Quoque)</h3>
<p>Deflecting a difficult question or accusation by bringing up a completely different issue regarding the opponent.</p>
<ul>
<li>"Yes, my client embezzled funds, but <em>what about</em> the mayor who was caught taking bribes last year? Why aren't we talking about that?"</li>
</ul>
<blockquote>
<h3><em>Side Note: Intellectual Bullying (Proof by Intimidation)</em></h3>
<p>While not a strict structural fallacy, a very common weapon of distraction is <strong>Argumentum Verbosium</strong> (Proof by Intimidation). This happens when someone intentionally uses extremely complex jargon, overly academic language, or an overwhelming volume of dense information to make the other person feel uneducated, unqualified, or too exhausted to argue back.</p>
<p>The underlying, unspoken premise is: <em>"I am using words you don't understand; therefore, I am smarter than you; therefore, I am right."</em> This is often tied to <strong>Obscurantism</strong>—the deliberate practice of making things vague or incredibly complex to hide the fact that the actual argument is weak.</p>
<p>As the famous quote (often attributed to Albert Einstein) goes: <span style="background-color: rgba(16, 52, 166, 0.85); color: #e0f2fe; font-weight: bold; padding: 2px 6px; border-radius: 4px;">"If you can't explain it to a six-year-old, you don't understand it yourself."</span> A master of logic can explain a complex topic simply; a fraud overcomplicates a simple topic to hide.</p>
</blockquote>
<hr>
<h2>Part V: Cognitive Biases (The Brain's Operating System Bugs)</h2>
<p>While logical fallacies are errors in arguments, <strong>Cognitive Biases</strong> are errors in human psychology. They are the subconscious shortcuts our brains take that lead us away from rationality.</p>
<h3>1. Confirmation Bias</h3>
<p>The tendency to search for, interpret, favor, and recall information in a way that confirms or supports your prior beliefs or values.</p>
<ul>
<li>If you believe the earth is flat, you will ignore thousands of satellite photos and focus entirely on one blurry YouTube video of a horizon that looks straight.</li>
</ul>
<h3>2. Sunk Cost Fallacy</h3>
<p>Continuing a behavior or endeavor as a result of previously invested resources (time, money, or effort), even when it clearly isn't working.</p>
<ul>
<li>"I've already watched 6 seasons of this terrible show, I have to finish the last two." (No, you don't. Your past time is gone; don't waste your future time).</li>
</ul>
<h3>3. Dunning-Kruger Effect</h3>
<p>A cognitive bias whereby people with low ability, expertise, or experience regarding a certain type of task or area of knowledge tend to overestimate their ability or knowledge.</p>
<ul>
<li>Essentially: The less you know about a subject, the simpler it seems, leading to overconfidence. (See: Every person who argues with an epidemiologist on Twitter).</li>
</ul>
<p><img src="https://upload.wikimedia.org/wikipedia/commons/4/46/Dunning%E2%80%93Kruger_Effect_01.svg" alt="Dunning-Kruger Effect Curve"></p>
<hr>
<h2>Conclusion: How to Survive the Noise</h2>
<p>The world is noisy, and bad arguments are loud. But armed with the knowledge of these fallacies, you possess a mental filter.</p>
<p>When you hear a claim, evaluate the <strong><a href="/vocab/premise">premises</a></strong>. Look at the structure. Ask yourself: <em>Is this person attacking the argument or the person? Are they presenting a false choice? Are they assuming causation where there is only correlation?</em></p>
<p>Learn to recognize these fallacies in others, but more importantly, <strong>learn to recognize them in yourself.</strong> We are all guilty of using them when we are emotional or defensive. True rationality requires the humility to admit when your own logic has failed.</p>
<p>Argue better. Demand better arguments. And please, stop attacking the straw men.</p>
<p><a href="https://fezcode.com/blog/encyclopedia-of-bad-arguments">Read more...</a></p>]]></content:encoded>
</item>
<item>
<title><![CDATA[The Lost Art of Thinking: A Colossal Rant on Logic]]></title>
<description><![CDATA[[object Object]]]></description>
<link>https://fezcode.com/blog/a-colossal-rant-on-logic</link>
<guid isPermaLink="false">https://fezcode.com/blog/a-colossal-rant-on-logic</guid>
<dc:creator><![CDATA[Ahmed Samil Bulbul]]></dc:creator>
<pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate>
<content:encoded><![CDATA[<h1>The Lost Art of Thinking: A Colossal Rant on Logic (and How to Actually Use It)</h1>
<p>Have you ever looked at a Twitter thread, a political debate, or a family argument at Thanksgiving and thought, <em>“Are these people even speaking the same language?”</em> </p>
<p>Spoiler alert: They aren't. They are speaking the language of emotion, tribalism, and sheer, unfiltered logical fallacy. We have supercomputers in our pockets and access to the sum of all human knowledge, yet the basic ability to construct a coherent, rational argument seems to be going the way of the dodo.</p>
<p>So, buckle up. We are going to strip away the noise and dive deep into the absolute fundamentals of <strong>Logic</strong>. We’re going back to the beginning, back to the dusty streets of ancient civilizations, to understand what logic is, how it works, and why society's current lack of it is driving me absolutely insane.</p>
<h2>Part I: The Dawn of Reason (Before the Internet Ruined Us)</h2>
<p>Logic didn't just fall out of the sky. It was born out of necessity. </p>
<p>While ancient Egyptians and Babylonians used practical mathematics and basic reasoning for things like land measurement after floods or calculating taxes, they didn't explicitly formalize the <em>rules</em> of thought. They knew <em>how</em> to calculate, but they didn't spend much time philosophizing about the <em>nature</em> of the calculation itself.</p>
<p>Enter Ancient Greece, specifically around the 4th century BCE. The Greeks loved to argue. They argued about politics, nature, gods, and what makes a good life. But to win an argument, you need rules. </p>
<h3>Aristotle: The Godfather of "Making Sense"</h3>
<p>If logic is a religion, <strong>Aristotle</strong> is its supreme deity. He was the first to systematically compile the rules of correct reasoning in a collection of works known as the <em>Organon</em> (meaning "instrument" or "tool"). </p>
<p>Aristotle gave us the <strong><a href="/vocab/syllogism">Syllogism</a></strong>. This is the absolute bedrock of deductive logic. A syllogism is a kind of logical argument that applies deductive reasoning to arrive at a conclusion based on two propositions that are asserted or assumed to be true.</p>
<p>The classic, undefeated champion of syllogisms goes like this:</p>
<ol>
<li><strong>Major Premise:</strong> All men are mortal.</li>
<li><strong>Minor Premise:</strong> Socrates is a man.</li>
<li><strong>Conclusion:</strong> Therefore, Socrates is mortal.</li>
</ol>
<p><em>Boom.</em> That’s it. If premise 1 is true, and premise 2 is true, the conclusion <em>must</em> logically follow. It is inescapable. If someone disagrees with the conclusion, they must prove that one of the premises is false. This simple framework was the primary system of logic in the Western world for nearly two thousand years!</p>
<h2>Part II: The Anatomy of an Argument</h2>
<p>To understand logic, you have to understand its anatomy. An argument in logic isn't a shouting match; it's a structured presentation of evidence.</p>
<h3>1. Propositions</h3>
<p>A proposition is simply a statement that is either true or false. </p>
<ul>
<li>"The sky is blue." (True)</li>
<li>"Dogs can speak fluent Spanish." (False)</li>
<li>"Ouch!" (Not a proposition, it's an exclamation.)</li>
<li>"Is it raining?" (Not a proposition, it's a question.)</li>
</ul>
<h3>2. Premises</h3>
<p>A <strong><a href="/vocab/premise">premise</a></strong> is a proposition used as evidence in an argument. It's the foundation you are building your house on. If your foundation is made of sand (false premises), your logical house will collapse.</p>
<h3>3. The Conclusion</h3>
<p>This is the proposition that is affirmed on the basis of the other propositions (the premises). </p>
<h3>4. Inference</h3>
<p>The magical leap from premises to conclusion. It’s the process of drawing a logical consequence from the given facts. </p>
<h2>Part III: The Two Flavors of Reasoning</h2>
<p>Not all arguments are created equal. Broadly speaking, there are two main ways human beings reason: Deductive and Inductive.</p>
<h3><a href="/vocab/deductive-reasoning">Deductive Reasoning</a>: Top-Down Logic</h3>
<p>This is what Aristotle was all about. You start with general rules and apply them to specific cases to reach a <strong>certain</strong> conclusion.</p>
<ul>
<li><strong>Premise 1:</strong> All planets in our solar system orbit the sun.</li>
<li><strong>Premise 2:</strong> Earth is a planet in our solar system.</li>
<li><strong>Conclusion:</strong> Earth orbits the sun.</li>
</ul>
<p>If the premises are true, the conclusion is 100% guaranteed. Deductive logic is about preserving truth. </p>
<p><strong>Validity vs. Soundness:</strong> This is crucial. </p>
<ul>
<li>An argument is <strong>valid</strong> if the structure is correct, even if the facts are crazy.
<em>(e.g., All birds are mammals. A penguin is a bird. Therefore, a penguin is a mammal. Valid structure, false premises).</em></li>
<li>An argument is <strong>sound</strong> if it is valid AND all its premises are actually true. This is the gold standard.</li>
</ul>
<h3><a href="/vocab/inductive-reasoning">Inductive Reasoning</a>: Bottom-Up Logic</h3>
<p>Inductive logic takes specific observations and builds them into a general theory. It deals in <strong>probabilities</strong>, not certainties.</p>
<ul>
<li><strong>Observation 1:</strong> The sun came up yesterday.</li>
<li><strong>Observation 2:</strong> The sun came up today.</li>
<li><strong>Conclusion:</strong> The sun will come up tomorrow.</li>
</ul>
<p>Is it guaranteed? Technically, no. The sun could explode tonight. But it is <em>highly probable</em>. Science operates heavily on inductive reasoning. We observe gravity working a million times, so we induce that it is a universal law.</p>
<p>The problem? Inductive reasoning can be flawed. </p>
<ul>
<li><strong>Observation:</strong> I saw a white swan. My neighbor saw a white swan. Every swan in this lake is white.</li>
<li><strong>Conclusion:</strong> All swans are white.
<em>(Until you travel to Australia and see a black swan, instantly destroying your theory.)</em></li>
</ul>
<h2>Part IV: Logical Fallacies - Why the Internet is a Dumpster Fire</h2>
<p>This is the rant part. A <strong><a href="/vocab/logical-fallacy">logical fallacy</a></strong> is an error in reasoning that renders an argument invalid or unsound. They are illusions of thought. People use them constantly—sometimes maliciously to manipulate you, and sometimes out of pure ignorance.</p>
<p>Here is a survival guide to the most common intellectual crimes:</p>
<h3>1. The Ad Hominem (Attacking the Person)</h3>
<p>Instead of addressing the argument, you attack the character of the person making it.</p>
<ul>
<li><em>Argument:</em> "We should invest more in renewable energy to fight climate change."</li>
<li><em>Fallacy:</em> "You're just a dirty hippie who doesn't understand economics, why should I listen to you?"
<em>(The person's hygiene or economic credentials don't invalidate the math on climate change).</em></li>
</ul>
<h3>2. The Straw Man</h3>
<p>You misrepresent someone's argument to make it easier to attack.</p>
<ul>
<li><em>Person A:</em> "I think we should rethink our current military spending."</li>
<li><em>Person B:</em> "So you want to leave our country completely defenseless against terrorists?! You hate our troops!"
<em>(Person A never said "leave us defenseless." Person B built a fake "straw man" argument to easily knock down).</em></li>
</ul>
<h3>3. The Slippery Slope</h3>
<p>Assuming that a relatively small first step will inevitably lead to a chain of related (and catastrophic) events.</p>
<ul>
<li><em>Fallacy:</em> "If we allow students to dye their hair pink, next they'll be wearing pyjamas to school, then they'll stop doing homework, and society will collapse into anarchy!"</li>
</ul>
<h3>4. The Appeal to Ignorance (Argumentum ad Ignorantiam)</h3>
<p>Asserting that a proposition is true because it has not yet been proven false (or vice versa).</p>
<ul>
<li><em>Fallacy:</em> "You can't prove that aliens haven't visited Earth, therefore, aliens have visited Earth."
<em>(The burden of proof is always on the person making the claim).</em></li>
</ul>
<h3>5. The False Dilemma (Black-and-White Fallacy)</h3>
<p>Presenting only two options when, in reality, there are more.</p>
<ul>
<li><em>Fallacy:</em> "You are either with us, or you are with the enemy."
<em>(What about staying neutral? What about agreeing with some points and disagreeing with others?)</em></li>
</ul>
<h3>6. The Post Hoc Fallacy (Correlation vs. Causation)</h3>
<p>Assuming that because Event B followed Event A, Event A caused Event B.</p>
<ul>
<li><em>Fallacy:</em> "I wore my lucky socks, and my team won. My socks caused the victory."
<em>(No, your team won because they scored more points. The socks were just smelly bystanders).</em></li>
</ul>
<h3>7. The Appeal to Authority</h3>
<p>Claiming something must be true because an "expert" said so, regardless of whether the expert is actually an authority on <em>that specific topic</em>, or without providing the actual evidence.</p>
<ul>
<li><em>Fallacy:</em> "My dentist says this new stock is a guaranteed winner, so I'm investing my life savings."</li>
</ul>
<h2>Part V: Enter the Machine - Boolean Logic</h2>
<p>Fast forward to the 19th century. A mathematician named <strong>George Boole</strong> had an idea that would change the course of human history. He decided to turn logic into algebra.</p>
<p>Before Boole, math was about numbers. Boole said, "What if math was about truth?"</p>
<p>He created <strong><a href="/vocab/boolean-algebra">Boolean Algebra</a></strong>, a system where variables represent truth values: <strong>True (1)</strong> or <strong>False (0)</strong>.
He introduced basic logical operations:</p>
<ul>
<li><strong>AND:</strong> Both inputs must be True for the output to be True.</li>
<li><strong>OR:</strong> At least one input must be True for the output to be True.</li>
<li><strong>NOT:</strong> Inverts the input (True becomes False, False becomes True).</li>
</ul>
<p>Why does this matter? Because a century later, engineers realized that Boolean logic was the perfect framework for electrical circuits. A switch is either ON (1/True) or OFF (0/False). </p>
<p>By combining transistors into logic gates (AND gates, OR gates, NOT gates), we built the modern computer. <strong>Every single digital device you use, including the screen you are reading this on, is fundamentally built on the rules of logic formalized by George Boole.</strong></p>
<p>The irony is staggering: The device you use to scroll through logically flawed arguments on social media only exists because of pure, flawless logic.</p>
<h2>Part VI: The Deep End - Symbolic Logic and Paradoxes</h2>
<p>As logic advanced into the 20th century (with titans like Gottlob Frege and Bertrand Russell), it became highly symbolic and mathematical. They wanted to strip away the ambiguity of human language completely.</p>
<p>Instead of saying "If it rains, the grass is wet," they write:
$P \rightarrow Q$
(Where P is "it rains" and Q is "the grass is wet", and $\rightarrow$ means "implies").</p>
<p>This symbolic logic is incredibly powerful for mathematics and computer science, but it also led logicians down a rabbit hole where they found the limits of logic itself: <strong>Paradoxes</strong>.</p>
<h3>The Liar's Paradox</h3>
<p>Consider the following sentence:</p>
<blockquote>
<p><strong>"This statement is false."</strong></p>
</blockquote>
<ul>
<li>If the statement is True, then what it says must be the case. So, it is False.</li>
<li>If the statement is False, then what it says is incorrect. So, it must be True.</li>
</ul>
<p>It contradicts itself perfectly. It breaks the very foundation of Aristotle's logic (the <strong><a href="/vocab/law-of-non-contradiction">Law of Non-Contradiction</a></strong>, which states something cannot be both true and false at the same time in the same way). </p>
<p>This isn't just a fun word game. In the 1930s, Kurt Gödel took this concept of self-reference and applied it to mathematics, proving his devastating <strong><a href="/vocab/incompleteness-theorems">Incompleteness Theorems</a></strong>. </p>