TypeScript Tutorial #10: Classes and Access Modifiers

In the previous tutorial, we learned about generics. Now let’s learn about classes in TypeScript — how they work, what access modifiers do, and when you should use them. By the end of this tutorial, you will know how to use public, private, protected, readonly, abstract classes, parameter properties, and how to implement interfaces with classes. Basic Classes A class defines a blueprint for objects. TypeScript adds type annotations to JavaScript classes: ...

May 5, 2026 · 9 min

TypeScript Tutorial #9: Generics

In the previous tutorial, we learned about type narrowing and type guards. Now let’s learn about generics — one of the most powerful features in TypeScript. By the end of this tutorial, you will know how to write generic functions, interfaces, and constraints. You will also learn common patterns like keyof, default type parameters, and generic utility functions. Why Generics? Imagine you need a function that returns the first element of any array: ...

May 5, 2026 · 8 min

TypeScript Tutorial #8: Type Narrowing and Type Guards

In the previous tutorial, we learned about enums and const assertions. Now let’s learn about type narrowing — one of the most important concepts in TypeScript. By the end of this tutorial, you will know how to use typeof, instanceof, custom type guards, discriminated unions with switch, and exhaustive checking with never. What is Type Narrowing? Type narrowing means making a type more specific within a block of code. When you have a union type like string | number, TypeScript can figure out the exact type based on your checks. ...

May 5, 2026 · 8 min

TypeScript Tutorial #7: Enums and Const Assertions

In the previous tutorial, we learned about union types and literal types. Now let’s learn about enums and const assertions — two ways to define a fixed set of values in TypeScript. By the end of this tutorial, you will know when to use enums, when to use as const, and how the satisfies operator works. What is an Enum? An enum (enumeration) is a way to define a group of named constants. TypeScript has three kinds: numeric enums, string enums, and const enums. ...

May 4, 2026 · 8 min

Claude AI Tutorial #19: Claude for Code Generation — Best Practices

Claude is one of the best AI models for code generation. Sonnet 4.6 is the first Sonnet model to beat the previous Opus in coding benchmarks. But good code generation depends on how you ask. This article covers 10 best practices that will get you better code from Claude every time. This is Article 19 in the Claude AI — From Zero to Power User series. You should know Prompt Engineering Basics and Tool Use before this article. ...

May 4, 2026 · 9 min

TypeScript Tutorial #6: Union Types, Literal Types, and Type Aliases

In the previous tutorial, we learned about objects and interfaces. Now let’s learn about union types, literal types, and type aliases — patterns that make TypeScript truly powerful. By the end of this tutorial, you will know how to use union types, literal types, discriminated unions, intersection types, and type aliases. Union Types A union type means “this value can be one of several types.” Use the | (pipe) symbol: let id: string | number; id = "abc-123"; // OK — string id = 42; // OK — number id = true; // Error: Type 'boolean' is not assignable to type 'string | number' Union types are everywhere in real code. A function that accepts multiple types: ...

May 4, 2026 · 7 min

TypeScript Tutorial #5: Objects and Interfaces

In the previous tutorial, we learned how to type functions. Now let’s learn how to describe the shape of objects — one of the most important skills in TypeScript. By the end of this tutorial, you will know how to define object types, use interfaces, extend them, and choose between interfaces and type aliases. Object Types You can describe an object’s shape by listing its properties and types: let user: { name: string; age: number } = { name: "Alex", age: 25, }; TypeScript checks that the object matches the shape: ...

May 3, 2026 · 7 min

TypeScript Tutorial #4: Functions and Type Annotations

In the previous tutorial, we learned the basic types in TypeScript. Now let’s learn how to use types with functions — the building blocks of every program. By the end of this tutorial, you will know how to type every kind of function in TypeScript. Function Parameter Types In TypeScript, you must add types to function parameters. TypeScript cannot infer parameter types: // JavaScript — no types function greet(name) { return "Hello, " + name; } // TypeScript — types required function greet(name: string) { return "Hello, " + name; } If you forget to add a type, TypeScript gives an error with strict: true: ...

May 3, 2026 · 7 min

TypeScript Tutorial #3: Basic Types

In the previous tutorial, we installed TypeScript and wrote our first program. Now let’s learn the type system — the core feature that makes TypeScript useful. By the end of this tutorial, you will know every basic type in TypeScript and when to use each one. Type Annotations A type annotation tells TypeScript what type a variable should be. You add it after the variable name with a colon: let name: string = "Alex"; let age: number = 25; let isActive: boolean = true; The : string, : number, and : boolean are type annotations. If you try to assign the wrong type, TypeScript gives an error: ...

May 3, 2026 · 6 min

Claude AI Tutorial #18: Fine-Tuning Prompts — Evaluation, Testing, and Iteration

A prompt that works on three examples might fail on the fourth. Prompt engineering without testing is guessing. In this article, you will learn how to test prompts systematically, measure quality, and iterate until you get reliable results. This is Article 18 in the Claude AI — From Zero to Power User series. You should know Prompt Engineering Basics before this article. By the end, you will have an eval harness that tests your prompts automatically and a process for improving them. ...

May 2, 2026 · 10 min