Hackaday Newsletter 0xEF - Opritek

Opritek blog is a blog for Blogging tips | life hacks tips |gospel articles | educational |news

click the drop down menu to read blog in your preferred language

Friday, 18 September 2020

Hackaday Newsletter 0xEF

Who are you writing your code for? Dare to write for yourself!
HACKADAY

Floating Spaceports for Future Rockets Read Article Now»

Code for Hackers

By Elliot Williams

Mike and I were talking about two very similar clock projects we'd both built recently: they both use ESP8266 modules to get the time over WiFi and NTP, and they both failed. Mike's failed because he was visiting relatives in a different timezone with different WiFi credentials, and mine failed because daylight savings time caught me off-guard. In both cases, we hard-coded stuff that could obviously change, but we drew vastly different conclusions.

Mike thought he'd solve his WiFi problem with a fallback to a captive portal, and maybe would have to figure out some web interface for configuring the timezone. A very clean, professional solution. Me? I've got good comments in the code, can find the UTC offset (or the WiFi creds) in a few minutes, and flash the new version up simply by fetching a USB cable, for something that happens twice a year. It's hardly worth the trouble to cobble together a web interface.

automation.png

We've accidentally embodied a quandary that spans both the hardware and software worlds: should flexibility be exposed to the end-user or to the hacker who can peer under the hood or open up the source code? (And what if the end-user is the hacker?) What are the tradeoffs, in project complexity and in ease of use?

And in this, Mike is on the side of right and good, and I'm the heretic. I don't always write my code to be extensible or re-usable. I sometimes write it to be quickly re-edited and patched whenever I need to. Is it full of magic numbers? Sure! But I know just where they are and how to change them. Heck, most are even well documented in their own header file. You could probably figure it out just about as fast. Would my father-in-law be able to tweak the timezone? Nope! But this ain't his project anyway.

Dare to code for hackers! Don't over-generalize or over-abstract. Less is more. Don't be afraid to edit code. Tweak, compile, and re-flash when the situation changes. After all, that's how you got the code there in the first place.

And although I'm on the wrong end of history, in this case I was right. You see, before daylight savings time could come around again, and I could have made use of that captive portal that I didn't bother coding up anyway, my son entered first grade. Everything needs to be changed, from the hardware to the software. Will I code up the next version with flexible time regimes? As flexible as I need it to be, but not more.

From the Blog


GitHub's Move Away From Passwords: A Sign Of Things To Come?

By Maya Posch

GitHub is kinda getting rid of passwords. You should be using SSH sign-ons anyway. Read more »

Decoding the Netflix Announcement: Explaining Optimized Shot-Based Encoding for 4K

By Pedro Umbelino

All you wanted to know about video encoding and more! Pedro looks at Netflix' trix. Read more »

Targeting Rivers To Keep Plastic Pollution Out of the Ocean

By Lewin Day

Most of the plastic in the ocean gets there through rivers. Can we stop it upstream? Read more »

Hackaday Podcast

Hackaday Podcast 085: Cable Robots Two-Ways, Cubic Raspberry Pi, Plastic Wrap Kayak, and Digging Inductors

By Hackaday Editors

What happened last week on Hackaday? Editors Mike Szczys and Elliot Williams get you up to speed.  Read more »

If You Missed It


TV Output from Arduino — 1980s Style!

ISS Ham Radio Repeater

Deep-Sleep Problems Lead to Forensic Investigation of Troublesome Chip

Cell Phone Signal Booster Gets Teardown and Demo

This Ruggedized Raspberry Pi Was Built to be Copied

Friendly Fiberglassing: Can Hide Glue Replace Epoxy?

Hackaday

NEVER MISS A HACK

Terms of Use

Privacy Policy

Hackaday.io

Hackaday.com

This email was sent to opezeroy.News@blogger.com

why did I get this?

unsubscribe from this list

update preferences

Hackaday.com · 61 S Fair Oaks Ave Ste 200 · Pasadena, CA 91105-2270 · USA

No comments:

Post a Comment

Please drop comments align to post
Thanks a trillion