“Good Code Documents Itself” And Other Hilarious Jokes You Shouldn’t Tell Yourself

Code documentation — is there anything more exciting than spending your time writing extensive comments? If I had to guess, your answer is probably somewhere along the lines of “uhm, yes, everything is more exciting than that”. Plus, requesting to document your code is almost like an insult to your well thought out design, this beautiful creation you implemented so carefully that it just has to be obvious what is happening. Writing about it is just redundant, the code is all you need.

As a result, no matter if it’s some open source side project or professional software development, code documentation usually comes in two flavors: absent and useless. The dislike for documenting ones code seems universal among programmers of any field or language, no matter where in the world they are. And it’s understandable, after all, you’re in it for the coding, implementing all the fun stuff. If you wanted to tell stories, you would have chosen a different path in life.

This reluctance has even formed whole new paradigms and philosophies claiming how comments are actually harmful, and anyone trying to weasel their way out of it can now happily rehash all those claims. But, to exaggerate a bit, we’re essentially villainizing information this way. While it is true that comments can be counterproductive, it’s more the fundamental attitude towards them that causes the harm here.

In the end, code documentation is a lot like error handling, we are told early on how it’s important and necessary, but we fail to understand why and instead grow to resent doing it again for that same old teacher, supervisor, or annoying teammate. But just like error handling, we are the ones who can actually benefit the most from it — if done right. But in order to do it right, we need to face some harsh truths and start admitting that there is no such thing as self-documenting code, and maybe we simply don’t understand what we’re actually doing if we can’t manage to write a few words about it.

So let’s burst some bubbles!

Continue reading ““Good Code Documents Itself” And Other Hilarious Jokes You Shouldn’t Tell Yourself”

Forget The Kiln, These Tiles Were Made On A Prusa

Where does your mind go when you think of 3D printed parts? Running off hard to find replacement components? Maybe spinning up a bespoke electronics enclosure? Occasionally the little boat that you can compare to the little boats of others online? All reasonable enough answers. But thanks to the work of [Matthew Wentworth], you might have a new mental image to associate with the smell of melting PLA: decorative Portuguese Azulejo tiles.

As difficult as it might be to believe, the tiles you’re seeing here weren’t made on some exotic ceramic printer, but a standard Prusa i3 MK3. Well, at least they started on the 3D printer. As you might have guessed, there’s a bit more involved than that.

That said, the idea is actually quite simple. The printed “tile” is just the base plate, plus the raised elements that will eventually be seen on the surface. Everything else is just a void, which naturally saves a lot on printing time and material. Once the print is done, premixed spackling paste is pushed into all of the open areas and the top is made as smooth as possible with a putty knife. The filled tile is then left to dry for 24 hours or so.

Once it’s dried, you take the tile outside and sand the top down with a palm sander (or by hand, if you have the patience). This not only smooths out the spackle, but eventually will expose and then smooth the top parts of the print. Once everything is nice and silky, it gets sprayed with a semi-gloss clear coat to both protect it and give it that authentic looking shine.

[Matthew] actually created his designs based on images of real Azulejo tiles he found online, but really any sort of image that has raised elements like this could be made to work. If anyone out there decorates their home with 3D printed Jolly Wrencher tiles, you know where to send the pictures. Interestingly, these aren’t the first tiles we’ve seen made out of plastic, but we’ve got to admit these ones would look quite a bit more appealing on your kitchen walls.

Making A Hammer With Beautiful Engravings

Tools are a key part of any maker’s pursuit of their work. For most of us, our tools come from the local hardware store or are purchased online. Some prefer to craft their own, however, and [Uri Tuchman] is just one such person.

[Uri] starts at the absolute beginning, with a piece of unfinished rectangular stock. The workpiece is marked up, and the shape of the hammer head meticulously filed out by hand. The wooden handle is similarly prepared from raw stock with a combination of planes, chisels and files.

It may not be the fastest way to work, but careful hand craftsmanship is always impressive to watch. The build also showcases [Uri]’s talent at engraving, with the complex designs all carved out of the surface a millimeter at a time. [Uri] recommends enamel paint to highlight such works, for its rich color and the ease of removing excess paint.

Where [Uri] has built a beautiful piece of art that moonlights as a hammer, it’s possible to go in completely the opposite direction with a build. Video after the break.

[Thanks to BrightBlueJim for the tip!] Continue reading “Making A Hammer With Beautiful Engravings”

The Primordial Sinclair ZX Spectrum Emerges From The Cupboard

The Centre for Computing History in Cambridge, UK, receive many donations from which they can enrich their collection and museum displays. Many are interesting but mundane, but the subject of their latest video is far from that. The wire-wrapped prototype board they reveal with a flourish from beneath a folded antistatic mat is no ordinary computer, because it is the prototype Sinclair ZX Spectrum.

It came to the museum from Nine Tiles, a local consultancy firm that had been contracted by Sinclair Research in the early 1980s to produce the BASIC ROM that would run on the replacement for their popular ZX81 home microcomputer. The write-up and the video we’ve placed below the break give some detail on the history of the ROM project, the pressures from Sinclair’s legendary cost-cutting, and the decision to ship with an unfinished ROM version meaning that later peripherals had to carry shadow ROMs with updated routines.

