Readit News logoReadit News
lock1 commented on Log level 'error' should mean that something needs to be fixed   utcc.utoronto.ca/~cks/spa... · Posted by u/todsacerdoti
usefulcat · 2 days ago
Ideally a logging library should at least not make it easy to make that kind of mistake.
lock1 · 2 days ago
Ideally, but realistically, I have never heard of any major programming language that allows you to express "this function only accepts static constant string literal".
lock1 commented on Patterns.dev   patterns.dev/... · Posted by u/handfuloflight
wavemode · 12 days ago
Great site!

I tend to advocate for people to study design patterns. Not for the purpose that you will necessarily ever use most (or even any) of these exact patterns in your software, but just that you've strengthened your mental muscle for software design in general. I encounter lots of engineers who simply aren't able to think "outside the box" when building something new.

lock1 · 12 days ago
I always wondered if people actually find it beneficial to follow these "design patterns" or not.

Personally, I prefer to learn FP patterns, which tend to be backed with nice mathematical properties behind them.

lock1 commented on Thoughts on Go vs. Rust vs. Zig   sinclairtarget.com/blog/2... · Posted by u/yurivish
beautron · 18 days ago
But sometimes it is useful to return both a value and a non-nil error. There might be partial results that you can still do things with despite hitting an error. Or the result value might be information that is useful with or without an error (like how Go's ubiquitous io.Writer interface returns the number of bytes written along with any error encountered).

I appreciate that Go tends to avoid making limiting assumptions about what I might want to do with it (such as assuming I don't want to return a value whenever I return a non-nil error). I like that Go has simple, flexible primitives that I can assemble how I want.

lock1 · 18 days ago
But in most cases you probably want something disjoint like Rust's `Result<T,E>`. In case of "it might be success with partial failure", you could go with unnamed tuples `(Option<T>,E)` or another approach.
lock1 commented on Python is not a great language for data science   blog.genesmindsmachines.c... · Posted by u/speckx
OkayPhysicist · a month ago
Unless you think "most programmers" === "shitty webapp developers", I strongly disagree. Matrices are first class, important components in statistics, data analysis, graphics, video games, scientific computing, simulation, artificial intelligence and so, so much more.

And all of those programmers are either using specialized languages, (suffering problems when they want to turn their program into a shitty web app, for example), or committing crimes against syntax like

rotation_matrix.matmul(vectorized_cat)

lock1 · a month ago
That's needlessly aggressive. Ignoring webapps, you could do gamedev without even knowing what a matrix is.

You don't even need such construction in most native applications, embedded systems, and OS kernel development.

lock1 commented on Reinventing how .NET builds and ships (again)   devblogs.microsoft.com/do... · Posted by u/IcyWindows
zem · a month ago
out of curiosity, why not kotlin? I had the impression it was the jvm language to reach for by default these days.
lock1 · a month ago
Has too much sugar, and without JetBrains IDE you're stuck with a plain text editor. Not sure if it's generalizable to normal Kotlin or not, but learning Gradle Kotlin DSL made me want to rip my hair out when trying to understand what happens under the hood.
lock1 commented on We should all be using dependency cooldowns   blog.yossarian.net/2025/1... · Posted by u/todsacerdoti
dap · a month ago
At my last job, we only updated dependencies when there was a compelling reason. It was awful.

What would happen from time to time was that an important reason did come up, but the team was now many releases behind. Whoever was unlucky enough to sign up for the project that needed the updated dependency now had to do all those updates of the dependency, including figuring out how they affected a bunch of software that they weren't otherwise going to work on. (e.g., for one code path, I need a bugfix that was shipped three years ago, but pulling that into my component affects many other code paths.) They now had to go figure out what would break, figure out how to test it, etc. Besides being awful for them, it creates bad incentives (don't sign up for those projects; put in hacks to avoid having to do the update), and it's also just plain bad for the business because it means almost any project, however simple it seems, might wind up running into this pit.

I now think of it this way: either you're on the dependency's release train or you jump off. If you're on the train, you may as well stay pretty up to date. It doesn't need to be every release the minute it comes out, but nor should it be "I'll skip months of work and several major releases until something important comes out". So if you decline to update to a particular release, you've got to ask: am I jumping off forever, or am I just deferring work? If you think you're just deferring the decision until you know if there's a release worth updating to, you're really rolling the dice.

(edit: The above experience was in Node.js. Every change in a dynamically typed language introduces a lot of risk. I'm now on a team that uses Rust, where knowing that the program compiles and passes all tests gives us a lot of confidence in the update. So although there's a lot of noise with regular dependency updates, it's not actually that much work.)

lock1 · a month ago
I think it also depends on the community as well. Last time I touched Node.js and Javascript-related things, every time I tried to update something, it practically guaranteed something would explode for no reason.

While my recent legacy Java project migration from JDK 8 -> 21 & a ton of dependency upgrades has been a pretty smooth experience so far.

lock1 commented on HyperRogue – A non-Euclidean roguelike   roguetemple.com/z/hyper/... · Posted by u/stared
iberator · 2 months ago
Nah. It's ultra boring in comparison to nethack, pathos or more complex games like revengate(!) or greedy cave.

My listing of similar games:

- Grim Omens 3/5 - Revengate 4/5 - Dungeon Crawl Soup (on pc) 4/5 - The greedy cave 5/5 - Pathos 4/5

lock1 · 2 months ago
Like other sibling comment said, I think it's just your personal opinion. I don't think The Greedy Cave is that complex or belong to traditional roguelike category, more like MMO's grindy number game with some microtransaction.
lock1 commented on Backpropagation is a leaky abstraction (2016)   karpathy.medium.com/yes-y... · Posted by u/swatson741
joshdavham · 2 months ago
Given that we're now in the year 2025 and AI has become ubiquitous, I'd be curious to estimate what percentage of developers now actually understand backprop.

It's a bit snarky of me, but whenever I see some web developer or product person with a strong opinion about AI and its future, I like to ask "but can you at least tell me how gradient descent works?"

I'd like to see a future where more developers have a basic understanding of ML even if they never go on to do much of it. I think we would all benefit from being a bit more ML-literate.

lock1 · 2 months ago

  > I'd like to see a future where more developers have a basic understanding of ML even if they never go on to do much of it. I think we would all benefit from being a bit more ML-literate.
Why "ML-literate" specifically? Also, there are some people against calculus and statistic in CS curriculum because it's not "useful" or "practical", why does ML get special treatment here?

Plus, I don't think a "gotcha" question like "what is gradient descent" will give you a good signal about someone if it get popularized. It probably will lead to the present-day OOP cargo cult, where everyone just memorizes whatever their lecturer/bootcamp/etc and repeats it to you without actually understanding what it does, why it's the preferred method over other strategies, etc.

lock1 commented on John Carmack on mutable variables   twitter.com/id_aa_carmack... · Posted by u/azhenley
smrq · 2 months ago
If you call a variable tau in production code then you're being overly cute. I know what it means, because I watch math YouTube for fun, but $future_maintainer in all likelihood won't.
lock1 · 2 months ago
Where do you draw the line then? Stopping at `tau` just because `$future_maintainer` might get confused feels like an arbitrary limit to me.

What about something like `gamma`? Lorentz factor? Luminance multiplier? Factorial generalization?

Why not just use the full sentence rather than assign it to an arbitrary name/symbol `gamma` and leave it dependent on the context?

And it's not that hard to add an inline comment to dispel the confusion

  const tau = 2*pi; // Alternate name for 2pi is "tau"

lock1 commented on Result is all I need   rockyj-blogs.web.app/2025... · Posted by u/rockyj
tyleo · 2 months ago
You know, I’ve also found this funny.

I like the declaration side. I think part of where it misses the mark is the syntax on the caller side.

I feel like standard conditionals are enough to handle user errors while the heavy machinery of try-catch feels appropriately reserved for unexpected errors.

lock1 · 2 months ago
Probably, the problem with Java's `try-catch` is it's not composable and has an abundance of unchecked exceptions (could mess up `catch` type). In Rust, you could just `?` to short-circuit return or do another chained method call `result.map(...).and_then(...).unwrap_or(...)`.

And more importantly, I don't think there's any JEP trying to improve checked exception handling.

u/lock1

KarmaCake day175April 26, 2025
About
just a random guy which likes type system & (useless) math a little bit too much.

bit polyglot, 4 natural languages (funnily enough, one of them has the same name with PL) and quite a lot of PLs.

day to day: Java, Rust

other PLs, in descending order of familiarity: C99, Javascript, Typescript, Python, Haskell, x86 asm, C++23, Lua, Windows & Linux Shell Scripts, C#, Pascal, Julia, Matlab, Prolog.

View Original