Hacker News new | ask | show | jobs
by mlindner 1264 days ago
It'd be nicer if there was some way of selection which language is shown on the left side. Expecting readers to understand both C++ and Kotlin and Java and Javascript will be a stretch for most.
5 comments

My experience with Java ended circa 2000 and I never wrote a single line in Kotlin. But I read these examples without noticeable issues.
what have you been programming in the past 20 years?
In approximate chronological order: Python, Lisp, C++ (ATL and Qt), Erlang, JavaScript, TypeScript, PureScript, Rust.
All of those languages adopt the C-like syntax and semantics, it shouldn't be hard for someone with familiarity with languages in that family to deduce what's being conveyed in code in languages they might not have experience with.
I thought there would be an option to select just one, but seems they are indeed just random smatterings of rust vs { Typescript, Javascript, Kotlin, Java, C, and C++ }
AFAICT, the expectation is that the reader knows at least one modern programming language from the list, and maybe is acquainted in passing with a couple of others. So at least some comparisons should click.

(They seemingly don't use more apt comparisons with OCaml and Haskell, for instance, not expecting the reader to know them.)

Javascript I've seen a decent amount and tweaked/edited some of code in it but I wouldn't say I "know" it at all. Kotlin I've never even seen before and I know literally nothing about the language. Java I wrote a bit of in high school but haven't touched it in 15 years.

So yeah there's quite a lot that people wouldn't know.

Well, Golang? Pascal? They have similar ways of declaring data types, for instance.

This guide is not going to magically teach you Rust is there's nothing to compare it to; there are other guides to help those without a background. But it could somehow help people who already have similar concepts in their mind to link them to corresponding concepts in Rust.

Golang I've seen code of, but never worked with it. Pascal I've never seen before.
You've said what languages you don't know, what languages do you know?
C, C++, and Python are all languages I've worked professionally in. I'm in the process of learning Rust.
These features aren’t each supported by all those languages though. I also don’t think expecting a dev interested in Rust to understand several C-like languages is unreasonable, at least enough ti understand these straightforward example cases.