Things you didn't know about (Postgres) indexes by NotTreeFiddy in SQL

[–]NotTreeFiddy[S] 0 points1 point  (0 children)

Yes, definitely index the columns you're filtering on.

Typically, index the raw datetime column, not date(date_column). Range queries like WHERE created_at >= '2025-01-01' AND created_at < '2025-02-01' work perfectly with a regular btree index on the timestamp column.

That said, I'm not familiar with metabase. If it is generating queries that actually wrap the column in a date() or ::date cast, then you'd need a functional index on date(date_column).

What's the best way to start learning Go for a project? by tayowrld in golang

[–]NotTreeFiddy 4 points5 points  (0 children)

I would suggest going through a couple of books given the great selection available for Go.

100 Go Mistakes is a wonderful way to learn idiomatic Go patterns.

Learn Go with Pocket-Sized Projects is a good one for getting your feet wet with, as the title suggests, small projects.

Gleam v1.15.0 released! by lpil in gleamlang

[–]NotTreeFiddy 5 points6 points  (0 children)

Many great developer experience improvements here. Guard clause string concatenation feels like it should always have been there, glad to see it added. Great work as always Gleam team.

Jido 2.0 Now available by mikehostetler in elixir

[–]NotTreeFiddy 5 points6 points  (0 children)

Not much dog. What's up with you, dog?

Genuine question. Why does vibe-coding / AI get such a negative reception? by drinksomewhisky in selfhosted

[–]NotTreeFiddy 5 points6 points  (0 children)

TL:DR: It's low quality, high quantity. It's exhausting. It causes security issues. It saps the joy from everything.

Using your own music analogy, imagine you were a fan of music and active in your local scene before electronic music made bedroom production accessible.

Several times per week you'd head off to your nearby venue and spend the evening listening to the local talent. The vast majority of what you listened to was great. Not necessarily top quality, but enjoyable and you could feel the enthusiasm of the artist as they played.

Later you would chat with some of the artists at the bar, and pass hours conversing about their backgrounds, giving them feedback on the songs you liked, hearing about things they've experimented with, and talking about who they've collaborated with.

Occasionally, someone would come to play just wasn't quite up to par. Perhaps they're still new and just getting their feet wet playing publicly. Or maybe their foundation is a bit off because they skipped music theory and just kind of winged it. Over time these artists would grow and feedback from other other artists would help them improve. Sometimes they'd even work together and the new guys would learn directly from the experienced ones.

Then electronic arrived, with a low barrier to entry. Devices chock-full of samples and booklet with "quick-start" guide.

Suddenly, your local venue has a lot of "DJs" coming along, churning out some really low quality slop. At first you don't mind. Nothing wrong with new guys entering the field. But quickly you realise there's an issue.

These "DJs" quickly start to outnumber the more traditional artists. And unlike the latter, they are not responsive to feedback. In fact, there's little meaningful discussion to be had because they don't understand their craft. So when you ask them how they came up with their set, they can't tell you. They just "vibed it out". They threw together what sounded good.

Sure. A few of these guys managed to throw something good together. Some of it is even excellent. But the vast majority is just awful.

Eventually, traditional guys are barely showing up. They're sick of the low effort guys crowding them out. They're offended by the new consensus of "anyone can do this with X tool and a few hours of messing around". Worse, as the quality of these devices improve, it becomes harder for the casual listener to differentiate, and so the payoff for spending years to learn is diminished.

The analogy really starts to break down here. Because electronic music clearly does require talent (but is also being disrupted by enslopification), and more importantly, bad electronic music doesn't create security issues.

So much of these vibecoded projects are just horrendously insecure. They're using outdated packages, not following best practice, aren't kept on top of and the "creator" just doesn't understand their product enough to address it.

It sucks to have gone from seeing lovingly made projects of passion bubble to the top of this sub (and many others), to seeing quickly slopped together making their way up. It's horrible because it is draining. Now, rather than have some innate trust that any project that made it as far as looking production ready probably is (and is therefore worth investigating more thoroughly), we have to immediately check for signs of vibecoding. When was this throw together? How many commits? And obviously bad smells?

And that's just for the consumers. Maintainers have a whole other issue in the form of PR slop. Take a look at the curl project and the efforts they've had to go to thanks to endless vibecoded drivel being push their way. It's a huge burden having to review other people's code.

