unkletayo

Writing

I write to understand things better and to share what I learn. Most of my writing is about software engineering, but I also write about books, ideas and things that have nothing to do with computers.

  1. EngineeringJava NIO: channels, buffers, and serializationNIO channels as bidirectional I/O abstractions, ByteBuffer as a positioned memory region, FileChannel for large file reads and memory-mapped files, SelectableChannel and Selector for non-blocking I/O, and Java object serialization: the contract, the risks, and the alternatives.
  2. EngineeringHow Java navigates the filesystem: files, paths, and I/OPath as a filesystem location description, Path.of and path operations, Files utility methods for reading and writing text and bytes, file metadata, creating and deleting, copying and moving, listing and walking directories, and what changed from the java.io.File API.
  3. EngineeringHow Java reads and writes text: bytes, characters, and encodingThe InputStream and OutputStream byte contracts, the Reader and Writer character contracts, charset encoding and decoding, the FileReader platform-default charset trap, Java 18's switch to UTF-8 as the standard default, buffering, and Files.readString for small files.
  4. EngineeringJava's Stream API: lazy pipelines and absent valuesStream pipeline structure, source, intermediate, and terminal operations, lazy evaluation, map versus flatMap, common terminal operations and collectors, parallel streams, and Optional as a type-safe alternative to null returns.
  5. EngineeringHow Java treats functions as valuesWhat functional interfaces are, how lambda expressions create instances of them, method references as a shorthand, variable capture and effectively-final variables, common functional interfaces from java.util.function, and how lambdas relate to anonymous classes.
  6. EngineeringGenerics: erasure, raw types, and what the compiler actually doesHow Java implements generics through type erasure, what the compiler substitutes for type parameters in bytecode, bridge methods, raw types and their relationship to unchecked warnings, and the practical restrictions that follow from erasure.
  7. EngineeringGenerics: wildcards and when to use themWhat wildcards are in Java generics, the difference between unbounded, upper bounded (? extends T), and lower bounded (? super T) wildcards, the producer-extends-consumer-super rule, and when to use a wildcard versus a type parameter.
  8. EngineeringGenerics: writing code that works for more than one typeWhat problem generics solve, how to declare and use type parameters on classes and methods, upper bounded type parameters with extends, the type safety the compiler enforces, and the difference between generic classes and generic methods.
  9. EngineeringException design: try-with-resources, chaining, and custom typestry-with-resources and AutoCloseable, exception chaining with getCause(), designing custom checked and unchecked exception types, the checked-versus-unchecked decision for your own API, and common exception-handling mistakes to avoid.
  10. EngineeringJava's most common exceptions and what they meanWhat causes NullPointerException, ClassCastException, ArrayIndexOutOfBoundsException, IllegalArgumentException, StackOverflowError, and IOException, how to read a stack trace to find the source, and what each exception type tells you about the bug.
  11. EngineeringHow Java separates interface from implementationWhat abstract classes and interfaces are, the specific things each can and cannot do, default methods since Java 8, sealed interfaces, functional interfaces as a bridge to lambdas, and a decision guide for choosing between them.
  12. EngineeringPolymorphism and dynamic dispatchHow Java selects the right method at runtime through dynamic dispatch, the vtable mechanism HotSpot uses, instanceof and pattern matching for type checks, and the ClassCastException trap.
  13. EngineeringInheritance: extending a classWhat a subclass inherits from its superclass, how method overriding works, the role of super for fields and constructors, final classes and methods, and when to prefer composition over inheritance.
  14. EngineeringEncapsulation: hiding state behind a boundaryWhat encapsulation is, the four Java access modifiers and what each permits, why the goal is protecting invariants rather than generating getters, and how records provide encapsulation for immutable data.
  15. EngineeringInitialization order: when each line of code runsWhen static initializers run versus instance initializers, how this() and super() chain constructors together, and the exact sequence Java follows from class loading to a fully constructed object.
  16. EngineeringClasses: fields, constructors, and defaultsWhat fields hold and how they get default values, what constructors do that methods cannot, when Java provides a no-argument constructor, constructor overloading, and the invariant that every constructor's job is to establish.
  17. EngineeringStrings: building, joining, and formattingString concatenation under the hood, why the loop pattern is expensive, StringBuilder versus StringBuffer, StringJoiner and String.join(), formatted() versus format(), and a decision guide for picking the right tool.
  18. EngineeringStrings: what Java actually storesWhat a String stores internally, why immutability enables the string pool, every construction method with guidance on when each is appropriate, and how text blocks work.
  19. EngineeringObjects, equality and identityWhat happens when you call new, the difference between object identity and equality, how equals() and hashCode() work together, the string pool, and why overriding one without the other breaks collections.
  20. EngineeringMethods and the call stackHow Java methods work at the JVM level: stack frames, local variable slots, the operand stack, pass-by-value for primitives and references, and why swap(a, b) never works.
  21. EngineeringAssignment and what gets copiedWhat Java's assignment operator actually does: copying primitive values vs copying addresses, aliasing, mutation through shared references, and what null means.
  22. EngineeringHow Java stores valuesHow Java's type system maps to memory: two's complement integers, IEEE 754 floats, the eight primitive types, reference variables as addresses, and why the stack and heap are structured the way they are.
  23. EngineeringWhat happens when you run a Java program?What javac and java actually do: compilation to bytecode, class loading and linking, the JIT compiler, and how the call stack works, with real javap output.
  24. EngineeringNginx static hosting: multiple sites, caching, and compressionConfigure Nginx server blocks, cache versioned assets, enable compression, preserve error statuses, and inspect responses.
  25. EngineeringNginx basics: install and serve a static websiteInstall Nginx, understand its configuration contexts, serve a static site, and check requests and errors.
  26. EngineeringHow I fixed the mystery of corrupted file downloads from AWS S3Users said downloaded documents were corrupted, yet the files in S3 were fine. How I tracked down the cause, and the fix.
  27. EngineeringSetting up PostgreSQL on macOS: A fresh start guideInstall PostgreSQL on a Mac with Homebrew, start the service, create a database and a user, and connect your app to it.
  28. EngineeringUnderstanding Linux file and folder permissionsHow to read a permission string such as drwxr-xr-x, what each part means for the owner, the group and everyone else, and how to set it.
  29. EngineeringHow to stop one or all running Docker containersStop containers by name or ID, allow time for shutdown, and handle an empty running-container list.
  30. EngineeringLearning JavaScript the easy way: unlocking the power of scope with closuresA closure is a function that keeps access to its parent's scope after the parent has finished. A short explanation with examples.
  31. EngineeringLearning JavaScript the easy way: scopes and hoistingWhat scope means in JavaScript, how global and local scope differ, and what hoisting does to your variables, from beginner level up.
  32. EngineeringLearning JavaScript the easy way: variablesDeclare JavaScript variables with let, const, and var, assign values, and distinguish undefined from an undeclared name.
  33. EngineeringHow to rename Git branches locally and remotelyRename a Git branch on your machine and on the remote, step by step, using a branch called feature/new-feature as the example.
  34. EngineeringLearning JavaScript the easy way: JavaScript grammarPart 1 of Learning JavaScript the easy way. Case sensitivity, identifiers, comments, statements and expressions, written for beginners.