Ask Hackaday: Are 80 Characters Per Line Still Reasonable In 2020?

Software developers won’t ever run out of subjects to argue and fight about. Some of them can be fundamental to a project — like choice of language or the programming paradigm to begin with. Others seem more of a personal preference at first, but can end up equally fundamental on a bigger scale — like which character to choose for indentation, where to place the curly braces, or how to handle line breaks. Latest when there’s more than one developer collaborating, it’s time to find a common agreement in form of a coding style guide, which might of course require a bit of compromise.

Regardless of taste, the worst decision is having no decision, and even if you don’t agree with a specific detail, it’s usually best to make peace with it for the benefit of uniformly formatted code. In a professional environment, a style guide was ideally worked out collaboratively inside or between teams, and input and opinions of everyone involved were taken into consideration — and if your company doesn’t have one to begin with, the best step to take is probably one towards the exit.

The situation can get a bit more complex in open source projects though, depending on the structure and size of a project. If no official style guide exists, the graceful thing to do is to simply adopt the code base’s current style when contributing to it. But larger projects that are accustomed to a multitude of random contributors will typically have one defined, which was either worked out by the core developers, or declared by its benevolent dictator for life.

In case of the Linux kernel, that’s of course [Linus Torvalds], who has recently shaken up the community with a mailing list response declaring an overly common, often even unwritten rule of code formatting as essentially obsolete: the 80-character line limitation. Considering the notoriety of his rants and crudeness, his response, which was initiated by a line break change in the submitted patch, seems downright diplomatic this time.

[Linus]’ reasoning against a continuing enforcement of 80-char line limits is primarly the fact that screens are simply big enough today to comfortably fit longer lines, even with multiple terminals (or windows) next to each other. As he puts it, the only reason to stick to the limitation is using an actual VT100, which won’t serve much use in kernel development anyway.

Allowing longer lines on the other hand would encourage the use of more verbose variable names and whitespace, which in turn would actually increase readability. Of course, all to a certain extent, and [Linus] obviously doesn’t call for abolishing line breaks altogether. But he has a point; does it really make sense to stick to a decades old, nowadays rather arbitrary-seeming limitation in 2020?

Continue reading “Ask Hackaday: Are 80 Characters Per Line Still Reasonable In 2020?”

Why You (Probably) Won’t Be Building A Replica Amiga Anytime Soon

Early in 2019, it  became apparent that the retro-industrial complex had reached new highs of innovation and productivity. It was now possible to create entirely new Commdore 64s from scratch, thanks to the combined efforts of a series of disparate projects. It seems as if the best selling computer of all time may indeed live forever.

Naturally, this raises questions as to the C64’s proud successor, the Amiga. Due to a variety of reasons, it’s less likely we’ll see scratch-build Amiga 500s popping out of the woodwork anytime soon. Let’s look at what it would take, and maybe, just maybe, in a few years you’ll be firing up Lotus II (or, ideally, Jaguar XJ220: The Game) on your brand new rig running Workbench 1.3. Continue reading “Why You (Probably) Won’t Be Building A Replica Amiga Anytime Soon”

Samsung’s Leap Month Bug Teaches Not To Skimp On Testing

Date and time handling is hard, that’s an ugly truth about software development we’ll all learn the hard way one day. Sure, it might seem like some trivial everyday thing that you can easily implement yourself without relying on a third-party library. I mean, it’s basically just adding seconds on top of one another, roll them over to minutes, and from there keep rolling to hours, days, months, up until you hit the years. Throw in the occasional extra day every fourth February, and you’re good to go, right?

Well, obviously not. Assuming you thought about leap years in the first place — which sadly isn’t a given — there are a few exceptions that for instance cause the years 1900 and 2100 to be regular years, while the year 2000 was still a leap year. And then there’s leap seconds, which occur irregularly. But there are still more gotchas lying in wait. Case in point: back in May, a faulty lunar leap month handling in the Chinese calendar turned Samsung phones all over China into bricks. And while you may not plan to ever add support for non-Gregorian calendars to your own project, it’s just one more example of unanticipated peculiarities gone wild. Except, Samsung did everything right here.

So what happened?

Continue reading “Samsung’s Leap Month Bug Teaches Not To Skimp On Testing”

Quantum Computing And The End Of Encryption

Quantum computers stand a good chance of changing the face computing, and that goes double for encryption. For encryption methods that rely on the fact that brute-forcing the key takes too long with classical computers, quantum computing seems like its logical nemesis.

For instance, the mathematical problem that lies at the heart of RSA and other public-key encryption schemes is factoring a product of two prime numbers. Searching for the right pair using classical methods takes approximately forever, but Shor’s algorithm can be used on a suitable quantum computer to do the required factorization of integers in almost no time.

When quantum computers become capable enough, the threat to a lot of our encrypted communication is a real one. If one can no longer rely on simply making the brute-forcing of a decryption computationally heavy, all of today’s public-key encryption algorithms are essentially useless. This is the doomsday scenario, but how close are we to this actually happening, and what can be done?

Continue reading “Quantum Computing And The End Of Encryption”

