Skip Navigation
Putting Go's Context package into context
  • The context package is such a big mistake. But at this point we just have to live with it and accept our fate because it's used everywhere

    It adds boilerplate everywhere, is easily misused, can cause resource leaks, has highly ambiguous conotations for methods that take a ctx: Does the function do IO? Is it cancellable? What transactional semantics are there if you cancel the context during method execution.

    Almost all devs just blindly throw it around without thinking about these things

    And dont get me startet on all the ctx.Value() calls that traverse a linked list

  • What is the best way to store data for exceptional cases among nested objects in arrays in JSON?
  • Depending on your needs you can also break it into a columnar format with some standard compression on top. This allows you to search individual fields without looking at the rest.

    It also compress exceptionally well, and "rare" fields will be null in most records, so run length encoding will compress them to near zero

    See fx parquet

  • What are some popular applications that use C?
  • Postgres and MySQL/mariadb are all primarily written in C.

    Contrary to what other posters here claim, most programming languages are not written in C, but are self hosted. Ie. written using themselves. This usually involves a small bootstrapping component written in C or something similar, but that is a minor part of a whole

  • Range over int and func, it's happening!
    github.com spec: add range over int, range over func · Issue #61405 · golang/go

    Following discussion on #56413, I propose to add two new types that a for-range statement can range over: integers and functions. In the spec, the table that begins the section would have a few mor...

    spec: add range over int, range over func · Issue #61405 · golang/go

    Go 1.22 will ship with "range over int" and experimental support for "range over func" 🥳

    0
    Intentionally corrupting LLM training data?
  • You should probably change page content entirely, server sizey, based on the user agent og request IP.

    Using CSS to change layout based on the request has long since been "fixed" by smart crawlers. Even hacks that use JS to show/hide content is mostly handled by crawlers.

  • InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)KA
    kamstrup @programming.dev
    Posts 1
    Comments 7