This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-27
Channels
- # aleph (1)
- # announcements (39)
- # aws (11)
- # beginners (58)
- # calva (10)
- # cider (7)
- # clj-kondo (65)
- # cljs-dev (5)
- # clojure (90)
- # clojure-dev (48)
- # clojure-europe (23)
- # clojure-madison (1)
- # clojure-norway (1)
- # clojure-uk (40)
- # clojured (11)
- # clojurescript (20)
- # conjure (12)
- # core-async (4)
- # core-logic (4)
- # cursive (3)
- # datalevin (1)
- # emacs (7)
- # events (2)
- # fulcro (48)
- # introduce-yourself (2)
- # lsp (36)
- # malli (11)
- # missionary (1)
- # off-topic (1)
- # other-languages (72)
- # pathom (4)
- # polylith (13)
- # portal (94)
- # re-frame (14)
- # react (5)
- # releases (1)
- # sci (12)
- # shadow-cljs (29)
- # spacemacs (3)
- # vim (4)
- # xtdb (12)
There's so many ruby/rails job, I feel all the jobs are using that stack. I guess rails is truly the startup king.
As someone who never did Ruby or rails, how likely am I to like/hate it as someone who loves Clojure?
I did ruby/rails for a decade and I'm frankly a little scarred from it. I think I could go back now and it wouldn't be the worst. things have stabilized a lot since I left
I'm very opinionated about languages -- because I did my PhD on language design and I worked for compiler and tool vendors for years and did eight years on the C++ Standards Committee -- and I hate Ruby with a pink and purple passion. I took Washington U's "Programming Languages" MOOC online and was a community teaching assistant for several runs of it, and it showcases PL techniques using Racket (fine), SML (wonderful), and Ruby (ugh!)... and it really just cemented how much I detest Ruby.
This is so surprising to me! Mind giving some explanations for why you dislike Ruby so much?
@UEENNMX0T Part of it is purely subjective: I just don't like the syntax on a fairly visceral level -- a lot of Ruby reads like Perl to me, full of "punctuation" instead of words. In particular, stuff like @
, @@
, and $
to identify different scopes of variables, and =>
in hashes. My other big complaint is that you can't just look at a piece of code in isolation and know what it does -- because classes are mutable at runtime so even something like a + b
could mean anything and with 19 levels of precedence on top of that, readability and comprehensibility are compromised IMO. Then there's the "ten ways to do anything" aspect of it. Even the most basic tutorials tend to introduce anything from three to six ways to do almost everything, so there's no consistency of style in Ruby code because different devs will gravitate to different styles.
There's also stuff that Ruby gets right: everything is an object (like Smalltalk and very unlike Java). And. Um. Can't think of anything else it gets right 🙂
Haha that makes sense. I think it got a little more right than that but it's all a matter of opinion and you're right that some of the warts (mutable classes being the big one) are truly awful for understanding a chunk of code. Things I think Ruby gets right: Everything is an object, expression-oriented, lexical scope, massive standard library, and &block parameters.
Is it expression oriented? Are methods not allowed to return void? And if, else, while always return something?
I feel apart from the syntax, which I also for some reason dislike superficially. Your other criticism could apply to Clojure no? Many ways to do things, lots of punctuation in the syntax @ # { ( [ _ etc. And you can too monkey patch anything, could redef core functions if you wanted.
(I don't hate Ruby because I love Clojure -- I hate Ruby for a lot of other reasons tho')
I will say that I quite like Python (the 2.7/3.x split was why I've never really got into actually using it in earnest). I despise PHP for a lot of the same reasons I dislike Ruby. I've grown to dislike Scala, after using it in production for about 18 months. I quite like Groovy, and I really like Kotlin. But I strongly dislike Go. I hate JS. I love Elm. How's that for a varied set of likes and dislikes? 🙂
(and I also think Rails is horrific, for completely different reasons than my dislike of Ruby itself -- I don't like Grails either and I have encountered Rails clones in other tech that I've also heartily disliked)
These opinions are my own and are not endorsed by my employer or... anyone else 🙂
Ruby is a high level dynamic language that tries to be as friendly as it can to the programmer (partially by trying to look like English as much as it can) This leads it to have many repeated convenience functions and magical type conversions and idiosincracies that will start to hurt once you move away from the language and community conventions. The same applies to rails, but with even stronger effect. The entire community is mostly convention over configuration. Which leads to things being done quickly as long as they're within the 80% of cases they like to cover, which is why it's good for startups. (scalability of it has been improving tho) I worked professionally with it for a couple of years, and didn't suffer much at the time and ocasionally do contract work in it, but I don't think I could do longterm work on it without missing clojure too much
Convention over configuration just smells like “magical, implicit coupling” to me, which can lead to the most frustrating type of programmer work: blackbox debugging. Conventions are very good if they are data-driven and exposed and/or just about naming and directory structure without implicit assumptions from consuming code. I don’t have much ruby experience outside of scripting, but I assume it’s kind of similar or maybe worse to what we have in the PHP and JS world. That’s why I’m incredibly happy with the combination of deps.edn, polylith and integrant. It’s all just dumb, data-driven stuff - no cleverness. It’s very easy to move around stuff, have different setups and variations for development and production, inspect things and pull things out to interact with.
It is, yes, that's precisely a problem it has, and just like those languages you end up adjusting to them and end up with a sort of stockholm syndrome for the language. I'd argue that it's a bit more sane, because at least the language itself is fairly small. It does however have an amazing amount of useful and somewhat maintained documentation because everyone does the same stuff so runs into similar problems
This fundamentally comes down to what good abstractions are: clear assumptions, strong guarantees and simple relationships. If any of those things are broken, then you lose the ability to understand and extend things without making something that is inherently broken too. Except you try to build a sane layer on top of it while hoping they don’t pull the rug from under you. And this is not just__ me being snarky and grouchy. It’s years of pain and scars versus being happy, productive and confident. When the code I work with is sufficiently simple and clear, then I’m in a deeply relaxed and hyperfocused state, there is nothing I cannot do and I move with great confidence and curiosity. Discipline is then driven by a desire to care and create, instead of fear and frustration.
This is a bit off-piste: I'm having some trouble with PDP11 assembly, but I think it's a pretty generic problem, so I'm hoping someone can help...
The PDP11 stores 16bit "words" in 2 8bit (lo and hi byte) locations. Instructions can operate on a word, or in "byte mode", operating on a single byte.
There is one operation, COMB
which is the byte-mode version of the "One's Complement operation", which from what I can tell flips all the bits in a binary number.
As an illustration of this, it provides the example of COMB 200(R1)
on page 36/37 of the handbook, https://pdos.csail.mit.edu/6.828/2005/readings/pdp11-40.pdf. This uses the indexing addressing mode, but that's not relevant here. The crux is that it's performing COMB
on (octal) address 020177
. The word at location 020177|020176
contains (again, octal) 011|000
before the operation, and 166|000
after the operation.
The problem I'm having is that I can't figure out how they get to that. I think a lot of it is that I'm finding working in octal very tough. There are 3 possible options I can think of, but none of them work.
If I interpret 011|000
as two bytes with binary equivalent 00001001|00000000
, then one's complement of the hi-byte is 11110110
, or 366
in octal, which would suggest the output should be 366|000
.
If I interpret the word 011000
as a 16bit number, that's 0001 0010 0000 0000
, with ones complement 1110 1101 1111 1111
, or 166777
. That has the 166
from the answer in the handbook so is maybe partially right? But it seems to contract the "Byte Mode" flag.
If I decompose the word 011000
into hi and lo bytes I get 022|000
, and if I then do ones complement on the hi-byte, 355|000
. As a Word, that is 166400
. Again close, but no cigar.
I'm stumped, I'm either misunderstanding how octal works or how one's complement works.
in decimal its 9 + 128 = 137. convert to binary and do the complement = 01110110, in octal = 166
Interesting. That works, but it seems to contradict the description of that operation. My interpretation was that COMB 200(R1)
adds octal 200 to register 1 (017777) to get the address of the register to operate on (020177), but that the 200 doesn't affect the outcome of the operation itself. The description is
> The contents of a location which is determined by adding 200 to the contents of R1 are one's complemented (i.e. logically complemented)
Damn, I was hoping for reassurance that I'd like Ruby, but it sounds like I'd hate it too. I already don't like its syntax, cause I've never been into the VB like syntax of it's just English but spoken like a robot, and everything is enclosed in start and end words. Blocks seem neat, though I'm not sure of the point of it over a lambda. After that it does seem to just suffer from being a dynamic language that provides no redeeming qualities for correctness. Clojure at least has an interactive REPL, immutability, in-order dependencies, and static function arity checks to make it manageable.
someone here recently called it "ruthlessly productive" as a language and I'd agree with that. you can make a lot really quickly, especially database-driven websites. it starts to really suck due to a lot of ruby stuff not caring about backwards compatibility and for it getting unwieldy in very large apps. the primary framework that makes it so productive, rails, definitely has some design issues
I'm a bit of a dirtbag polyglot and like a lot of different languages for different reasons. I left ruby because of upgrade woes and dealing with complexity at scale sucked. but we managed to make transcoding-as-service that scaled to over 1k servers doing transcoding all using ruby
it's how I feel! a lot of people feel other languages are like dirty or gross or something and I'm just entirely unbothered
Yeah same. I love learning new languages and seeing how language design shapes my problem solving.
and also how other languages influence each other and different social contexts and maybe things I can bring back to the languages I work in
Learning new languages is definitely good for you! The Pragmatic Programmer suggests trying to learn a new one every year but I think that's a bit aggressive... I try to learn a new one every 18 months to 2 years even if I don't get much beyond the basic tutorials...
so it ain't all bad
it really depends on your sensibilities and what you're willing to be flexible about, what you're willing to put up with as trade-offs
I think I mentioned in here earlier that the community has really settled down quite a bit with the backwards incompatibility problems in recent years and the language has matured a bunch and there are even tools now to do static typing that help with overcoming some of the weaknesses
I think the "reads as english" is a pretty surface-level observation of the language and it really doesn't read as english in any real code. I don't know why people promote it that way
it finally got real parallelism recently, too, using something like actors
Ya, I could get over syntax, since that's just superficial. I hated lisp syntax the first time around as well. With Ruby's it's just I'm too lazy to type end when one character delimiter would do and visually looks like a delimiter as well 😝
I can say that I do really like websites that are using Rails, it's more the design of them, it tends to always be pretty good. I don't know if it's that Ruby attracts more people with design talent, or somehow Rails default templates all start you off with really nice layout and css or something haha
your editor can fill in the end
rails templates are erb which is really designer friendly
alongside automatic hot reloading you can do a lot of styling and html without knowing too much technical info
Haha that makes sense. I think it got a little more right than that but it's all a matter of opinion and you're right that some of the warts (mutable classes being the big one) are truly awful for understanding a chunk of code. Things I think Ruby gets right: Everything is an object, expression-oriented, lexical scope, massive standard library, and &block parameters.
I do a lot of frontend work and I am not a hiccup fan
but like anything there are trade offs ¯\(ツ)/¯
That's a good point. Hiccup is really programmer friendly, not so much designer friendly.
Let's say you use Rails, and you want to use Cassandra as your database? Are you kind of screwed because it's all defaulting to assuming a specific SQL DB for example?
you don't need to use their db library
you can use whatever you like
you can swap out templating libraries, too
serializing to and from xml and json is trivial, they're built into the framework and the language
same with yaml and csv
the trickier parts come from if there is a library for the db you want to use that's available for ruby
oh and their db library supports a number of different sql databases
anyways, a lot of these things are worth trying. laravel in php-land is pretty nice too
Laravel is great and php is a good language now. It’s wild
the worst outcome is you don't like it but know a bit more about it, which is pretty decent considering
The job market is moving towards JS, Ruby more and more it seems. So I might need to get familiar with them.
python is huge, too
I mean so are java and dotnet and C
but the more startup-y jobs definitely seem to favor the scripting languages
I don't see as much Python that's not data-science/ml related though. So anything that's likes PaaS, SaaS, webapps, apps, fintech, backend, seems to not be in Python.
And the enterprisy stuff like C#, Java, Go, Rust, etc., they tend to not offer the more competitive benefits of like 4 day work week, or 20h weeks, etc. That's what got me asking about Ruby haha. Was looking at http://4dayweek.io and it was all Ruby or JS
Maybe Clojure startups should set a new trend. I want full time 5 days a week, 8h days, but only 6 months a year 😛 Pay me 50% with full health care benefits. Get another person to do the other half of the year in alternation, same role, same position. The business doesn't even lose out anything, they end up paying the same amount (a bit more for full health care I guess), and they still have someone full time all year.