mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

9.1K
active users

I've finally got around to learning Python, and I'm currently working through some of the Advent Of Code '24 puzzles to get some hands on experience.

I appreciate some of what I think are Python's claims to fame. It's the first language in which I've worked with comprehensions. They're fun, but I'm not sure I see them as more than semi-arcane syntactic sugar for map() and filter(). Clearly, python's dynamic typing applied to list, tuple, comprehension, and generator is extremely powerful. Figuring out that I could just unpack all the elements from a short known-length list into a tuple has been handy.

The standard distro has modules for a great many things, and the package index has most everything else. On the other hand, how much is most? Maybe I'm missing something, but I can't find a module defining range_inclusive(start, stop) anywhere. Yes, I know it's trivial to write myself, but that seems at odds with Python's "batteries included" philosophy. All the research I've done seems to suggest the standard idiom is just to call range(start, stop + 1).

I love having access to a REPL again during code writing. It makes me miss the days of writing LISP in Emacs. I'm using PyCharm, which, of course, has the ability to load the current file directly into a new interpreter.

Probably my biggest gripe is that the language enforces so little and leaves so much to convention. Sure, it's higher-level than C, but it leaves you so many opportunities to shoot yourself in the foot at runtime. I had to laugh when reading up on classes, attributes, and scopes. Clearly, the moral was to define your data attributes inside the __init__ or you'll get some pretty bizarre bugs.

Continued thread

Ale že mě tak to AOC dostane sem netušil. První den (pouze part 1) absolutně jsem nepřišel na to jak vyřešit druhou část… Den 6 jsem zvládl obě části (euforie) a pocit naděje.

Den 14.. po chvilce jsem to vzdal, hledám jiný úkol, tomu taky moc nerozumím… euforie je pryč. Deprese.

Zítra prostě musím nějak udělat 12. den!

Nicméně jsem fakt takový tupec? Nebo je to normál?😩

#AdventOfCode, #Python, #Junior

I just completed day 1 of #AoC 2024, I know, I'm late to the party but I am learning #clojure so thought I would learn better if I did something with it.

I will be uploading my solutions to github as I go forward, And I will probably be using multiple languages to solve the puzzles, to get better practice with different langs and also compare them.

github.com/alirezaalavi87/adve

GitHubGitHub - alirezaalavi87/advent-of-code: my solutions for solving advent-of-code puzzles. The solutions might be impemented in various languages.my solutions for solving advent-of-code puzzles. The solutions might be impemented in various languages. - alirezaalavi87/advent-of-code
Continued thread

Vorab kurz zu meinen Vorerfahrungen:
2 Semester Informatik im Studium, bisschen Anwendungen in C/C++ programmiert. Danach lange keine größeren Berührungspunkte, privat ab und an "programmiert" in C++, Java und Python. Größter Erfolge ein Sudoku-Löser, der sicher nicht effizient oder elegant, aber immerhin mein eigener war.
Beruflich aktuell Projektleiter eines SW-Entwicklungsprojekts - ab und an schaue ich da auch mal Code an.

Mal schauen, wie weit das reicht.

Weil die Arbeit noch nicht stressig genug ist(🙈 ), habe ich beschlossen, die Coding-Skills aus der Uni (2 Semester Informatik-Grundlagen) mal bisschen aufzupolieren und bisschen Zeit in Problemlösung in C/C++ zu investieren - Ich arbeite mich mal durch den - Start im Jahr 2015. Werde den Thread hier zur Doku meiner Probleme und Erkenntnisse nutzen.

At last night’s @mug meeting we looked at a lot of different solutions to #adventofcode day 1 in many different languages. Two that were very interesting to me were #Zig and #haskell. The way these two languages worked was really quite fascinating. After seeing real code in these two languages, I can tell they are not for me; but they were interesting and illuminating nonetheless.

There was a solution entirely in #SQL. Another in #vim9script. Another in #swiftlang #swift (I don’t think that one’s in the repo yet). I wrote several implementations myself. The one I felt most proud of is #Python with the core written in #rustlang #rust tied together with #PyO3. The one I felt was maybe the best tool for the job was entirely based on #pandas. As I said in a previous post, I tried to solve it in #polars, but the API exposed by Polars at least as far as I could tell, made it no better than simple lists in Python. I need to get deeper knowledge here.

The repo lives here: github.com/MichiganUnixUserGro.

404Not Found