txbuck
txbuck on Hacker News
Not necessarily advocating for unidiomatic python/code, but you could use a decorator to automatically wrap the function call with a try-catch and package the return value appropriately. Lot less mangling of function bodies that way, just return and raise exceptions like normal. You *could* specify the expected Exception type, but considering the rest of the ecosystem probably won’t be following along with documenting expected exceptions, I assume it wouldn’t be worth it and would be more straightforward that all the exception types in the signatures be the plain vanilla Exception. Would also be super inefficient pre-3.11 but ¯\_(ツ)_/¯
Surely you didn't comment before viewing the post.
For reference, something like like this (Python regex):
^[a-zA-Z_]+[a-zA-Z0-9_]*(-?[a-zA-Z0-9_]+)*$
some-name
some2-name
some-2-name
some-2name
some-name2
some-name-2
some2other-name
some-other2name
some-othername2
some-2othername
some-0-other-name
a-0-name
a0-0a-0a-a0
kebab-case-pls
tbh-didnt-write-any-underscore-tests
-negated
-negated-variable
-(negated)
-(also-negated)
-(-double-negated)
binary - operation
binary + operation
double - binary - operation
2-syntax-error-4-me
2syntaxerrorforme
1-2-3-4-syn-tax-err-or
80086-syntax-error
syntax+error
syntaxerror+
syntax-error+
syntax-error-
syntax-(error)
(syntax)-error
syntax--error
syntax++error
(Hot damn, that was a super thorough/thoughtful reply in a short amount of time.)
You're spot on about the quirky syntax, but I don't think it's as serious a trade-off or addition in complexity (or even a change), given that:
- (IIRC) many style-guides/formatters already enforce spaces between binary operators and their operands (but especially identifiers) and in my super-subjectively-opinionated opinion you should already be doing that even without a formatter
- I don't feel particularly strongly one way or another about any other special characters like "+", so really in this case I'm only considering the dash
- Requiring the dash between alpha/alphanumerics makes it play nice with unary operators
- The language would be terrible for code-golfing, but that's a relatively niche application I'd definitely consider worth spurning
I've seen it dubbed "sponge-case" and am pretty fond of the term.
The fact that kebab-case support is a rarity constantly boggles my mind, nevermind that it isn't the de facto default for any language created after *sh/lisp. Readability, ease-of-typing, parallel with the way it's used in (Romantic) natural language. If I were writing a new language I intended to popularize this would be one of the features I would emphasize.
Spicy semi-snarky aside: if your counterpoint is that kebab-case prevents crushing your arithmetic operators together, I strongly suggest you either reconsider or never write any code you think may be read by another human being (and possibly yourself).
If anything is gonna happen it's more likely The Powers That Be would limit use and/or distribution instead of mandating a change to code itself. Half of them probably don't know how to connect to their home Wifi network, nevermind authoring and mandating a commit.
I don't plan on having kids of my own, but if life finds a way (or I end up with custody of a relative's children) I figured I would similarly put together some kind of loose "curriculum" to guide them along if they took an interest in computing. Never actually planned it out - is a pretty large domain of knowledge to cover for something I don't currently plan on using, but I wouldn't be surprised if there are already pre-existing FOSS resources along those lines.
Anybody know of any projects in the same vein?
As far as ergonomics go, a controller-like form-factor is almost definitely the current ideal for a portable, carry-able, holdable keyboard. Obviously just slapping QWERTY on it wholesale may not be the best idea, and doing the R&D for a more appropriate layout or entirely different approach to input could be costly. carriers for phones or other devices could also complicate it. Might be the reason there aren't more on the market?
Is there anything like it out there now? I searched around for something like this a while back, wasn't really satisfied with my findings, and haven't been able to stop thinking about it since.
"I spend all day getting pissed at my machine for doing exactly what I told it to do."
Would be neat to take a lot of the submitted sounds of old machines (computers or otherwise) and write a background process that manipulates and plays them while performing certain tasks, like loading from an external drive, or using the more ambient sounds for 'idling'. Lord knows if I could make my machine sound like Nostromo's Mother, I'd do it in a heartbeat.
Not exactly what you're talking about, but I've seen a few RaspberryPi + iPad + External Keyboard setups where they either use the iPad as an external display or VNC into the Pi from the iPad. IIRC you can power the Pi via USB C -> PoE on iPads with sensible ports on them, so you don't need an external battery or UPS.
Again, not what you actually want (I share your pain/longing), but damn if it isn't starting to get close.
"For Tesla, Facebook and Others, Misusing AI and Pretending It's a Magic Bullet Is Getting Harder To Ignore"
'Illegalese' has a nice ring to it.
As a former fiserv software victim/user I’m not the least bit surprised. If anything I’m surprised I don’t hear about similar oversights of theirs more often.
I'm both hopeful and dubious about this. Can't see this getting very far if it isn't open source, but it seems like something similar could scratch an itch I've had for a while (detailed below).
-----
I love using my iPad to consume content, but damn do I sometimes wish I could just use a real desktop on it. With some caveats, of course:
- Without needing an internet connection/AP
- At least some kind touch support* (clicking, scrolling, gestures, etc.)
- Consistent, dependable graphical fidelity/performance
- Easily portable
- Quick to instantiate
- Clean-yet-functional UI*
I've tried some wireless AP/bridge setups on a Pi4 and VNCing into it via my iPad, but they've been not-so-satisfactory for a few of the reasons listed above. Haven't given up on it -still researching/fiddling around - but definitely the biggest hurdle is going to be the UI. Gotta find that balance between functionality, simplicity, and aesthetic - preferably out of the box. Not something Linux is particularly known for.
*i.e. simplified desktop/application UI so that I can do most everything using the touchscreen (in addition to the keyboard/mouse), but can still access the advanced functions, even if those specifically are only optimized for mouse/keyboard. Ideally I'd be able to show/hide functions arbitrarily in the simple mode based on if I do/don't use them. Tiled WM or similar for single-app or split-pane view mode.
Fiserv's Signature UI (their Desktop Teller is also trash but not near as bad). I don't even know where to start with how bad it is, but I'd need a BAC of at least .1 to get through it all.