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())
It's not a Rust thing. It's any language with a async/await. IIRC the original article was about JavaScript.
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.
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