News for hackers. Stuff that matters.
Re:How to be a -10x Engineer by eecc on Tuesday April 04, 2023 @11:59AM (#35441715)
Heh, I was once walked through a live “code review” where all my code that used Java steam maps were replaced by this one dude with for loops in private methods. What a dress-down… pff, the project was canned a few months after I left. But I’m a consultant, no long term investments
Re:How to be a -10x Engineer by whstl on Tuesday April 04, 2023 @07:25PM (#35447198)
Man, I got a story not with Streams but with its C# cousin, LINQ. A long time ago I've seen a senior engineer totally lambasting a junior because the junior used a LINQ ORM.

He saw DB.Users.Where(a => a.Id == 1) on the screen and launched a tirade of "Are you retarded? You're downloading the whole Users table when you do that!"

It was fun watching our boss explain how LINQ worked and seeing the shame in the engineer's face.

Re:How to be a -10x Engineer by myko on Friday April 07, 2023 @07:38PM (#35488588)
I've never really worked with C# before but I assume that query is about as efficient as a similar SQL statement?
Re:How to be a -10x Engineer by whstl on Saturday April 08, 2023 @09:35PM (#35499314)
Exactly.

LINQ allows you to use the same syntax for both local arrays and in an ORM, or any data source really, if you implement its IQueryable interface. You implementation can "parse" the AST and generate an SQL query, like a regular ORM.