Live data from Hacker News

26 Programming Languages in 25 Days

matt.might.net

61–70 of 82 posts

Re: 26 Programming Languages in 25 Days

#61
That's really cool. It's basically a good way to practice multiple languages to see what you might like; and without an Advent of Code, I've used over 20 languages myself. I'm sad Nim wasn't on his list: I've started using that lately, and find it to be useful.

Re: 26 Programming Languages in 25 Days

#62
post #2

We did a similar assignment at University many years ago. I think it was the same assignment, one per day for two weeks. Each time in a different language. The goal was to see how similar code is, and how little it matters which language you pick. Obviously it's a constrained problem set (we didn't have to learn all the ins and outs of each language) but it really opened our eyes to the "commonness" of programming, a…

"The goal was to see how similar code is, and how little it matters which language you pick." I think this thinking is a mistake. If you learn languages superficially, you will end up writing the same code just with slightly different syntax. It can take a long time to really understand a language and ecosystem and use its capabilities.

While I mostly agree, A program this "basic" is not going to go far enough to learn anything that pushes any language far enough to learn it's limits.

Re: 26 Programming Languages in 25 Days

#63
post #49
post #2

We did a similar assignment at University many years ago. I think it was the same assignment, one per day for two weeks. Each time in a different language. The goal was to see how similar code is, and how little it matters which language you pick. Obviously it's a constrained problem set (we didn't have to learn all the ins and outs of each language) but it really opened our eyes to the "commonness" of programming, a…

Most languages have completely different idioms though. Sure you can write functions, loops, if statements the same in dozens of different language syntaxes, but that doesn't prove anything. I've seen loads of codebases written completely backwardly, eg when a C++ programmer writes their first Python app or a Java developer writes Javascript - they're just writing the same style in a different language, not writing i…

... and it's amazing how it works perfectly fine for a basic 1 day program as the og author needs. No need to make it "idiomatically correct"

Re: 26 Programming Languages in 25 Days

#64

Earlier quoted context omitted.

Curious which languages you used. If they were C, C++, Java, and Python then I could see how they could blur together if you squint. Different syntax, similar semantics. But if those languages are C, APL, Erlang, ML and Lisp then I would expect the lesson would be the design space of languages is much larger than the popular imperative languages would have you believe.

Sure, but in university that can be a useful exercise, whatever the language. There are many commonalities in just about every language. Learning your first language is hard, you’re second is freeing. At least personally I’ve found that the more languages I study, the easier it gets to pick up a new one, specifically because of the commonalities. Sure, Haskell and Ruby are really different, but when you try to pick u…

Languages like APL, Forth and Prolog are different enough that this wouldn't apply until you learn another array, stack, or logic-based language. And with languages like Smalltalk or Lisp, learning how to use the environment will be just as challenging.

Re: 26 Programming Languages in 25 Days

#65

Earlier quoted context omitted.

"The goal was to see how similar code is, and how little it matters which language you pick." I think this thinking is a mistake. If you learn languages superficially, you will end up writing the same code just with slightly different syntax. It can take a long time to really understand a language and ecosystem and use its capabilities.

While I mostly agree, A program this "basic" is not going to go far enough to learn anything that pushes any language far enough to learn it's limits.

Which means it's an almost useless exercise.

Re: 26 Programming Languages in 25 Days

#66
I'm not sure if this was OPs intent but this reminded me of a little Christmas themed language task fun I started at one job.

Write up on the whiteboard in various languages to echo "Ho Ho Ho", preferably in shorthand, one-liner if possible.

Like python would be

    ("Ho "*3).strip()

Re: 26 Programming Languages in 25 Days

#67

The sleep trick is something I do with my hobby projects all the time, without really deliberately coming up with it as a strategy. By the time I get the kids in bed at night, I'm often out of steam. Sometimes I try to make some progress on a project, but I usually don't have the willpower to push through a stumbling block. After many many nights of staying up late and losing sleep trying to power through but not act…

Hah! I have the same experience. When my children manage to sleep I'm too tired to do anything, so I program and think in computer problems as I fall asleep. I have to get up very early to work, so I don't have the chance to put them into practice the next morning (unless I thought of something related to work), but at least it helps a bit to cope with frustration and sadness ;)

Re: 26 Programming Languages in 25 Days

#68

Learning a programming language in 1 day to solve a particular problem isn’t the same as learning it over years to write actual production code. I doubt the author was writing “idiomatic” code and he probably transplanted paradigms from more familiar languages in the newer ones. But it’s still very useful and I’m sure he learned a lot and absorbed of some of the new languages’ programming styles. You don’t master idi…

Definitely true (not that should stop anyone, little projects like these are a great way to get exposed to other languages).

From my personal experience of doing AoC in Julia this year, my Julia code started out smelling a lot like Python, but managed to adopt a bit more of the Julian way of doing things as I went along (not done yet though...)

Re: 26 Programming Languages in 25 Days

#69

The sleep trick is something I do with my hobby projects all the time, without really deliberately coming up with it as a strategy. By the time I get the kids in bed at night, I'm often out of steam. Sometimes I try to make some progress on a project, but I usually don't have the willpower to push through a stumbling block. After many many nights of staying up late and losing sleep trying to power through but not act…

Notebook by the bed helps. If I have an idea while drifting off, there's sometimes a concern that it'll disappear by the morning and that stops me falling asleep. So I write it down.

Re: 26 Programming Languages in 25 Days

#70
post #13

Next on HN: "Hello World in 100 languages, in just 2 hour"

Hello world is different from solving actual problems in AoC.

AoC is somewhat more difficult, but is it worth a blog post? Especially for a professor? The stats https://adventofcode.com/2022/stats show that there are ~9000 people who solved all of the problems. Even if a fraction of those wrote a "I solved 25 problems" blog post, there'd be HN front-page material for months.

P.S. I'm somewhat surprised by this community's adoration of AoC and at the same time aversion to Leetcode and/or competitive programming in general. Arguably, many leetcode problems are more interesting (from an algorithmic point of view), are much shorter (although I guess for some, part of the fun of AoC is the elaborate story), and most importantly, have extensive test cases, that require generalized solutions.

Post reply on HN