Seems like a good day for a reminder of how quick studios are to screw over writers. In 1999, NBC moved a series from their regular network to Sci Fi Channel. My pay went from $240,000 to $0. Because my contract paid "per broadcast episode" instead of just "per episode."
"...broadcast programming substituted for #programming for which requisite #licenses or clearances to transmit over the Internet have not been obtained Did your contract even include "new means of transmission, i. e. The [#internet; usually, all uses must be explicitly granted] and one with substitute advertisements, and
(2) An #InternetTransmission in accordance with 17 U.S.C. 114(d)(2)(C)(iii) of an archived #program, which program was..."
The objective: from an html page type in a URL, on pressing Go button, extract the video stream, grab the audio and encode to mp3 and play it.
Due to errors in module choice (non existent or old) I had to downgrade my ambitions to a CLI version. I want command line args, so 🤖chose Clap and the code barfed bad (just looking at I know, cause I’ve spent time upgrading from 2.x to 4.x) and understand the code well.
Here’s todays wild ride, when I chided the 🤖 and wrote some example code, mentioned the specific rust module, it re-wrote the Clap code correctly.
Conclusions: Most example rust code seen uses old Clap derive examples. The LLM gas seen the latest version. If you prompt for this, it rewrites it correctly. Learning or being more specific? I lean towards the later. #AI / #programming / #hacks / #rust 🦀
"Composition is better than Inheritance" is already a cliché, and it's usually even true. Today. But it wasn't always the case. Back in the early days of Object-Oriented Programming, computers were pitifully show, memory was tiny, and OOP languages only worked acceptably because of aggressive optimization in implementation.
Inheritance itself is mostly an optimization. (I don't have room for the explanation here, but buy me a coffee and ask me some time.) In Smalltalk-80, sharing behavior by composition was several orders of magnitude slower than inheritance. With inheritance, there was a VM optimization to make it go as fast as possible. But for composition, you had to do all that work in Smalltalk code, which involved message sends, stack frame allocations, and all the rest. Even then, inheritance felt restrictive, and I spent quite a bit of time writing hacks to enable performant compostion by tricking the Smalltalk object system.
Modern object languages don't have to fit within the same restrictions as earlier efforts, and that changes how we design software. Early Smalltalks only supported 16K objects because object pointers were mapped through a fixed size Object Table. Even when we had enough RAM, we couldn't allocate 20K strings! When the first modern "OT-less" Smalltalk appeared with an unlimited number of objects, it changed everything.
OOP is polymorphism + encapsulation + inheritance by class. Of those three, class inheritance is the least critical and the most replaceable. Now that we can enjoy good performance with other kinds of behavioral composition, we can throw off the itchy wool sweater of class-based inheritance.
Every part of the the ceremony, as silly as it seems, has, or rather had, meaning. A king's power does not actually come from some mythological deity, but from the support of nobles who would lend the military (and economic) power necessary to enforce his rule. Getting that support, required an aspiring king to play a complex game of flattery, intimidation, backstabbing and promises.
Man, with the help of @helge, my networking code is so efficient that you can’t see the cool animations I made for the various connection stages, so I had to add a bunch of DispatchQueue.main.asyncAfters just to let the user experience the animations.
Does anyone know of it is possible to dynamically resize a GUI window made with iced? So for example, I have a window at a specific size and I want to resize it in the code when I switch to another view in the application. #rust#programming
If you're helping teach a kid to code (or learning yourself), this is a great step-by-step tutorial series for creating a full-featured tower defense game in Roblox w/ Lua.
There's the right amount of iterative progress in each step. The code is clean, and starts very simple with ongoing refactoring to add extensibility.
My 10yo son is really enjoying it. Godot next, but Roblox has a built-in audience that's hard to beat.
if I asked you today to write an algorithm X that you need to compile as native library that can run in the browser, desktop Windows app and Android/iOS app, which language would you choose for that and why?
C is not allowed because it's year 2023 already and we can do better 😅 #programming#software
Windows may be an easy platform to use for simple things, but as a developer, there are no operating systems with as much friction as Windows. Linux is a breeze in comparison.
I have little experience with MacOS, and I find their UI very counter-intuitive and opinionated, but at the command line level it is easy enough to work with as well – for what I've had to deal with so far at least.
So, testing the #bingAI. I want it to rewrite a #java code snippet from using a switch statement to an if statement. Literally just to test it. And it's generating.. it's generating... It's generating. You can see the code being generated in front of your eyes in real time. Still generating.. almost done... Aaaand d--
Bing deletes everything and tells me it can't do that.
The best way I've found to design software is to get it totally wrong on the first try. Once you've seen why the obvious approach won't work, and how ugly your naive workaround is, you sleep on it and a better solution will present itself in the morning. Just make sure you do this in small chunks, or the epic rewrite will take you forever.
Actually, this is the only effective way I've found to design software. :blobcat_mlem:
It took me a long time to try it for the first time, but I have the feeling that those «AI» Tools like ChatGPT will be a very often used Tool for programmers from now on. It is by no means perfect and you have to know what you are doing, but as Assistant it is very powerful!
Every single day convinces me more and more that IDisposable interface is one of the most disastrous things in C#. So easy to screw up in so many ways...