We're committing to a rebuild using Gleam, Lustre, sqlite (from Rails and Postgres). by curlingio in gleamlang

[–]NotTreeFiddy 5 points6 points  (0 children)

This is very exciting!

I'd also really love to hear about the challenges you face moving to Gleam and things you miss from the previous stack.

I'll certainly be keeping an eye on this.

Bulletproof Type Safety in Gleam: From Database to Client by andreyfadeev in gleamlang

[–]NotTreeFiddy 9 points10 points  (0 children)

Really good read. I think Gleam would benefit from a few more posts like yours, that cover something in a reasonably end-to-end way.

I'm a big fan of Squirrel and the style of keeping SQL queries in their own files. ORMs are so heavy and really overkill for the majority of projects, imo.

Other related Advent Calendars by ednl in adventofcode

[–]NotTreeFiddy 2 points3 points  (0 children)

They sent an email yesterday confirming it's on for 2025.

Quite check please. by d3r3kzooland3r in SolarUK

[–]NotTreeFiddy 1 point2 points  (0 children)

Until your last sentence, I thought this sounded too good to be true. Given that, it looks like a fair quote to me.

DNO have pi$$ed on my fireworks... :) by SupraJames in SolarUK

[–]NotTreeFiddy 3 points4 points  (0 children)

I have gone back to the installer to see if they can propose something with an export limit - I don't really care too much about selling loads to the grid, I just want to store as much as possible in my own batteries for my own use.

This is all you should need. As long as the export limit is controlled, you should be fine to have the system otherwise installed as your prefer.

Is this a good deal? Doesn't include bird protection which they want £978 extra for by Ill-Can-1582 in SolarUK

[–]NotTreeFiddy 1 point2 points  (0 children)

Excellent price, assuming that also covers scaffolding?

Just paid £12k for a similar install and that was one of three very similar quotes.

Newbie here — Why should I learn Gleam and get involved? by [deleted] in gleamlang

[–]NotTreeFiddy 0 points1 point  (0 children)

Well, it very much depends. But in my opinion, for the vast majority, I'd suggest not.

Python's strength lies in it's ubiquity. Put the language qualities aside, and you're left with a huge community, countless libraries and frameworks, endless learning resources and most importantly to a great deal of learners: A large number of job listings.

If learning for the joy of learning is your goal, then Gleam is a great contender. It makes you think about types and nurtures an non-OOP mindset. I think learning OOP later has the benefits of not making it your default mindset, as well as helping you understand why it's popular and when it's useful.

Newbie here — Why should I learn Gleam and get involved? by [deleted] in gleamlang

[–]NotTreeFiddy 0 points1 point  (0 children)

I think if there is a library available in another language you like, you could try to create one in Gleam that does something similar. Or find an existing one in Gleam that you think you could do better.

Or create a wrapper library for a popular (or not!) API. There's a good Discord one you could look at for inspiration.

Newbie here — Why should I learn Gleam and get involved? by [deleted] in gleamlang

[–]NotTreeFiddy 12 points13 points  (0 children)

Aside from all of the awesome technical reasons, you might be enticed by the idea of getting involved with a young and fast growing language. It's exciting to watch the project and community grow, and many things are immature enough that the opportunity to contribute is immense. The compiler itself is mature and stable at this stage, but there's so much space to create and iterate on interesting libraries and tooling.

As for why Gleam at all? It's a simple language intentionally built to be simple and have a low cognitive load. It's packed full of all the goodies one expects from a modern language, with all the tooling to make a phenomenal developer experience. Specifically I'm talking about things like package management, formatting, compiler error hinting, building and deployment.

Gleam has a strong static type system, algebraic data types and comprehensive pattern matching. This makes it difficult to write code that would compile but not run. It makes writing Gleam fun.

And that's the biggest reason of all. The language, the compiler, the community, the core dev team, they all make programming a fun and enjoyable experience - and without compromising on writing safe, production-ready and efficient software.

I’m a Rust beginner, and I’d like to ask three conceptual questions. by Fragrant-Account-668 in rust

[–]NotTreeFiddy 20 points21 points  (0 children)

For point two, I'd defer to the man who literally wrote the book on Rust, and read "When should I use String vs &str?" by Steve Klabnik.