• 11 posts
  • 81 comments
Joined 2 years ago
Cake day: June 7th, 2024
  • Fascinating talk.

    According to the U.S. copyright office and Library of Congress, copyrighted works require a ‘human’ element: https://www.congress.gov/crs-product/LSB10922

    If art generated by AI can not be copyrighted, it may well extend to AI-generated code. If so, the implications could be pretty far-reaching.

    The one, practical use-case of AI that has found ‘product market fit’ so far has been using AI for coding. Companies are encouraging it. Developers (including experienced ones) are starting to use more of it. But if it turns out none of the generated output can be copyrighted, then you lose all the commercial users who are the revenue sources for all these tools and companies.

    This talk feels like it’s touching on a pretty important topic.

  • Wasn’t “lo-code” a BIG thing a few years ago… that would destroy programming and make every PM a developer? Whatever happened to that? 🤔

    Edit: read the HN comments. If I ever go back to consulting, I’m 10x-ing my rate to work on cleaning up this slop. I’m not anti-AI coding and use it for my own projects, but if you just give it a prompt and walk away, you will be very sad later.

    There’s a BIG difference between prototypes and something others have to use. As the lo-code folks found out the hard way.

  • I’ve been using these for constrained, boring development tasks since they first came out. “Pro” versions too. Like converting code from one language to another, or adding small features to existing code bases. Things I don’t really want to bother taking weeks to learn, when I know I’ll only be doing them once. They work fine if you take baby steps, make sure you do functional/integrated testing as you go (don’t trust their unit tests–they’re worthless), and review EVERYTHING generated. Also, make sure you have a good, working repo version you can always revert to.

    Another good use is for starting boilerplate scaffolding (like, a web server with a login page, a basic web UI, or REST APIs). But the minute you go high-level, they just shit the bed.

    The key point in that article is the “90%” one (in my experience it’s more like 75%). Taking a project from POC/tire-kicking/prototype to production is HARD. All the shortcuts you took to get to the end fast have to be re-done. Sometimes, you have to re-architect the whole thing to scale up to multiple users vs just a couple. There’s security, and realtime monitoring, and maybe compliance/regulatory things to worry about. That’s where these tools offer no help (or worse, hallucinate bad help).

    Ultimately, there’s no substitute for battle-tested, scar-tissued, human experience.

  • Arduino is based on the ‘giant loop’ model, where you initialize settings in the setup() function, then wait for events (inputs, timers, handlers, etc) in the loop() function.

    Each time, the loop() function has to finish before it can be called again. So if there are timing related actions, there’s a chance they may fall out of sync or stutter. If you want to advance an animation frame, you’ll need to maintain all the state, and hope the loop gets called often enough so the frame can advance. If you want to sync up the animation to an RTC, then you’ll want to track whether the current loop syncs up with a time code before deciding whether to advance the animation (or not). Pretty soon your giant loop will likely get complicated and messy.

    Another option is to look at something like SoftPWM for controlling LEDs and see how they set up animation timing. Or to use the millis() function instead of delay() to manage timing. Adafruit has a nice tutorial on that: https://learn.adafruit.com/multi-tasking-the-arduino-part-1/using-millis-for-timing

    To get more asynchronous activity going, the next option is to move to a more task-based system like FreeRTOS. Here you set up ‘tasks’ which can yield to each other, so you can have more asynchronous events. But the mental model is very different than the Arduino loop. The toolchain is also completely different. Here’s a decent primer: https://controllerstech.com/freertos-on-arduino-tutorial-part-1/

    If your target device is an ESP32, the underlying OS is actually FreeRTOS. Arduino is a compatibility layer on top. So you can use the Arduino IDE and toolchain to write FreeRTOS tasks. Many peripheral device drivers can also be shared between the two. However, the minute you switch to tasks, the Arduino loop doesn’t work any more. Examples here: https://randomnerdtutorials.com/esp32-freertos-arduino-tasks/

    From your description, it sounds like you may want to switch to FreeRTOS tasks.