Programming Leftovers
-
Martijn Faassen ☛ Repeat Yourself, A Bit
All right, there's an exception; I do sometimes accept repeating myself. Test driven development promotes a practice where you can repeat yourself temporarily to make the tests pass, and then you refactor to get rid of the repetition. The idea is that repetition can be used to make the individual steps smaller and easier. And you very well may need to see repetition before you can be confident about the best way to eliminate it. Again: repetition as a design pressure.
Oh, there but there's also another exception, a fundamental one I can't easily eliminate 1: if I name something in code (a variable, a function, a class, etc) I need to have a way to refer back to it. I do this by using its name. So I'm repeating that name.
-
Keith Harrison ☛ SwiftUI Button Image When Pressed
A UIKit control like a UIButton has a default normal state and additional states that indicate if it’s highlighted, disabled, selected or focused. You can provide different configurations for each state. You can configure the button to show a different image, title, or background when the user touches (highlights) it. That provides a useful visual feedback to the user.
A SwiftUI button lacks a lot of the UIKit customizations. I’ve written about SwiftUI button styles and shapes before. The ButtonStyleConfiguration gives you access to the button label, isPressed state, and button role (cancel or destructive).
-
Perl / Raku
-
Perl ☛ 2025-01-24 [Older] OTOBO supports the German Perl Workshop
-
Perl ☛ 2025-01-24 [Older] This week in PSC (176) | 2025-01-16
-
Perl ☛ 2025-01-24 [Older] This week in PSC (177) | 2025-01-23
-
Perl ☛ 2025-01-22 [Older] Premium XS Integration, Pt 1
-
Perl ☛ 2025-01-20 [Older] Announce Perl.Wiki.html V 1.22
-
[Repeat] Ruben Schade ☛ Thinking aloud about self-hosted photo sharing
Fun aside, my first ever Perl CGI script wasn’t for powering this blog, it was for a photo sharing page that resembled Web 2.0 Flickr. I had an XML file of assets that I hand wrote, and it would slurp it up and generate galleries and tag archives on the fly. It was incredibly slow, but it worked!
-