Netbooks: The Form Factor Time Forgot

Long ago, before smartphones were ubiquitous and children in restaurants were quieted with awful games on iPads, there was a beautiful moment. A moment in which the end user could purchase, at a bargain price, an x86 computer in a compact, portable shell. In 2007, the netbook was born, and took the world by storm – only to suddenly vanish a few years later. What exactly was it that made netbooks so great, and where did they go?

A Beautiful Combination

An Asus EEE PC shown here running Linux. You could run anything on them! Because they were real, full-fat computers. No locked down chipsets or BIOS. Just good, clean, x86 fun.

The first machine to kick off the craze was the Asus EEE PC 701, inspired by the One Laptop Per Child project. Packing a 700Mhz Celeron processor, a small 7″ LCD screen, and a 4 GB SSD, it was available with Linux or Windows XP installed from the factory. With this model, Asus seemed to find a market that Toshiba never quite hit with their Libretto machines a decade earlier. The advent of the wireless network and an ever-more exciting Internet suddenly made a tiny, toteable laptop attractive, whereas previously it would have just been a painful machine to do work on. The name “netbook” was no accident, highlighting the popular use case — a lightweight, portable machine that’s perfect for web browsing and casual tasks.

But the netbook was more than the sum of its parts. Battery life was in excess of 3 hours, and the CPU was a full-fat x86 processor. This wasn’t a machine that required users to run special cut-down software or compromise on usage. Anything you could run on an average, low-spec PC, you could run on this, too. USB and VGA out were available, along with WiFi, so presentations were easy and getting files on and off was a cinch. It bears remembering, too, that back in the Windows XP days, it was easy to share files across a network without clicking through 7 different permissions tabs and typing in your password 19 times.

Continue reading “Netbooks: The Form Factor Time Forgot”

Books You Should Read: The Design Of Everyday Things

With everything from APIs to Raspberry Pis making it even easier for us to create and share objects shaped by personal whim, it’s high time that Don Norman’s sage design advice falls on not just the design student, but the hardware hacker and DIY enthusiast too. Grab yourself a coffee and a free weekend, and settle into the psychology of people-struggling-how-to-use-that-widget-they-just-purchased in The Design of Everyday Things: Revised and Expanded Edition.

Who’s to blame for a door that opens with a pull when everything about how it looks says it should open with a push? In Don Norman’s world, it’s not you; its the designer. Enter a world where blame is inverted and mistakes can be critically categorized. Norman takes us example by example showing us how common items in the world poorly serve the needs of their user, mainly because the designer simply ignores key aspects of our humanity. This book is a crisp, concise overview of human psychology when applied to engaging with things combined with a language of ideas to help us apply this psychology to better interactions. (And it reads like butter!)

Opening Up to the Language of Design

What’s an affordance, you might ask? Well, simply put, it’s a way that an object can be used by a human. How about a signifier? That’s a communication “signposting” scheme that object uses to suggest to you how it should be used. If that sounds a bit fluffy, just think about the last time you tried to push open a door that needed to be pulled. Something about that door was suggesting that you could push it open, but it couldn’t! It “fooled” you because all the object’s signifiers were telling you otherwise. Continue reading “Books You Should Read: The Design Of Everyday Things”

X-37B Spaceplane To Test Power Beaming Technology

Since 2010, the United States military has been operating a pair of small reusable spaceplanes that conduct secretive long-duration flights in low Earth orbit. Now officially operating under the auspices of the newly formed Space Force, the X-37Bs allow the military to conduct in-house research on new hardware and technology with limited involvement from outside agencies. The spaceplane still needs to hitch a ride to space on a commercial rocket like the Atlas V or the Falcon 9, but once it’s separated from the booster, the remainder of the X-37B’s mission is a military affair.

An X-37B being prepared for launch.

So naturally, there’s a lot we don’t know about the USSF-7 mission that launched from Cape Canaveral Air Force Station on May 17th. The duration of the mission and a complete manifest of the experiments aboard are classified, so nobody outside the Department of Defense truly knows what the robotic spacecraft is up to. But from previous missions we know the craft will likely remain in orbit for a minimum of two years, and there’s enough public information to piece together at least some of the investigations it will be conducting.

Certainly one the most interesting among them is an experiment from the U.S. Naval Research Laboratory (NRL) that will study converting solar power into a narrow microwave beam; a concept that has long been considered the key to unlocking the nearly unlimited energy potential offered by an orbital solar array. Even on a smaller scale, a safe and reliable way to transmit power over the air would have many possible applications. For example it could be used to keep unmanned aerial vehicles airborne indefinitely, or provide additional power for electric aircraft as they take-off.

Performing an orbital test of this technology is a serious commitment, and shows that all involved parties must have a fairly high confidence level in the hardware. Unfortunately, there isn’t much public information available about the power beaming experiment currently aboard the X-37B. There’s not even an indication of when it will be performed, much less when we should expect to see any kind of report on how it went. But we can make some educated guesses based on the work that the Naval Research Laboratory has already done in this field.

Continue reading “X-37B Spaceplane To Test Power Beaming Technology”