[–] 8 points 9 months ago (7 children)

Easy: CircuitPython running on an RP2040 or RP2350 microcontroller. Being able to write a simple bit of code and have it control something in the real world is sooooooo satisfying. OMG: You'll jump for joy the first time you get it controlling some LEDs, a display, a servo, a motor, etc.

Programming a microcontroller for the first time was definitely the most fun I ever had when programming. CircuitPython makes it so easy, too! Oh if only it had existed back when I started learning electronics.

  • source
  • [–] 1 point 9 months ago

    Interesting. I did find Shenzhen IO to be a bit annoying but that was more because it forces you to use circuit design to solve certain problems rather than just brute forcing them via programming. Weirdly I couldn't get into Exapunks while I found TIS-100 really interesting.

    I suspect the reason that they call it Python-like is because I don't believe it allows you to import any libraries or anything into it and they don't want people to think they've got a full Python interpreter that can do all the normal Python things. Essentially it's Python syntax, but without the normal Python runtime. There's probably some more advanced Python-isms that are missing as well, but I've not used Python enough or played the game enough to really run into those things. E.G. I don't know if it lets you define new classes as I never bothered to try that. I kind of got bored of it once I got towards the later levels and didn't really see any reason to keep grinding to unlock what were just extra challenges in the game.

  • source
  • parent
  • context
  • [–] 1 point 9 months ago* (last edited 9 months ago) (2 children)

    I'll toss TIS-100 onto the list of programming games although that one teaches you a pseudo-assembly language as well as how to think about concurrent programming. Then there's Human Resource Machine although that one is aimed at absolute beginners to programming and teaches a sort of visual assembly, and then its quasi-sequel 7 Billion Humans which extends the concepts explored in Human Resource Machine into parallel processing (this actually makes a pretty good soft introduction to GPU programming and shaders).

    I actually played The Farmer Was Replaced and it's just straight up Python, not even Python-like, it just locks a lot of the language features behind campaign progression. It was OK initially, but gets kind of annoying at later levels because they intentionally hold back a lot of the tools to easily solve problems and make you solve them in a more verbose and annoying fashion first.

  • source
  • parent
  • context
  • [–] 3 points 9 months ago (3 children)

    So, if you're brand new and want to learn concepts of how to write code, I might suggest a game. There are a lot of programming games. Obviously it's never a one to one about learning something useful, and a lot of them even make "bad" things useful (though not bad enough to think it's going to teach you bad habits you won't be able to unlearn). I really enjoyed Exapunks, but it's sort of unrealistic. The Farmer Was Replaced looks fun as well and uses a "simple Python-like" language, but I haven't played it.

    If you sort of already understand the concepts and want to dive into a real language, well, it's hard to say what will be fun. Chase your fun. It might be easier to think about what's not fun and avoid languages at the start that deal with that. For example, if setting up an environment to code in is the problem, then maybe something like JavaScript would be a good place to start. It runs in your browser! Press F12, click "console", type alert("Hello, World!"), boom, done, you just did Hello World in JavaScript without downloading anything at all.

  • source
  • [–] 8 points 9 months ago (6 children)

    So, I can't answer the question of "what's the most fun language to learn" because that's highly subjective and my answer almost certainly wouldn't align with your experience. What I can do though is share my thoughts about different languages I've used over the years (in no particular order).

    • Assembly: the bedrock upon which all other languages are built. If you want to understand how a computer really works, this is a great language to learn, and it's honestly not that hard to learn. Writing something in assembly much more complicated than hello world is incredibly painful because of just how much you need to do and really makes you appreciate how much you get out of the box with other languages, but it's not hard in the "I don't get it" way, so much as "oh god, that's only 1% of what I need to do and it took me an entire day". This is also a great way to develop a deeper understanding of pointers and memory management.
    • C: assembly on steroids. Not quite as painful as assembly because you get a lot of libraries that take care of things for you, but still quite tedious compared to most other languages. The type system such as it is is practically nonexistent so your ability to design APIs is highly limited, and it's incredibly easy to introduce subtle and hard to find bugs. Relatively easy to learn, hard to master, and an act of masochism to use for large projects. At a minimum probably worth learning because C is the de facto interop language any time you want to interface two different languages together.
    • C++: C with the entire kitchen sink of comp. sci bolted on top of it. There's a good language in there somewhere, it's just buried under decades of terrible ideas and half baked experiments. If you know which are the "good parts" and which are the parts to ignore it's not bad, but figuring that out is far from a trivial task and everyone you ask is going to have a slightly different answer. I'd honestly say avoid this one unless you want to spend a couple years exploring all its dark corners and forgotten nooks.
    • LISP (and derivatives like Scheme): ye old functional language. This is basically the assembly of functional programming. It's "simple" to learn, but the lack of features is going to start to grate on you after a while, and the syntax is just horrible. Absolutely worth learning to learn to think functionally, but once you do I'd move to a better language.
    • Haskell: Like LISP but with a masters degree in set theory, a MUCH better syntax, and one of the absolute best type systems ever created. Amazing language that will expand your mind just from learning it but might kill you from a brain aneurysm in the process. To abuse a meme, this is the dark souls of functional programming.
    • JavaScript: A badly designed scripting language that was thrown together from a box of scraps in a cave, but rather than making it better over the years everyone just said "eh, good enough". Its original sin was that in an attempt to make it "beginner friendly" they made the syntax incredibly sloppy which means it's very easy to introduce bugs on accident and then very hard to actually find them because they don't error, they just silently do the wrong thing.
    • Typescript: A better JavaScript in every metric. At the end of the day under the hood it's still JavaScript at runtime so it can only do so much, but the addition of a real type system goes a LONG way towards making JavaScript more bearable to work in and helps eliminate a ton of bugs.
    • Perl: What LISP is to functional programming, Perl is to basic collection types. Scalars (single values), Lists, and Maps are your building blocks in Perl. It's not a bad language exactly, but these days other languages do almost everything it does but better. If there's one significant criticism you could level on Perl it's that the syntax is really easy to abuse to write some truly obtuse code. This is effectively a dead language these days, but it does live on a little bit by being the gold standard in regular expression design that everyone else just copied.
    • Lua: One of if not the best scripting languages currently out there. It's very similar to Perl except it went all in on Maps. It's simple to learn, and simple to master, although that comes with the downside that it's nowhere near as powerful as other languages. Out of the box you don't really get much with it, but since it's designed to be embedded it's really easy to extend and there are versions of it that come with all the bells an whistles you need to use it directly for writing apps. I'm not sure I'd recommend it over another language in general, but if you're looking for a scripting language to embed in something else it's my top pick. The web ecosystem would be a lot less of a mess if Lua had been the language picked at the dawn of the internet instead of JavaScript (to be fair I'm like 99.9% sure Lua didn't exist back then but I'm too lazy to verify that).
    • Python: A competent language. It's not a particularly great language and definitely has some warts, but there's not really anything in the language that makes me go "ewwww" except maybe the significant whitespace, although Haskell does the same thing so it would be hypocritical of me to ding Python for that. It's a solid middle of the road language, nothing really amazing about it, but nothing really bad either. It's biggest flaw is its duck typing system which really limits your ability to write APIs in it. If you want to crunch some numbers it has some really great data analysis libraries and frameworks, although performance isn't anything to write home about either.
    • Ruby: The train wreck that happens when Perl crashes into Python and the mangled remains crawl from the wreckage. It's the terrible syntax of Perl crossed with the middling type system of Python with a sprinkling of bad choices all its own. Performance is horrible and the language has a lot of features that make it easy to write obtuse code. Like Perl this is an effectively dead language. Just use Python or something better.
    • Go: Created in part by one of the guys involved in the creation of C and set out to be a "simple" language that anyone could learn. It does succeed in being simple, but the tradeoff is that it pushes all the complexity that most other languages handle for you onto the programmer to handle. Go programs are going to end up being a lot more verbose and filled with boilerplate than they would be in another language. It also still suffers from an early decision related to its generics system that leads to them being largely useless. Not unsurprisingly working in Go feels a lot like working in C, you often find yourself wishing the language handled a bunch of things for you or at least gave you some syntactic sugar to handle them more concisely yourself.
    • Java: Has a reputation for being verbose but that's more to do with the community than the language itself. Also has a reputation for being slow, and while startup times are certainly a problem at runtime it's surprisingly fast these days. Not a great language, but nowhere near as terrible as its reputation would make you think.
    • Kotlin: Java alternative. Solves some of Javas problems, introduces some of its own. At one point it was the clearly superior choice compared to Java, but since then Java has closed the distance and honestly it's a coin flip as to which is the better language between the two.
    • C#: Microsoft Java. Seriously, everything you can say about Java applies equally to C# and vice versa. It's not a better or worse language, it's just different. Criticisms of C# are less about the language and more about the company behind it.
    • Rust: A type system nearly as powerful as Haskell's, low level primitives that let you write bare metal code, but advanced abstractions that let you write high level code as well, and a truly unique approach to addressing concurrency and memory safety by way of the ownership system. One of the more interesting languages out there and my personal pick for "best" language because it gives you tools to solve some of the hardest problems to deal with in programming.
    • Zig: A better C. Has a somewhat powerful type system a bit like Rust or Haskell as well as a pretty unique and interesting macro system, but ultimately lacks some of the higher level features that something like Rust would give you. It's similar to C in that it it can be somewhat tedious to work with but on the whole not a bad language.
  • source
  • [–] 5 points 9 months ago (1 child)

    For a newbie probably something like Scheme (which is just a particular flavor of LISP) although I wouldn't call it a good language.

    Here's the thing with purely functional languages that don't allow in place mutation (most of them, or only under special circumstances like Haskell's ST Monad), they force you into learning functions that typically don't exist in other languages like foldl and force you to think about approaching problems in a different way. This will make you a better programmer even when working on other languages, but it's very much something you have to learn and like all learning it will take time and effort.

    I'm actually tempted to say Haskell is the best option because it actually is a really good language but it's not so much a learning curve as it is a learning grand canyon. It has an amazingly powerful type system (very similar to Rusts) and uses it very well, but it's also very unintuitive because it's deeply rooted in academia and uses names for things taken from set theory and mathematics (terms like endofunctor, profunctor, affine space, and of course the famous Monad). If you're finding Rust a struggle Haskell would be 10 times worse for many of the same reasons.

    Another maybe good option that I can't definitively recommend would be OCaml. I've heard really good things about it and what I've seen of it looked good, but I haven't personally used it beyond maybe a little reading and a hello world type thing so I'm unsure what kind of pitfalls a newbie might run into.

    The primary reason I'd recommend Scheme is because it's in many ways a very primitive language. Its type system is very simple and it really doesn't have a lot going on other than being purely functional. That is also its biggest downside with its second biggest problem being a rather annoying syntax (be prepared to spend a lot of time counting parens to make sure you're closing every pair and working in the scope you think you are).

  • source
  • parent
  • context
  • [–] 5 points 9 months ago (1 child)

    Logo. Turtle graphics spirographs go weeeeeeee!

    At least, that's the most fun I had programming as a kid. There might be other good options nowadays, like Scratch or whatever they use to program those Lego robots.

  • source
  • [–] 2 points 9 months ago (2 children)

    I see a lot of people recommending things that a beginner definitely isn't going to find fun. It's not fun to bang your head against problems before you even understand what is going on. If that sounds like you then you do not want to be touching anything like Rust, C, C++, etc. Some people are recommending Python. I strongly recommend against that. Yeah it's a simple language, but it breaks all conventions that other languages have set up. Whitespace, tooling, comprehensions. They're all different. You'll struggle with the terrible tooling, the whitespace syntax isn't used in any other popular languages, and the stuff that is in other languages is implemented completely differently.

    I like Ruby for fun. It's an incredibly approachable language, it's extremely fun. The tooling is dead simple and works on every system out of the box. Of course everyone else in here is gonna recommend other different stuff, but I can tell you that I have developed professionally with both Ruby and Python for over a decade and the people suggesting Python have most likely not programmed with many other languages.

    I'll give a second suggestion. I recently started learning Unity and it was a blast. It brought back that joy of programming for me. Of course, most of it isn't programming, but that might help things in your case. So maybe if you're looking for something that isn't so ... 'backend' then that might be what you want, a video game engine that can get you started easily.

    Some others suggested esoteric or less used languages like Lisp or Forth, and I can't give any recommendations about those. Maybe you'll have fun with those, maybe you won't.

    Finally, one last thing, you can compare a lot of languages to see what 'equivalents' would be with this tool. https://evmorov.github.io/lang-compare/ruby-python/ There's also https://codethesaur.us/, but it covers different bits and doesn't seem to have much for Ruby.

  • source
  • [–] 4 points 9 months ago (2 children)

    I am having the time of my life with Clojure. Lisps in general. They really change how you view software. I was showing how clojure works to my Java coworker and showing her the REPL and powers of Clojure, and we both almost teared up :)) It's tgat good.

  • source
  • [–] 9 points 9 months ago (1 child)

    They don't type out the 0s and 1s, no. 😅

    @otacon239@lemmy.world wrote "Assembly/Binary", because an Assembly language is basically just a list of aliases (or mnemonics) for the different combinations of 0s and 1s.

    For example, HLT (Halt) may translate to 00000001, which is then already what your CPU understands.

    In practice, these lists for the different Assembly languages will look like this: https://en.wikipedia.org/wiki/Opcode#Sample_opcode_table

  • source
  • parent
  • context
  • view more: ‹ prev next ›