2 ms·
I think anyone who uses Ruby regularly knows that `everything is an object` is the default, and that `Object` is the unstated parent for anything not specified.
by cortesoft 2y ago
I think anyone who uses Ruby regularly knows that `everything is an object` is the default, and that `Object` is the unstated parent for anything not specified. The rest falls from that.
- dragonwriter 2y ago> I think anyone who uses Ruby regularly knows that `everything is an object` is the defaul “Default” implies that it is implicitly the case if no alternative is explicitly selected, but such alternatives exist. In Ruby “everything is an object” (or, at least, “every callable method is in a class and can only be called in context of an object”) is more immutable truth than default. > and that `Object` is the unstated parent for anything not specified Actually, an anonymous top-level instance of Object is the default object to which things apply; Object itself is an Object (and more specifically a Class), but it is not the default object, it is the class of the default object.
- TZubiri 2y agoI hate those kinds of abstractions, ends up becoming as useless as it is all-encompassing. Take linux "everything is a file", yes, your word document and your sound device are files, also how do you increase the volume of your speakers, er.... it's a file and you can write to it! The usefulness of a system lies in the stances it takes, it takes guts to be opinionated. It's easier to create a system of stem cells that can be anything and can be configured to your needs, all you need to do is write a turing complete configuration file.
- KerrAvon 2y agoI don't think it's quite the same thing as "everything is a file". Unix files are typeless byte streams. Ruby objects have actual structure and type, and being able to do, for example, `49.times {print "this is a time!"}` because integers are objects doesn't add any friction to your life.
- TZubiri 2y agoObjects and files are different, yes. However one isn't inherently less abstract than the other. For example, while objects may have 'structure and type'. They don't have an inherent byte representation, so one could argue they are even more abstract.
- akira2501 2y ago> also how do you increase the volume of your speakers The mixer is a separate device. > it's a file and you can write to it! Which means you don't need any special software or tooling to use it. So you can automate actions with it using scripts in ways that any other desktop system won't do for you nearly as easily. > all you need to do is write a turing complete configuration file. Welcome to "general purpose" computing. Go back 50 years and see what the alternatives were. Or check out Plan 9 to see the file concept taken to a much better conclusion.