Hacker News new | past | comments | ask | show | jobs | submit | metadaemon's comments login

Makes sense, my perceived best professors were those that were enthusiastic about teaching and/or the subject


missing z/OS as well...


I'm a hypocrite because I'm now currently paying for Cody due to their integration with the new OpenAI o1-preview model. I find this model to be mind blowing and it's made me actually focus on the more mundane tasks that come with the job.


Not needing an ORM made me laugh


Orms in go make little to no sense. As soon as one has a little bit more complex scenario, one ends up in the raw sql string mode anyway…

Like, try to build dynamic nested ands with ors using jsonb with gorm. Maybe there are two people on this planet who would like “aha, I know”. Just use your standard sql strings with prepared statements.


Why is that?


Your programming language has objects. Your database has relational tables. By definition, you need to map between the two.

You can write your own or you can use someone else's. Those are the two choices.


By definition, you only need to do the minimum to move data from one process to another to get things read or written.

That doesn't mean you need an entire system to represent every table as an object-like thing (which is what I assume when people say ORM). It's actually possible to just emit queries to read and write the exact data that's required in the shape that makes sense for the caller.


> Your database has relational tables.

Mine doesn't, so I don't need an ORM. Plus, I think that when people say ORM, they mean more than just a map from the relational model to the object model and back. They refer to things like hibernate and SQLAlchemy and all the extra stuff that comes with that, like the active record antipattern, and a query builder which successfully encapsulates all trivial queries (which don't need encapsulation) but then as soon as you need to do anything even remotely complicated, the abstraction leaks. I'll be honest, not a fan of ORMs.


You can map objects to db updates, and map query results to objects. Neither of those objects needs to have a mapping to actual relations, like how ORMs insist on.


Query results are actual, if transitory, relations.

And db updates are either relations or tuples (and a tuple is a relation with cardinality of 1, so...)


You can be pedantic if you like, but this is obviously not what anyone means by "ORM".


Its literally the exact things that ORMs map between: query results -> objects and object changes -> database updates.


No, ORMs abstract away the relational database and present it as if it were some kind of object database. Needing to map query results to structs is just incidental, and is completely missing the point of an ORM.

If copying query results to a list of structs is enough to qualify as an ORM, then the term is so generic as to be entirely useless.


Only for basic objects.

The minute you add relationships your approach becomes unusable.

There is a reason ORMs have persisted for over 30 years.


No it doesn't. Why would relationships matter? You handle the relationships in SQL queries, and just copy query results to structs.


> copy query results to structs

Congratulations, you've invented an ORM.


This is clearly not what anyone means when they say they don't want an ORM.

An ORM library maps an entire relational database to a graph of objects, with the intention of abstracting away the relational database. Copying query results to structs doesn't actually do any of that.

https://en.m.wikipedia.org/wiki/Object%E2%80%93relational_ma...


Majority of ORMs really are nothing more than this.

But then it's nice to have something that generates optimised, database-specific SQL, can handle date/number conversion, supports many-many relationships, converting BLOB to binary streams etc.


That’s 1% of an ORM.


It's at least 30% of most ORMs. And if your homebrew ORM actually gets wide use, it'll grow from there.

Source: Wrote an ORM that other people actually use. Still adding features, twelve years later.


ORM by modern standard is not that, it's basically let me interact with the DB without knowing SQL.

Every language need to deserialize results into some object so by definition every language that deal with a DB do some form of ORM. So ORM is meaningless in that context.


There's a difference between mapping database tables to objects and just copying query results into structs.


I kind of agree with this. Data in a database is often relational (hey it might not be, but it's still nice to represent it in a struct sometimes, rather than 10–20 different variables which can change anytime your database changes).

I've been using Go recently, and while I'm not convinced on an active-record style ORM in Go (I don't think the language is dynamic enough, and I'm not the biggest fan of codegen), I've been loading the row data from Postgres into a Result struct (pretty much a 1:1 mapping of the Postgres result set into the struct), and then using another function to load the Result struct into struct with their relationships attached (using tags on the structs to define the relationships between them). This has worked great using reflections & generics.


And chance this is open source?

I’m building something similar and I can’t decide on the relationship struct tag syntax to use. Would be neat to see how others are thinking about it.


Why did it make me laugh? I thought the delivery was funny is all.


Sorry that's probably because I used the moving excuse very often when I was younger to get them to shut up.


Plus it's wild they staff an entire agency to handle these types of calls. Talk about a loser's mindset.


Conversely there is a gym in my town that was a month to month subscription with moments notice cancellation. They'd even pro-rate your remaining time back to you. I ended up joining and cancelling those gyms a lot through college years, but I'm much more willing to rejoin if it was easy to cancel.


Yeah Spotify removed one of my family members from my 5-person subscription (only using 3 slots) so I immediately cancelled my subscription and had to deal with a lot of manipulative tactics to not cancel. This kind of behaviour 1, shouldn't be legal and 2, shouldn't be rewarded. I have plenty of Spotify alternatives, so this kind of behavior ultimately signals a floundering company resorting to hacks.


Same with SSNIs, I get brain zaps if I don't take my medication early enough in the day. It can come with nausea too, so missing a dose can potentially ruin my evening.


Finding examples of how others implement similar logic is my biggest use case for code searching, but since GitHub copied SourceGraph, I don't have much of a need for these self-hosted solutions.


yeah, github has a nice search now, the only complaint is that you need to be logged on to use, besides this is really nice.


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: