Browsing Tag
beginners
1756 posts
I Failed a Promise I Made to Myself
It was 2:07 a.m. The room was quiet, but my mind wasn’t. Like many nights before, I was…
Understanding Data Types and Operators in C: The Foundation Every Beginner Should Master
If you’re learning C f, this is one topic you simply can’t skip. Every C program—whether it’s a…
JavaScript Variables and Operators
Variables in JavaScript variables are containers used to store data values that can be manipulated or referenced later…
Weekly Dev Log 2026-W13
🗓️ This Week This week, I mainly focused on iOS development📱. I also tested a small workflow using…
I built Pong from scratch in LÖVE and Lua (a two part series)
I wrote a two part series on building Pong from scratch in LÖVE and Lua. If you’ve never…
Mastering Python’s itertools: 5 Functions That Will Transform Your Data Pipelines
When you process large datasets or build data pipelines in Python, writing clean and memory-efficient code is essential.…
7 AI Prompts That Save Me 10+ Hours Every Week as a Developer (Copy-Paste Ready)
I tracked every AI prompt I used for 30 days straight. Most were throwaway. But seven of them…
Build Your First Home Lab: The Developer’s Budget Hardware Guide
Cloud compute costs are climbing and local environments are making a powerful comeback. Every staging instance and every…
状态模式深度指南:构建可动态切换行为的艺术
状态模式深度指南:构建可动态切换行为的艺术 概述 状态模式(State Pattern)是一种行为型设计模式,它允许对象在内部状态改变时改变其行为。看起来对象似乎修改了其类。这种模式是解决复杂状态转换逻辑的利器,特别适合用于工作流引擎、游戏开发、订单处理系统等场景。 核心概念 状态模式的核心思想是:将每个状态封装为独立的类,对象的行为取决于其当前状态,而状态之间的转换由状态类自己管理。 关键角色 Context(上下文):维护当前状态的实例,负责将请求委托给状态对象处理 State(抽象状态):定义所有具体状态的共同接口 ConcreteState(具体状态):实现各个具体状态的行为,并负责状态转换 为什么需要状态模式? 传统方式的困境 想象一个订单系统,订单有多种状态:待支付、待发货、已发货、已完成、已取消。每个状态下可以执行不同的操作。 // 传统的if-else方式 class Order {…
Vector Databases: Search by Meaning, at Scale
Embeddings turn meaning into vectors (last post). But if you have a million of them, how do you…