7 ms·
As a dyed-in-the-wool Rubyist, I consider Ruby the pinnacle of high-level, abstracted, expressive programming for the contexts I care about (small web applicati
by jaredcwhite 4y ago
As a dyed-in-the-wool Rubyist, I consider Ruby the pinnacle of high-level, abstracted, expressive programming for the contexts I care about (small web applications largely written by solo devs).
What's sad to me is that the modern follow-up to Ruby seemingly doesn't exist. Every hot "language du jour" which has come after Ruby has gone BACKWARDS. Lower-level, more systems programming oriented. Maybe even compiled. Static typing everywhere. It's utterly baffling to me.
"Why are you using Ruby? You should use…Rust! (Go! Zig! Fill-in-the-blank nerd hype!)"
Lol.
What I actually want is a new programming language/environment which makes Ruby look like programming pointer arithmetic in C by comparison. Something so advanced, so high level, that much of the time you're really just describing patterns and flows and data models and extensions, and then letting the computer determine the most efficient way to develop those code paths and execute them.
Unfortunately, I'm a bit cynical on this front. I believe the reason this doesn't exist is because it's at cross-purposes with programmer nerd culture. Many programmers enjoy the nitty-gritty of low-level coding. They fear abstraction. They fear "magic". They fear things like "implicit imports" or "duck typing" or "many ways to express the same method/function/algorithm" etc. because it's all nebulous and fuzzy compared to the safe confines of deterministic math & logic. "If I declare that this variable MUST BE AN INTEGER, then it MUST BE AN INTEGER. The idea you could pass me a string instead? UNACCEPTABLE !!!#%@!"
In other words, I don't have high hopes that great UX for forward-looking developers will come from present-day programming culture. For a quantum leap in DX, we probably need people who aren't die-hard programmers to engage in blue sky thinking. We need to talk to artists, philosophers, linguists, psychologists, and other experts in social & historical cultural dynamics. They can provide the insight we lack. Because for every "this is an integer, damnit!" type out there, there are probably many, many more who would see 123 and "123" and think THAT'S THE SAME THING. :-D
- BlargMcLarg 4y agoPretty sure I speak for a majority of experienced devs when I say: we don't fear abstractions. We fear abstractions made by others, including our former selves, in the all to often occurring context of "business wants it done by yesterday and we have zero idea what the requirements actually are". All the while we're still figuring things out and having 30 minute discussions on the most miniscule things.
- commandlinefan 4y agoI think you're all being too charitable to OP: "Programming would be easy if it weren't for stuck-up snobby programmers gatekeeping it" is up there with "math would be easy if it didn't have all this notation stuff" or "music would be simple if they didn't insist on writing it on those staves with those circles".
- amadeuspagel 4y ago> "music would be simple if they didn't insist on writing it on those staves with those circles" Yeah. Staves with circles are something optimized for pens, and almost every modern music software uses simpler notation. Does that make music simple? Not quite, but it certainly makes it more accessible.
- jaredcwhite 4y agoIMHO math notation is ugly AF, and music notation was something I hated so much as a teen I almost abandoned my budding professional music career because of it. (Thankfully I found a great niche in early European folk music.) So basically you're right. ;-P
- Tao3300 4y ago> we don't fear abstractions. We fear abstractions made by others, including our former selves that's all the abstractions :-\
- heurisko 4y ago> Static typing everywhere. I think the industry has generally recognised that static typing makes more reliable software. I started with PHP and have seen its type system evolve. Similarly Typescript. I since moved to other staticly typed languages. I wouldn't want to go back.
- jaredcwhite 4y agoDepends on the context. When you're programming a transactional banking system? Heck yeah I want static types. When you're programming a form on a web page? It's way-ay-ay more effort for dubious gains, with new downsides added into the mix.
- simplify 4y agoI would LOVE static typing when programming a form on a web page. However, it's the fault of HTML that this is bad, not static typing itself. Although, in theory, one could write a parser to inject what form elements are available into the type system... :)
- deleted 4y ago[deleted]
- heurisko 4y ago> When you're programming a form on a web page? It's way-ay-ay more effort for dubious gains, with new downsides added into the mix. If you don't mean just HTML but some server side processing, yes, I would. This is still PHP's bread and butter and being able to bind a form to static types is really convenient.
- choeger 4y ago> It's way-ay-ay more effort Just because you tend to ignore the many complexities that are actually involved in a form on a web page. It's exactly this bias that stems from untyped languages and that needs to die. Http is a complex beast and we should either replace it with something more simple and robust or at least acknowledge the complexity in our programming. Generally speaking, if doing something with a proof of type-safety feels complex, you probably ignored many corner cases before.
- disantlor 4y agoI dont fear magic as much as magic* where the * is all the exceptions that had to be hacked into the magic to make it work on the slightly different use case than what the magician dreamt up
- pramodbiligiri 4y agoHave you tried any of the Low-Code/No-Code tools of the recent years? Do you feel they are a big leg up from Ruby when it comes to small webapps done by solo developers?
- jaredcwhite 4y agoI can't say that I have specifically tried any, but I feel like if someone had come out with a new "the Rails for X" where X is a programming language even more abstracted than Ruby, I would have heard about it.
- j_crick 4y ago> patterns and flows and data models and extensions Might I suggest that you could probably try some Clojure and see how it goes.
- jaredcwhite 4y agoI'm sure Clojure is very exciting for Clojure fans…but afraid it's utterly inscrutable and unreadable to me.
- j_crick 4y agoCan definitely understand that. I’m a big fan of Ruby myself and I use it quite often, and for sure at first readability of a lisp syntax seemed like a problem. I will just note that at some point I’ve realised that while Clojure can seem to be quite freeform, in fact it has very strict structure, which helps a lot. I suppose that if somewhen you could get into it, you would find a rich toolbox with a lot of heavy lifting done under the hood and a lot of space left for you to think about application design first and foremost, with a fair performance.
- samiskin 4y agoThis all makes sense given "for the contexts I care about (small web applications largely written by solo devs)". Unfortunately for you most software (and therefore what most developers work with) isn't for those contexts, but rather for larger projects written by multiple devs, where being lower level and compiled (runtime speed) and having static typing (more explicit and easily understood by other devs) become much more valued. You'll probably always be in the minority with your preferences because of this.
- jaredcwhite 4y agoI love being in the minority with my preferences…have for most of my life.
- correlator 4y agoRuby was also the first thought in my mind reading this article.
- WJW 4y agoThe main problem with more and more abstract forms of describing "what you want" instead of "what the computer should do" is that the program still needs to run on a computer, and those are inherently non-abstract. There is no duck typing on the CPU level and figuring out what exactly you passed as an argument takes up a lot of time. Don't get me wrong, I love me some Ruby and it makes up the majority of my income. But it would be foolish to ignore that it is indeed 100x slower (or more sometimes!) than some of the modern compiled languages. Small to medium web applications are exactly the sweet spot for Ruby because network latency hides a lot of the language slowness. Nobody cares about 20 extra milliseconds for a request to a server 100 ms away, but a lot of people care about 20 milliseconds delay in frame rendering. EDIT: The following: > What I actually want is a new programming language/environment which makes Ruby look like programming pointer arithmetic in C by comparison. Something so advanced, so high level, that much of the time you're really just describing patterns and flows and data models and extensions, and then letting the computer determine the most efficient way to develop those code paths and execute them. sounds exactly how I feel when programming in Haskell, although that particular language will probably not sit well with you if you absolutely want duck typing.
- commandlinefan 4y ago> describing "what you want" instead of "what the computer should do" Actually, static typing is describing "what you want" and leaving it up the compiler to make sure you were consistent.
- samatman 4y agoProlog, and SQLite dialect of SQL, are both declarative and dynamically typed. Static typing is neither necessary nor sufficient here, the gradient from declarative to imperative is largely orthogonal.
- ransom1538 4y agoAgreed. Worse for me was starting with VB6 as a kid. A nice IDE, amazing debugging, easy visual components. Entering the professional field using php seemed like a strange nightmare. It was like taking a time machine into the past.
- SanderNL 4y agoI get your and the article's drift, but saying it won't come to pass because of grumpy programmers is IMO a bit unfair. I believe it'll come to pass, but it'll take a while because there's not a huge need for it right now. I believe the whole computing ecosystem is very shallow at the moment. There are lots of tools and lots of programming languages, but they are all shockingly similar. There is just too much monoculture going on. We used to have APL, Lisp, Prolog. Weird stuff. Weird OSes. We need more of that weird stuff again. But there has to be some economic incentive for that to happen and I'm not seeing it at the moment. Stuff like Smalltalk or even something like Symbolics' machines would be a better fit for people needing a more high-level approach to computing. These tools see very little if any real funding/action and my hunch is that this will change in the future. Not now, but someday. When indeed perhaps the philosophers, artists and psychologists of this world need to do some programming. I'm not a big fan of these kinds of systems, because I am one of those grumpy bastards that don't agree with "123" == 123 but I do see how these paradigms can fit other types of people more readily. To be honest, I don't think we've even scratched the surface of what is possible. Edit: OK I can't resist. "012" == ? This is making me lose sleep. These things are NOT the same. There, I said it.
- pmichaud 4y agoRe: your edit, I think the real answer is that the correct translation is fully context dependent, and the people who want it strict want to basically force/precompute the context, vs the people who want it loose want the context itself to smartly decide what the string means to itself. The problem is that modern paradigms are squishy about this, and aren’t smart enough to consistently do the right thing, so real systems end up both too strict and brittle for the real world domain but also too loose and ambiguous to be bug free.
- wvenable 4y agoA monoculture is a sign of maturity. In the past, most programming languages were awful in one way or another. Whether it was C, Fortran, APL, Prolog, COBOL, Basic, etc -- all uniquely terrible. But now every programming language is pretty decent.
- OkayPhysicist 4y agoI agree with you that "Re-write your Ruby project in Rust" is a terrible suggestion. Pretty much only "Re-write your C++ project in Rust" makes any sense. But it's not all bad. Elixir is pretty widely considered to be the Ruby successor. Types are replaced almost everywhere by pattern matching, the widely accepted unexpected behavior response is to just not handle it, crash the "process" (green thread) and continue on with life, integers don't overflow, and the macro system is powerful enough to do just about anything you want.
- yifanl 4y ago> Elixir is pretty widely considered to be the Ruby successor. Really? That feels really odd, once you get past the surface level syntax, Elixir doesn't really resemble Ruby to me, unless you've conditioned yourself to write purely functional Ruby?
- Tao3300 4y agoHere I thought it was a gateway drug into Erlang
- yifanl 4y agoYou can certainly treat it as a nicer interface into the BEAM VM, but it's certainly possible to never write a line of Erlang while being an amateur Elixir developer. Though I'll have to defer to others if its also possible as a professional.
- Mikeb85 4y ago> Elixir is pretty widely considered to be the Ruby successor Ummm what? Elixir is just a friendlier Erlang. It in no way replaces anything Ruby does...
- cutler 4y agoJust because Ruby acolytes Dave Thomas, Jose Valim and Chris McCord championed Elixir that doesn't make it Ruby's successor. The languages are poles apart beneath the surface syntax. Crystal has more of a genuine claim. I also think Kotlin is a relevant language for re-writing a Ruby codebase.
- davewritescode 4y agoI love Ruby, I'm not a dyed in the wool Rubyist but I've been involved with some fairly large projects that were written in Ruby and in my experience writing Ruby code can feel somewhat magical and empowering because of how fast you can get ideas down. As much as I love Ruby the meta-programming and the type system can make refactoring a complete nightmare and as projects grow larger they tend to become a really big mess.
- zasdffaa 4y ago> What I actually want is a ... and then letting the computer determine the most efficient way to develop those code paths and execute them Give us something actionable and not handwavy dreaming and you might get it.
- shpongled 4y agoI personally find strong static typing (a la Rust, Haskell, Standard ML) to be much more expressive and with better UX/DX by miles.
- throaway2323221 4y agoEx-RoR dev here. I'm not seeing any evidence of Ruby being valuable outside of rails. If I wanted magic I can just use a lisp such as clojure.
- pharmakom 4y agoHave you tried Clojure?
- insane_dreamer 4y agounfortunately I don't use it at work but Ruby is still by favorite language, by far; it suffers from a lack of solid math/sci libraries like Python has
- cannabis_sam 4y ago>Static typing everywhere. It's utterly baffling to me. I find it far more baffling that people don’t want to offload the trivial parts of the mental work of ensuring the programs they write makes the minimum of sense. I also jumped on the dynamically typed bandwagon after using low value type systems like java’s, but after using haskell, ocaml, typescript, purescript, rust, and especially elm, I realized that they let me focus on the business value over the incidental complexity from having any value potentially being anything… (Even Agda and Idris have been amazing revelations in this context, but at that point the type theory does start to consume more time than necessary for ordinary development)
- fuzzy2 4y agoI also like statically typed everything. But I have to admit, some of the more adventurous stuff people do with JavaScript (that just works because it is dynamically typed) is pretty ergonomic. Even with TypeScript it is often next to impossible to make it strongly typed. I guess Ruby or even Ruby on Rails is very similar, with the ability to monkey-patch just about everything. Some things are just better (left) dynamically typed.
- zestyping 4y agoOh really? Suppose x = 123 and x = "123" were "THE SAME THING". What's x + "42"? What's x + "042"? What's x + "a"? What's x + "e2"? What's x + "e2" + 12345? What's x + "1,500"? What's 1 / x?
- wvenable 4y agoTo be fair, that's more weak vs. strong and not static vs. dynamic. You can have a dynamic typed language where all these are cough runtime errors.
- nyanpasu64 4y agoIf 123 and "123" were the same thing, then 123 + 123 must be equivalent to "123" + "123", and 123 + "123" cannot be made a runtime error. And I do think PHP (the poster child for weak typing, second to Bash) uses a separate . operator for string concatenation (rather than +), and relies on I think -> for object field access.
- LionTamer 4y agoDo you think that perhaps functional programming can be a happy compromise between high level abstractions / declarative code style and strong math / logic foundations? My programming experience is largely in Python and Java and so I can relate to both sides you present - I feel constrained by the aggressive static typing of Java but also feel that Python can be a bit too fast and loose with typing and I often find that dealing with unexpected behaviors takes as much time as it would to just have them written formerly and properly into the code to begin with through a strong type system.
- eximius 4y ago> for the contexts I care about (small web applications largely written by solo devs). found your source of disagreement. this is, generally, not the domain anyone writing languages cares about. no one writes a language for an individual.
- 082349872349872 4y agoDennis Ritchie wrote C for himself.
- jaredcwhite 4y ago> Instead of emphasizing the what, I want to emphasize the how part: how we feel while programming. That's Ruby's main difference from other language designs. I emphasize the feeling, in particular, how I feel using Ruby. I didn't work hard to make Ruby perfect for everyone, because you feel differently from me. No language can be perfect for everyone. I tried to make Ruby perfect for me, but maybe it's not perfect for you. The perfect language for Guido van Rossum is probably Python. –Yukihiro Matsumoto, creator of Ruby https://www.artima.com/articles/the-philosophy-of-ruby https://www.artima.com/articles/the-philosophy-of-ruby
- 082349872349872 4y agoLooking at the differences between Python and ABC (its predecessor), I would agree Mats' last sentence is entirely plausible.
- openfuture 4y agoObligatory "elixir+phoenix is supposed to inherit ruby on rails" remark
- lejoko 4y agoRails + Phoenix dev here who loves both. Elixir is far from having the conciseness of Ruby and Phoenix is super far from having the tooling of Rails (and Rails from having the tooling of Beam and OTP). From my point of view they are two very different beasts, each one being great in its own domain. The similarities are mostly syntactic and superficial.
- commandlinefan 4y ago> the reason this doesn't exist is because it's at cross-purposes with programmer nerd culture If that was the reason programming is "hard", we wouldn't ever have gotten COBOL, Basic, PHP, SalesForce, Windows, UML or any drag-and-drop query tool.
- mcdonje 4y agoSounds like you want more declarative languages, like SQL. The magic to get those to work well is a lot easier to implement and optimize if the problem space is restricted. So, DSLs.
- bjourne 4y agoI totally agree. When given the chance, (and if the goal is productivity) I always use Python because it is the most high-level and most productive language and ecosystem out there. I learned it almost 20 years ago and it was apparent after only spending a night or two with it that it was massively more powerful than Java, C and C++ which were the languages I knew at the time. Since then I have not discovered anything that was a similar improvement as Python was over Java. Concatenative programming comes close but suffers from small ecosystem and there are issues with the syntax. Automatic memory management became mainstream in the 90's and dynamic typing in the 2000's. But what did the 2010's give us? Github and Stackoverflow? I think we are due for another "programmer productivity" revolution but I have no idea what it will be. Statically typed programming languages that are marginal improvements on existing dominant languages for sure aren't it.
- politician 4y agoComplaints about static typing boil down to not wanting to be responsible for the schema and data architecture of the program itself, and that desire to remove responsibility for designing the scheme is where ORMs like ActiveRecord find a foothold. Unfortunately for folks and languages with this mindset, if they need to have good performance, eventually they will need to take responsibility for the data model of their database and their codebase. Code is data, and types are schema.
- lcall 4y agoWhat I would like, as a step forward at least, is something that fills your ruby (or python) niche, but based on Rust, and when in doubt thinks like rust, so that one can migrate from it to full Rust, with a minimum of re-learning. Same libraries, making them as good as Rails and as easy as Ruby in general, garbage collection, etc. But when you flip a switch (or incrementally, in 2-4 levels?) the full compiler checks kick on, garbage collection is off by default, and it lets you specify the details that give rust-like performance, features, and, of course, ease of distribution (a single, smaller binary). With no re-learning of a whole new language -- taken in steps, if/when one is ready to grow. That way it could be recommended to someone who would otherwise not be willing to take on a harder language, and they have a growth path. Or for a computer science program, to grow into it all incrementally. And then yes, make whatever improvements in the OP article, from there.
- IshKebab 4y agoYeah I think you'll realise how bad dynamic typing is when you stop working on solo projects.
- jaredcwhite 4y agoI never said I only work on solo projects.
- galdosdi 4y agoSomething like ruby is great for WRITING greenfield code. But without static typing, diving into and maintaining an existing codebase that you just got hired on to deal with becomes a lot more stressful. And that's why there's still plenty of legacy Java code, but legacy ruby code over the last decade has been much quicker to get thrown away and rewritten. I once took over a Java codebase that was clearly created entirely by people who barely knew Java and I was still able to fully understand (and, in the process, refactor it to cut it in half, because half of the code was dead code by the time I encountered it, lol) in about a week. This was not a very large codebase to be honest, but it would have been impractical without static typing and a good IDE that leverages the same. Dude, the reason programmers fear abstraction is because they've had to maintain legacy codebases. It sounds like you've been lucky enough to mostly be able to do greenfield stuff or maintaining codebases that aren't very old. I am sure you would understand their views more if you had more experience with maintenance.