Ya know the more I reflect on the languages I know the more I realize that outside of functional languages none of them really handle immutability well.
Consider that you want most of your objects to be immutable most of the time. Thats all well and good till you realize you want to be able to edit the objects in such a way that it creates duplicates that have some data changed but are likewise immutable.
This tends to stop working, almost entierly, once you get into subclassing. If you parent class has a method that returns a copy of itself with some data modified, this will break in children classes, since you want children classes to return instances of itself, not its parent.
Its not that you cant fix that, but the code gets very ugly very quickly. Generally you are forced to let the code handling the classes do the copying and editing itself, but that is pretty ugly too.
I have had this pattern problem in almost every OO language i messed with, Java, Ruby, Python, etc.
I've been #programming for 14 years now, have been using #PHP, #JavaScript, #ColdFusion, #Ruby, and whatnot, but holy cow, when reading the following chapter, I've literally been yelling "what the heck" at every second paragraph:
I mean, #PonyLang really tries to explain everything in depth, and I appreciate the effort, but while it works fine in earlier chapters, it confuses the heck out of me in this at length.
Late into the night before #BrightonRuby, some of us discussed DHH and his leadership of #Rails. @ufuk did a fantastic job moderating the conversation and highlighted that the Rails team is more than one person.
At the conference, there was plenty of food for thought. Something from @nickschwaderer’s talk stuck with me. It was the idea of “no dunking”.
I will now raise the likes of @eileencodes instead of putting others done.
#ruby geeks do any of you know of a built in Ruby or Rails mechanism that will convert "foo/bar/baz.txt" to ["foo", "bar" , "baz.txt"]
Basically i'm looking for the opposite of Rails.root.join("foo", "bar", "baz.txt")
something that'll work in an OS agnostic way to give me the path as an array of elements.
And yes, i know i can just path.split("/") It just feels weird that we seem to have an OS agnostic way to MAKE paths from elements but not UNmake them.
I made another open source thing: BadPigeon 🐦 - a tool that lets you export tweets from #Twitter without access to the API, by parsing JSON responses exported from a browser. Intended to be a drop-in replacement for Tweet class from the twitter gem: https://github.com/mackuba/bad_pigeon #Ruby#OpenSource#TwitterAPI
Recently watched this video by #ThePrimeTime on #Youtube, and his hot-take 🔥 was that they were using #Ruby, and half of their pain was caused by this.
I have no experience with Ruby at all and most probably won't even recognize it if I were to read it.
If Ruby is such a bottleneck and inefficient, why did #Mastodon :mastodon: use Ruby for its implementation?
I know Ruby is often praised for servers and backends, especially APIs, but we have many solutions for this in #Python :python: , which I wouldn't recommend, but #Go :golang: and #Rust.
Does anyone have opinions or sources for this statement?
I've done some basic reading on the current behavior and browsed the codebase a bit, but I'm a backend dev with minimal experience with #Ruby or #JavaScript so I got a bit lost.
If you have relevant experience, would you like to spend some time over a video call or similar hacking on this?
These are the two lines of code (minus some constants and file operations) that saved me a while lot of tediousness, today... #ruby#regex#programming#Jenkins
It ended up being a bit more involved than my post earlier, but was able to script it to automate the patching and PRs. It looks terrible, but I'm pretty happy with the end result.
Another day, another native #Ruby gem that won't compile. I understand that there are some cases where you need to deal with external stuff via C, BUT so often native gems seem to be created because their devs felt that doing it in pure ruby provide performance that was too slow.
Ruby isn't a "high performance" language. If you want fast use C(++) or Rust or Go or any of the many "fast" options. Alternately, use your C skills to improve Ruby.
Current status: I opened about 100 links to articles and threads from Google results comparing #ruby, #golang and #rustlang and I'm planning to read them 🫠
(no, I'm not really considering Go, mostly just trying to convince myself that I'm not making a mistake starting to learn Rust and not Go 🦀😛)
Is there anyone using other languages than C# and F# on .NET ?
I remember back then there was the #boo language but looks like it's not much used now.
Other alternative languages like #ironpython and #ironruby are either lagging a lot on supported version or abandoned apparently.
#RuinAFilm but programming language names:
Ghost in the #Haskell #Perl Is For Heros
In The Name Of The #Java
Schindler's #Lisp
Star Wars: The #FORTH Awakens
Manchester By the #C
The Truman #Go
Bringing Up #Ruby
Anyone get any other good ideas? #Puns#Joke
I created an account on botsin.space to showcase a framework I made, also called JokeBot, for posting #jokes on the fediverse; I originally posted jokes on my current account, but it was posting a bit too "loudly." Hence, that's why @JokeBot is here.
@JokeBot is currently fully operational; I already boosted its first post, and I will continue to boost its posts for my existing followers to see them.
Mastodon fetching all replies to a post you're viewing would hugely improve user experience on small and one-person instances. If you know a bit about Ruby and/or Mastodon, please spend a moment reviewing this work in progress:
Huh, the #Ruby docs for OpenSSL::HMAC.hexdigest doesn't specify what the format of the key parameter is, appears to just be a string, but doesn't explain how it's used?
I've been playing with benchmarking some regexp matching code in several languages last week (I want to replace that part of #Ruby code with something faster - I was thinking of Crystal or Swift). ChatGPT helped me write some versions :)
The results were… unexpected. #swiftlang & Crystal didn't do well, but JS & PHP did 🤔