by tjstankus · 3y ago · 0 comments
I'm psyched for this feature. As someone who has worked primarily with Ruby and Elixir, I really appreciate the design and safety affordances of immutable data. I'm glad there's a bit more immutability in Ruby and that, in general, the language keeps progressing. Thank you Ruby language devs.
Measure = Data.define(:amount, :unit) do
def initialize(amount:, unit: '-none-') = super
endI'd rather see incremental additions to this minimal Data API than trying to do too much at once. Lots of love for the Ruby dev team but they don't always have the clearest idea of what problems their users are trying to solve.
I've worked with Ruby for nearly ten years and have been hearing some variation of "Ruby is dying" since forever.
Ruby is a flawed language (I especially dislike the lack of real namespaces) but the hate it gets is often not based in reality.
That said the serious reason I don't try it out is because I fear it would be like Python, and I don't need two Pythons in my life. If Ruby had been dominant I'd likely be using Ruby and thinking the same of Python.
a particular era of hipster web and app
development, ~2007-2010. I don't know why
but it's not quite attractive.
That was a really fun era.~1997-2007 was fun but it was a mess. It seemed like every project was its own bespoke "framework" and everything was a Java or PHP spaghetti monstrosity.
2007-2014 was the era when "majestic monolith" MVC frameworks with a strong emphasis on automated tests really began to coalesce. Rails led the way here, I think. It was a brief island of sanity if you ask me. MVC may not be perfect but it's a fine choice most of the time for anything CRUD.
I suppose there was kind of a "hipster" aesthetic around Ruby/Rails (Ruby devs kind of prided themselves on being quirky or whatever, as opposed to staid corporate Java drones, I guess?) but I did not find it to really be a factor.
2015-present has been a nightmare. Nearly every web application is now two apps: front and back-end. For apps with highly interactive UIs this is an obvious win but for the vast majority of web applications it has been a disaster. User-facing performance of the modern web is awful and I have never felt less productive as a developer. Every developer thinks they need to do things "like Amazon" or "like Facebook" and just.... no. The Javascript community has absolutely lost all connection with sanity and the era of the full-stack developer is over.
First of all, regardless of what everyone says regarding how "inovative" Rails was, Tcl and Python did it first, with AOLServer and Zope.
During the .com wave, I was part of a startup with a product for CMS development, that was basically inspired from AOLServer, although we did our own thing.
It supported Windows 2000/NT, Aix, HP-UX, Solaris, Linux (only for dev purposes), SQL Server (Sybase and Microsft variants), Informix, Oracle, Access (only as demo concept), and we were in the process of adding DB 2 support as well.
We went down in the .com crash, and Lisbon isn't SV, so hardly anyone heard of us, but it doesn't change the fact we were already better than Rails v1.0 in 1999.
Second, I know Python since version 1.6, so Ruby hardly brings anything other to the party than a Smalltalk inspired workflow, without the IDE experience.
It's like when a game/band/tv show becomes popular, the more popular the more toxic the community becomes, and the louder the hate seems to be. I don't want to pull names out of hats, but pick any of the most used languages and you'll be able to find people banging on about objectively bad parts of the language, and yet they're still the most popular languages.
Admittedly, I don't really prefer Ruby over other languages, but just like PHP I wish people would stop being so dramatic over it. It's plenty good enough to get shit done, if someone likes working with it power to them.
Let’s make a very simple naive test using Google search, "I love Ruby" matches 98,400 results, while "I hate Ruby" returns 7,740 results (from my current terminal).
There is even a book named "I love Ruby" it seems.[1] Compare that to the existence of "The UNIX-HATERS Handbook".[2]
Can you be more precise about what features you miss in Ruby modules compared to "real namespaces"?
[1] https://i-love-ruby.gitlab.io/ [2] https://en.wikipedia.org/wiki/The_UNIX-HATERS_Handbook
Vaguely similar in performance to Python and PHP (not an order of magnitude off), slower than Java and .NET (for typical web based workloads with mainstream frameworks, .e.g Rails vs Django vs Laravel vs Spring Boot vs ASP.NET), still good enough for most web projects out there.
Even Rails just seems like your average flagship framework, if not an entire platform - certainly on the heavy side, with its own quirks and opinions, but definitely a safe option for getting things done.
It's jarring to see Ruby's popularity be on the decline, though you could also say the same about PHP in many cases.
And there aren't many good Ruby developers. There are too many noobs who write Ruby code that make my eyes bleed. I know, because I have to see this at work and they're supposedly "rockstar" developers. Ha! I swear most so-called "engineers": 0. don't grok software engineering, 1. weren't formally-trained in software engineering AND computer science, and 2. happily push shitty code that there will be no incentive to refactor through automated means.
If you want to enforce coding standards in Ruby, you better learn LISP / S-expressions, because that's what Rubocop uses.
Ruby, having at least million users around the world, is in immortal category.
What fascinated me in the original post is "...data model on the principles of the Value Object, introduced by Martin Fowler."
I mentioned Haskell because there is a long, long history of the use of immutable objects in computing science, dating back to Church and Turing's communication. The immutability is what differentiates lambda calculus and Turing machine.
That is why I remembered Haskell and the video above.
Yet, it is "introduced by Martin Fowler," for some reasons.
This is very sad.
Or do people think that before Java we didn't have any architecture astronauts on large corporations?!?
This is maybe going to sound snarky, but honestly I really am being serious: at this point, what else do you expect from this website? HN has a well-earned reputation of being a bunch of kneejerk-critics and naysayers.
For better or worse HN is my community. Its given me so much over the years, even as it's infuriated me much of the time. As I recognize patterns of dysfunction I highlight them, so that the community can understand & overcome them.
And I do think I see incremental progress. Not to say I caused that progress, I have no idea what if any role I played from my modest soap box (I suspect very little), but I think there's every reason to hope for the better.
Yes, there are critics who are not ‘in the arena’, but for the rest I see a lot of care (AKA taste as defined in Ira Glass’ words on “The Gap”) put in to the comments.
I have had/seen this conversation over and over again on HN:
Commenter: This topic sucks, I wish people would stop posting it to HN.
Me: I understand this topic isn't interesting to you. Why don't you ignore it and click on something else?
Commenter: I care so deeply for this community, I hate to see this topic reduce it's SNR.
Does the commenter care about HN? Presumably. Does that make their complaint legitimate? No. They're bothered by how a subset of people on the site want to discuss some topic, and they're manufacturing a reason that sounds better than, "I don't want to see it."
But no one is entitled to have articles that are to their taste posted to HN. Sometimes this is expressed more like, "this isn't appropriate for the HN audience." But the audience of an HN post isn't what anyone imagines HN looks like, it's the subset of HN members who find that post in particular to be interesting and worthy of discussion.
I speak from a good deal of experience with this. Active listening was a good crutch for me in a lot of ways, but it works very poorly with people more and more often these days (especially online) and by the time you reach texting and forum posting, you basically just have to read walls of text before you can respond.
I hate to say it but sometimes I just need to interrupt you! Same goes the other way. Please, PLEASE, chime in with some reverb or retaliation. (Hell, maybe one day I'll earn a slap on the back ;)
Then you have the next problem. It spirals... like a positive feedback loop. You find yourself in a thrilling conversation/argument with someone only to have completely alienated the rest of the room. Now what? Is anyone else even paying attention? Would they have liked to, but you both just flew past them and dove straight into your threads?
I think this stuff is insanely hard in the real world sometimes, and only harder online. I like HN partially just because I feel like a lot of people here kinda get that.
P.S. I'm also the kind of person who types really long emails, then spends a while trying to edit them down. Sometimes I just don't have the energy. Sorry for the hypocrisy.
If I just need a bundle of attributes and don't care about immutability then I will continue to use Struct.
If I do need immutability I will continue to use dry-struct (https://dry-rb.org/gems/dry-struct/1.0/) which has much deeper guarantees of immutability and type enforcement.
You should not worry about what top-level comments are.
Regarding this feature, it's cool but I'm surprised they introduced a new concept just to add immutable structs.
ES6 suffers from this disease to a fairly extreme degree, and you can see this schism in the JS community back to the semicolon war in the early 2000s. Kotlin as well, unfortunately, as it's otherwise generally a really nice language.
There are so many language structures and shortcuts. And unless you spend a large amount of time becoming truly fluent in all of them, you're never going to be able to read all the "clever" code that uses them.
These structures are not common across languages, either, so if you jump between codebases in multiple languages... good luck.
tl;dr: Readability über alles.
The amount of time I have lost because of some piece of code (a block) that gets executed somewhere else and I have no clue how that works is insane. And every time I need to go and dig in the implementation details to identify the params passed in because there is no enforcement at write time. I want my types!!! Why would you voluntarily write code where you throw out the types. The thing that is most useful...