livingcoder

joined 2 years ago
[–] livingcoder@programming.dev 2 points 6 months ago* (last edited 6 months ago)

I prefer to just throw the state into a database. Each table has their own "repository" type that knows how to save/load models and then I have "manager" types that use "repository" types to compose larger, feature-specific domain models.

I usually just use Sqlite for it's simplicity but I'm not opposed to Postgres via Docker.

[–] livingcoder@programming.dev 14 points 6 months ago

When your management judges teams by lines-of-code written.

[–] livingcoder@programming.dev 10 points 6 months ago (1 children)

I'm just going to start pronouncing it "The Gulf of MEH-he-co", really laying on a heavy Spanish accent for clarity.

[–] livingcoder@programming.dev 3 points 6 months ago

I'm surprised this doesn't already exist.

[–] livingcoder@programming.dev 2 points 6 months ago* (last edited 6 months ago)

After many years of using SO, I've started using ChatGPT for all of my programming questions and have not looked back once. For my usual "I know X is possible, but how do I do that in Y language" questions, it's been a dream using ChatGPT.

[–] livingcoder@programming.dev 3 points 7 months ago

In Rust, using the Option and Result types make the general flow of the application much easier to organize, make modular, and reuse.

[–] livingcoder@programming.dev 22 points 7 months ago

This was a good blog post. I particularly appreciated the statement about the validate and parse function comparison: "Both of these functions check the same thing, but parseNonEmpty gives the caller access to the information it learned, while validateNonEmpty just throws it away."

[–] livingcoder@programming.dev 2 points 7 months ago (3 children)

Is that a water dispenser? I need something like that.

[–] livingcoder@programming.dev 6 points 7 months ago (1 children)

They apologize in situations when it's not even a big deal, like walking past someone in the grocery store aisle who's trying to look at the items on the shelf.

[–] livingcoder@programming.dev 1 points 7 months ago (1 children)

In what scenario could the first character be a newline character? I think that if-statement may be unnecessary, but I never use raw user input like you are here.

[–] livingcoder@programming.dev 1 points 7 months ago* (last edited 7 months ago) (1 children)

I'm not sure that you need a range when pulling the character from the input variable. Simply input[i] and input[input.len() - i - 1] should work.

[–] livingcoder@programming.dev 11 points 7 months ago

I would love to see professional chess players give this a fair chance. The clock could stop when they declare their move verbally (ensuring that the game doesn't devolve into an endurance test) and start up again for the next player upon the move being completed.

view more: ‹ prev next ›