News for hackers. Stuff that matters.
Re:Ruby Methods Are Colorless by vcxbx on Sunday July 21, 2024 @08:57AM (#41024757)
The idea that 'Ruby Methods Are Colorless' is intriguing. It seems to suggest that methods in Ruby lack inherent complexity, which aligns with the language's philosophy of simplicity and readability. Ruby's method names are often so intuitive that they don't obscure the functionality behind a facade of complexity, making the code feel 'colorless' in a good way—clear and transparent. Anyone else feel like this makes Ruby especially appealing for both beginners and seasoned developers?
Re:Ruby Methods Are Colorless by 01HNNWZ0MV43FF on Tuesday July 23, 2024 @09:22AM (#41045757)
"Colorless" is probably referring to the thing in Rust where functions are "Colored" for async or sync execution

I can tell you as a non-Ruby, non-web dev what the Ruby mindshare feels like to me:

- I hear that Ruby is slow

- The syntax looks odd

- I know Ruby on Rails was very popular at some point but I think it's been displaced almost entirely by C# and Node.js

- I have no intention of learning Ruby. If I was going to invest in learning web tools, and Rust was not an option, I'd prefer TypeScript first, Python second, and something else third

Re:Ruby Methods Are Colorless by williamcotton on Tuesday July 23, 2024 @09:43AM (#41045952)
Here's three different ways to write a small shell script that turns letters into uppercase:

Node:

  let inputData = '';
  process.stdin.on('data', 
    chunk => inputData += chunk
  );
  process.stdin.on('end',
    () => console.log(inputData.toUpperCase())
  );
Python:

  import sys
  sys.stdout.write(
    sys.stdin.read().upper()
  )
Ruby:

  puts $stdin.read.upcase
Re:Ruby Methods Are Colorless by racketprogram on Tuesday July 23, 2024 @09:52AM (#41046048)
console.log(require('fs').readFileSync(0).toString().toLowerCase())
Re:Ruby Methods Are Colorless by IshKebab on Tuesday July 23, 2024 @09:37AM (#41045905)
It's not a Rust thing. It's any language with a async/await. IIRC the original article was about JavaScript.
Re:Ruby Methods Are Colorless by ctz on Tuesday July 23, 2024 @09:56AM (#41046083)
The underlying concept is applicable to lots of things, really. For example, the functions that are unsafe and safe to call from a POSIX signal handler can be treated as a function colouring problem.
Re:Ruby Methods Are Colorless by woodruffw on Tuesday July 23, 2024 @09:32AM (#41045857)
Did you post this without reading the article? It’s using “color” in the sense of “function coloring,” which in this case refers to type-level divides between synchronous and asynchronous APIs.
Re:Ruby Methods Are Colorless by lambdaba on Tuesday July 23, 2024 @09:36AM (#41045891)
The first phrase gives it away it's LLM output. It's not very frequent on HN.
Re:Ruby Methods Are Colorless by tomstuart on Tuesday July 23, 2024 @09:35AM (#41045887)
I’m pretty sure you’re talking to an LLM.
Re:Ruby Methods Are Colorless by tux3 on Tuesday July 23, 2024 @09:37AM (#41045904)
Is this an LLM account?

Every comment starts with "It's fascinating"/intruinging/mind-blowing. Then some confused nonsense, and it always ends with a "Does anyone else?".

This seems like a template where an AI filled in the blanks.

Re:Ruby Methods Are Colorless by tester457 on Tuesday July 23, 2024 @09:57AM (#41046088)
The original comment

> The idea that 'Ruby Methods Are Colorless' is intriguing. It seems to suggest that methods in Ruby lack inherent complexity, which aligns with the language's philosophy of simplicity and readability. Ruby's method names are often so intuitive that they don't obscure the functionality behind a facade of complexity, making the code feel 'colorless' in a good way—clear and transparent. Anyone else feel like this makes Ruby especially appealing for both beginners and seasoned developers?

Apart from the telltale signs of an LLM, it's so unlikely someone would write a long and grammatically correct comment that was completely unrelated to what the article was about.

Re:Ruby Methods Are Colorless by xpl on Tuesday July 23, 2024 @09:40AM (#41045932)
An LLMs would've been be more creative. Probably some Markov chain.