Programming Leftovers
-
Sandor Dargo ☛ The rule of 5 and inheritance | Sandor Dargo's Blog
Last week, we talked about the rule of five and we discovered what it means for move operations if we only declare a destructor and not the rest of the special member functions. In that case, move operations are not declared, any move would automatically downgraded to a copy.
You might say that it doesn’t happen often that you only declare a destructor without the others and if it is so, you should either remove it or declare the rest. However, there is one very common scenario in C++ that requires our attention.
-
Manuel Moreale ☛ Digital nudges
The problem though, is that my way of experiencing the web is skewed by the fact that I spend almost all my days working on this damn thing. And so my assumptions on how people behave are sometimes incredibly wrong.
-
Karl Seguin ☛ Zig's HashMap - Part 3
If you've tried to navigate the HashMap documentation, you know that Zig's HashMaps are built on abstractions. StringHashMap and AutoHashMap are fairly thin wrappers around HashMap, which itself is wrapper around HashMapUnmanaged. Now we see that many of the standard methods, like get are abstractions around *Adapted variants - if not directly then through other layers of abstractions.
-
[Repeat] Rlang ☛ Black Monday Crash
The Bank of Japan has raised the interest rates and Nikkei has crushed the worst since the Black Monday crash of October 1987. The S&P 500 and DAX have declined similarly, but the DAX has performed slightly better.
-
Jake Archibald ☛ Garbage collection and closures
Me, Surma, and Jason were hacking on a thing, and discovered that garbage collection within a function doesn't quite work how we expected.
-
Python
-
Juha-Matti Santala ☛ Document intended usage through tests with doctest
A good test serves many purposes. It serves to make sure that the specific case it tests is implemented correctly and that later changes in the code base don’t introduce unintended issues. It also serves to provide documentation for how a piece of software is intended to be used.
Writing good tests in a way that serve both of these purposes is a form of art that requires practice and intentionality. In Python, we have many ways to write and run our tests.
-
Jeff Triplett ☛ Jeff Triplett's Micro.blog
Today, I tried to upgrade Django Packages to run on Django 5.1 to see if our test suite would run on Django 5.1, and it very quickly failed in CI due to at least one package not supporting 5.1 yet. Even if it had passed, I’m 90% sure another package would have failed because that’s the nature of running a new major Django or Python release on day one. Even if the third-party package is ready, the packaging ecosystem needs time to catch up.
-
-
Shell/Bash/Zsh/Ksh
-
Redowan Delowar ☛ HTTP requests via /dev/tcp
I learned this neat Bash trick today where you can make a raw HTTP request using the /dev/tcp file descriptor without using tools like curl or wget. This came in handy while writing a health check script that needed to make a TCP request to a service.
-
-
Rust
-
Rust Weekly Updates ☛ This Week In Rust: This Week in Rust 559 [Ed: Rust still tells people they must open a Microsoft account and use proprietary software of Microsoft/NSA to participate in Rust; this is appalling and they censor any critics they can find online]
Hello and welcome to another issue of This Week in Rust! Want something mentioned? Tag us at @ThisWeekInRust on X (formerly Twitter) or @ThisWeekinRust on mastodon.social, or send us a pull request.
-