Programming Leftovers
-
C++ vs Python: Get The Right Tool in 2022
While C++ is the pioneer of object-oriented languages, Python is one of the newer languages that has hit peak popularity due to its easy-to-understand syntax, among a ton of other benefits. That said, it is valid to draw a comparison between C++ vs Python as they are both high-level programming languages with similar uses.
Although one can use both languages to develop real-time dynamic applications, C++ and Python can be seen to go on different paths as most prefer C++ for general applications, and Python users often get a kick out of developing web applications. If this piques your interest or if you are trying to choose which to learn, stick on because that’s why we are here today!
-
2022.33 2nd Conf Succeeded – Rakudo Weekly News
The past weekend contained two full days of the second Raku Conference.
-
Status update, August 2022 · emersion
This month I’ve been pondering offline-first apps. The online aspect of modern apps is an important feature for many use-cases: it enables collaboration between multiple people and seamless transition between devices (e.g. I often switch between my personal workstation, my laptop, and my phone). However many modern apps come with a cost: often times they only work with a fixed proprietary server, and only work online. I think that for many use-cases, allowing users to pick their own open-source server instance and designing offline-friendly apps is a good compromise between freedom and ease-of-use/simplicity. Not to say that peer-to-peer or fully distributed apps are always a bad choice, but they come at a significantly higher complexity cost, which makes them more annoying to both build and use.
The main hurdle when writing an offline-first app is synchronization. All devices must have a local copy of the database for offline use, and they need to push changes to the server when the device comes online. Of course, it’s perfectly possible that changes were made on multiple devices while offline, so some kind of conflict resolution is necessary. Instead of presenting a “Oops, we’ve got a conflict, which version would you like to keep?” dialog to the user, it’d be much nicer to just Do The Right Thing™. CRDTs are a solution to that problem. They look a bit scary at first because of all of the obscure naming (PN-Counter? LWW-Element-Set? anyone?) and intimidating theory in papers. However I like to think of CRDTs as “use this one easy trick to make synchronization work well”, and not some kind of complicated abstract machinery. In other words, by following some simple rules, it’s not too difficult to write well-behaved synchronization logic.
So, long story short, I’ve been experimenting with CRDTs this month. To get some hands-on experience, I’ve started working on a small hacky group expense tracking app, seda. I’ve got the idea for this NPotM while realizing that there’s no existing good open-source user-friendly collaborative offline-capable (!) alternative yet. That said, it’s just a toy for now, nothing serious yet. If you want to play with it, you can have a look at the demo (feel free to toggle offline mode in the dev tools, then make some changes, then go online). There’s still a lot to be done: in particular, things gets a bit hairy when one device deletes a participant and another creates a transaction with that user at the same time. I plan to write some docs and maybe a blog post about my findings.
-
Rubenerd: Too hard? Take more steps
As my favourite software lecturer used to say, it’s better to be clear than clever. He was talking about code reviews, but it easily applies to tasks you assign yourself. We all think we’re clever, but “do X” in your task manager feels far less intimidating if it has “do A, B, and C” subtasks underneath.
-
The Unreasonable Effectiveness of Makefiles
Few tools walk the right line between declarative and imperative like make.