#OrderStatus
Day 23/90 TypeScript: a blank status banner traced to a typo'd lookup key.

I'd typed statusConfig as { [key: string]: Config }, so misspelled "refundeded" returned undefined and the compiler never blinked.

Record<OrderStatus, Config> made the typo a compile error.

#TypeScript #WebDev
November 6, 2026 at 12:31 AM
Can you spot this gotcha with exhaustive `switch` in Angular?
October 19, 2026 at 10:29 AM
Examining the "Boolean-Switch" in Java \_(ツ)_/
While reading through some ai-generated code today, I was caught off guard when I saw a switch statement inside of a boolean. What on earth has ai done now, I wondered. Here is the suspect: public boolean canChangeTo(OrderStatus newStatus) { switch (this) { case PLACED: return newStatus == PROCESSING || newStatus == CANCELLED; case PROCESSING: return newStatus == SHIPPED || newStatus == CANCELLED; case SHIPPED: return newStatus == DELIVERED; default: return false; } } Shortly after marveling at "ooo, this is a thing?" I started to question it. Why does this feel _different_? Basically in every other case besides enum, this is bad. Enum, to my knowledge, is the only case where this is acceptable. Why? Because in a flow where there can be one and only one direction, like order processing, this checks out. Each one will hit in the order it is intended to hit. Each case will be found true at the right time in the process, and will update the status accordingly. We can define our fixed, or set values (enums, short for enumeration) to use later in our switch. That might look like: public enum OrderStatus { PLACED("Placed"), PROCESSING("Processing"), SHIPPED("Shipped"), DELIVERED("Delivered"), CANCELLED("Cancelled"); } We use enums when we have a distinct list of choices that do not change. This could also work for days of the week or the current states of your most recent job applications. Because we are using enum, we avoid typos. Also, using your choices as enum values makes them classes in Java - a whole 'nother level of excitement. But back to my boolean-switch... Upon doing further digger I discovered that what claude had spat out (no hate on claude, I love claude!) was actually not optimized. There is a better way to write the boolean-switch. Since Java 14, we can use arrows to slim down our writing. public boolean canChangeTo(OrderStatus newStatus) { return switch (this) { case PLACED -> newStatus == PROCESSING || newStatus == CANCELLED; case PROCESSING -> newStatus == SHIPPED || newStatus == CANCELLED; case SHIPPED -> newStatus == DELIVERED; default -> false; }; } ...slimmer and concise! My brain likes this better. A peculiar boolean-switch has made me realize that using enums is incredibly more powerful and efficient than writing a string in an if-else statement. By using the _this_ keyword on the switch statement itself, it evaluates the enum value and not the boolean value. If you want to "switch" on the boolean, then just use an if else statement, because there is only two values anyways... I used to lean into if-else statements, but the switch is starting to grow on me.
dev.to
September 15, 2026 at 11:38 PM
2/ Five bad fields in one request. One inside a nested record, one on the second item of a list. One response, every field named and located, and nobody wrote the error handling. How, from the top:
buff.ly/zEIkXAU
#Java
September 9, 2026 at 6:05 PM
Higher-Kinded-J 0.4.10 is out 🧵
Whatever shape your data takes (a thirty-field DTO, a generic page of results, a Set three records down) 0.4.10 maps it, focuses it and traverses it with code your build compiles.
One parse, every bad field, one 422:
github.com/higher-kinde...
#Java #JVM
August 30, 2026 at 6:02 PM
In a recent example, I needed to track order status updates and an enum allows me to compare them numerically.

So with
```
OrderStatus {
Ordered = 0,
Paid = 100,
Confirmed = 200,
...etc
}
```

if status is 200, then 0 and 100 are also true, so I can check `if (thisStatus <= orderStatus)`
February 12, 2025 at 10:05 PM
Postando aqui para não passar vergonha no Linkedinho, mas onde que o segundo código é mais legível que o primeiro? #bolhadev
February 3, 2025 at 2:27 PM
May 2, 2026 at 11:31 AM
April 28, 2026 at 5:57 PM
April 28, 2026 at 5:24 PM
April 5, 2026 at 7:34 AM
April 5, 2026 at 7:31 AM
April 5, 2026 at 5:14 AM
April 5, 2026 at 3:14 AM
April 4, 2026 at 11:22 PM
April 4, 2026 at 5:14 PM
April 3, 2026 at 11:54 AM
March 24, 2026 at 12:03 PM
March 24, 2026 at 10:59 AM
Da war der Zug aber schon abgefahren, Win95 am Start und damit die Dominanz vorhanden. Naja, ich warte ja noch auf meinen "Neuen" ;)
July 21, 2026 at 11:43 AM
a tenet of avoiding scam emails that's always being shouted at people is "don't click suspicious links from websites and go to the website directly if it looks weird", but then the rewards center for order fulfilment from my insurance company will literally be shit like MY ORDER STATUS DOT COM
July 22, 2025 at 6:17 PM
⚠️ #Rustlang Tip: Use the #[must_use] attribute to ensure important return values aren't ignored.

Result is already marked as must_use but other types can be too!
It's good to add #[must_use] when ignoring the return value of a function is almost always a bug.
December 4, 2024 at 5:16 PM
The testing story is the bit worth shouting about.

Once services accept Expressive objects, unit tests mean constructing a plain PHP object.

new Order(['status' => OrderStatus::Pending])

No database. No factories. No mocking Eloquent.
June 3, 2026 at 2:37 PM
Laravel Expressive by Wendell Adriel brings the same kind of feel to Eloquent.

One trait on your Eloquent model. One artisan command to scaffold a typed class.

Your services receive public typed properties - OrderStatus $status, int $totalPence. Your IDE actually knows what they are.
June 3, 2026 at 2:37 PM