The board itself is a standard wire-wrap protoboard with all the major Spectrum components there in some form.  This is a 16k model, there is no expansion connector, and the layout is back-to-front to that of the final machine. The ULA chip is a pre-production item in a ceramic package, and the keyboard is attached through a D connector. Decent quality key switches make a stark contrast to the rubber keys and membrane that Spectrum owners would later mash to pieces playing Daley Thompson’s Decathlon.

This machine is a remarkable artifact, and we should all be indebted to Nine Tiles for ensuring that it is preserved for those with an interest in computing to study and enjoy. It may not look like much, but that protoboard had a hand in launching a huge number of people’s careers in technology, and we suspect that some of those people will be Hackaday readers. We’ll certainly be dropping in to see it next time we’re in Cambridge.

If you haven’t been to the Centre for Computing History yet, we suggest you take a look at our review from a couple of years ago. And if prototype home computers are your thing, this certainly isn’t the first to grace these pages.

Continue reading “The Primordial Sinclair ZX Spectrum Emerges From The Cupboard”

Reducing Carbon Emissions With Coal

It might seem like a paradox, but coal might hold the answer to solving carbon emission problems. The key isn’t burning it, but creating it using carbon dioxide from the atmosphere.  While this has always been possible in theory, high temperatures make it difficult in practice. However, a recent paper in Nature Communications shows how a special liquid metal electrocatalyst can convert the gas into a solid form of carbon suitable for, among other things, making high-quality capacitor electrodes. The process — you can see more about it in the video below — works at room temperatures.

It isn’t that hard to extract carbon dioxide from the air, the problem is what to do with it. Storing it as a gas or a liquid is inefficient and expensive, while converting it to a solid makes it much easier to store or even reuse for practical applications.

Continue reading “Reducing Carbon Emissions With Coal”

Simple Hack Completely Changes The Sound Of This Piano

We’re partial to musical instrument hacks around here, mainly because we find instruments to be fascinating machines. Few are more complex than the piano, and, as it turns out, few are quite so hackable. Still, we have to admit that this ragtime piano hack took us by surprise.

We always thought that the rich variety of tones that can be coaxed from a piano, from the tinny sound of an Old West saloon piano to the rich tones of a concert grand, were due mainly to the construction of the instrument and the way it’s played. Not so, apparently, as [Measured Workshop] demonstrated by installing a “mandolin rail” in a small upright piano. The instrument had seen better days, so step one was disassembly and cleaning. A wooden rail spanning the entire width of the string board was added, with a curtain of fabric draping down to the level of the hammers. The curtain was cut into a fringe in the same spacing as the hammers – marking the hammer locations with cornstarch was a nice trick – and metal clips were crimped to each fringe. The completed mandolin rail can be raised and lowered using a new foot pedal, completely changing the tone as the hammers hit the strings with the metal clips rather than their soft felt heads. It makes the piano sound a little like a harpsichord, or the aforementioned saloon instrument, and at the touch of a foot, it’s back to its original tone.

Most of the piano hacks we offer tend toward the electronic variety, so it’s nice to see a purely mechanical piano hack for a change. And if the hacked piano doesn’t work out as an instrument, you can always turn it into a workbench.

Continue reading “Simple Hack Completely Changes The Sound Of This Piano”

Sim Panel Proves You Can Always Use More Buttons

Many people enjoy playing flight simulators or making the occasional orbit in Kerbal Space Program, but most are stuck controlling the onscreen action with nothing more exotic than a keyboard and mouse. A nice compromise for those that don’t have the space (or NASA-sized budget) to build a full simulator cockpit is a USB “button box” that you can plug in whenever you need a couple dozen extra knobs, switches, and lights.

If you’ve been considering building one for yourself, this incredible build by [nexprime] should prove quite inspirational. Now at this point, a box of buttons hooked up to a microcontroller isn’t exactly newsworthy. But there are a few features that [nexprime] packed in which we think make this particular build worth taking a closer look at.

For one, the powder coated 8.5” x 10” enclosure is absolutely gorgeous. The console itself was purchased from a company called Hammond Manufacturing, but of course it still took some work to turn it into the object you’re currently drooling over. A CNC machine was used to accurately cut out all the necessary openings, and the labels were laser etched into the powder coat.

But not all the labels. One of the things we like best about this build is that [nexprime] thought ahead and didn’t just design it for one game. Many of the labels are printed on strips of paper which slide into translucent plastic channels built into the front of the box. Not only does this allow you to change out the overlays for different games, but the paper labels look fantastic when lit with the LED strips placed behind the channels.

Internally, [nexprime] used a SparkFun Pro Micro paired with a SX1509 I/O expander. The electronics are all housed on professionally manufactured PCBs, which gives the final build an incredibly neat look despite packing in 68 separate inputs for your gaming pleasure. On the software side this box appears as a normal USB game controller, albeit one with a crazy number of buttons.

If this build doesn’t have enough switches and buttons for you, don’t worry. This Kerbal Space Program cockpit has banks of switches below and above the player, so one can more realistically scramble for the correct onet to flip when things start going sideways. On the other hand, we’ve seen slightly less intense builds if you’re not quite ready to take out a loan just to get into orbit.