Archives · Page 4 of 5

Browse all articles in reverse chronological order.

2026-11

ProgrammingIntermediateSeries 4

Templates, Layouts and Escaping in PHP

Split querying from output with one small render function: layouts, partials, htmlspecialchars-based escaping, alternative syntax, and what views must never do.

ProgrammingIntermediateSeries 6

Unit Testing PHP with PHPUnit

Install PHPUnit 11 with Composer, choose assertions that actually fail, use data providers and test doubles, test PDO code on SQLite, and run coverage in CI.

ProgrammingBeginnerSeries 1

PHP Variables and Data Types

Variable syntax and scope, the scalar types, strings and arrays, why loose comparison bites, what declare(strict_types=1) actually changes, and the falsy values that surprise newcomers.

ProgrammingIntermediateSeries 3

Python Classes and Object-Oriented Basics

Define classes, tell instance and class attributes apart, use @property, @classmethod and inheritance with super(), and implement __repr__ and __eq__ correctly.

ProgrammingIntermediateSeries 2

Command-Line Tools and Project Layout in Python

Build a CLI with argparse: positional and optional arguments, types, choices, custom validators and subcommands, then package it with src layout, pyproject.toml and correct exit codes.

ProgrammingIntermediateSeries 1

Python Comprehensions and Iteration Tools

List, dict and set comprehensions, generator expressions, and the standard library helpers — enumerate, zip, sorted, itertools — that replace most manual loops.

ProgrammingBeginnerSeries 2

Python Conditionals and Loops

How truthiness works in Python, when to use for versus while, the rarely used loop else clause, and the iteration mistakes that produce wrong results.

ProgrammingIntermediateSeries 3

Cleaning CSV Data and Writing a JSON Report

A complete, runnable script: read a messy CSV with csv.DictReader, validate and convert each row, count skipped rows by reason, aggregate with collections, and write a JSON report.

ProgrammingIntermediateSeries 4

Python dataclasses and Type Hints

Annotate your code so editors and mypy catch mistakes before runtime, then let @dataclass generate __init__, __repr__ and __eq__ — with default_factory, frozen and slots.

ProgrammingBeginnerSeries 8

Python Exceptions and Custom Errors

How try/except/else/finally actually runs, which exceptions to catch, keeping context with raise from, designing custom error hierarchies, and the anti-patterns that hide bugs.

ProgrammingBeginnerSeries 7

Reading and Writing Files in Python

Open files safely with with, stream large files line by line, build paths with pathlib, and handle JSON, CSV, and encodings without the usual surprises.

ProgrammingBeginnerSeries 6

Python Functions and Argument Passing

Define functions, mix positional and keyword arguments, avoid the mutable default trap, collect extra arguments with *args and **kwargs, and understand scope rules.

ProgrammingIntermediateSeries 5

Python Iterators and Generators

Separate iterables from iterators, trace exactly how yield suspends a function, stream a large file through a generator pipeline, and know when yield from, send and close are worth the complexity.

ProgrammingBeginnerSeries 4

Python Lists and Dictionaries in Practice

The list and dict operations you reach for daily: slicing, iteration, shallow versus deep copies, get versus indexing, and grouping with setdefault.

ProgrammingIntermediateSeries 2

Python Modules, Packages and Virtual Environments

How imports resolve, absolute versus relative imports, the __main__ guard, and isolating dependencies per project with venv, pip and pyproject.toml.