Modern techniques that don’t have hidden pain points

Image for post
Image for post
Pixabay

Plenty has changed in JavaScript over the last five years, and the humble array is the perfect example. We used to spend our time writing iterative logic with loops and flags, hunting for values, or laboriously copying elements from one array to another. Now, destructuring, spread syntax, and a neat set of modern methods that use function-based processing. Applied well, these features can help us write clearer, more concise code — code that’s more likely to survive future cycles of development without accruing difficult-to-spot bugs. Applied poorly, and it’s just a mishmash of new buzzwords and old habits.

Recently, I’ve written about my work to update some creaky JavaScript from years past. Surprisingly, modernizing the array-handling code has been the most fun. Here are some of the techniques I’ve used. …


Microsoft made big promises about its dramatic platform reboot. So how did they do?

Image for post
Image for post
Photo by PxHere

In a year full of unexpected disruptions, you could be excused if you missed Microsoft’s massive milestone. But here were are — as of November 10th, .NET 5 is an official release, replacing both .NET Core and the .NET Framework.

As we explained last year, .NET 5 isn’t just a bundle of new features. It’s the conclusion of a major effort to port .NET to a cross-platform, open source architecture. Essentially, it’s a mission to rebuild .NET, without disrupting the developers who currently rely on it for mature, deployed applications. The change isn’t without risk. …


Microsoft spent 7 years trying take over the design world. Few remember.

Image for post
Image for post
Today, a commemorative t-shirt is all that remains of Expression Studio

Every good tech company watches its competitors closely, searching for innovations that might overturn the current order. And if anyone holds the Silicon Valley record for corporate paranoia, it’s Microsoft. In the fifty years since the company was established, they’ve never stopped nervously eyeing their competitors, and rushing out new products to try to steal emerging niches.

Sometimes Microsoft failed, but mostly they succeeded. In the distant 1980s, when booting up a computer was a thumb-tapping ritual of patience, Microsoft conquered software pioneers WordPerfect, Lotus, and Harvard Graphics, because office software was where the business customers were. In the 1990s, they launched the mediocre Internet Explorer browser and ruled the web with it for years, because Netscape had mused about a world of browser-based computers that wouldn’t need Microsoft operating systems. In the early 2000s, Microsoft shadowed Sony and introduced the Xbox, just in case the future world would revolve around gaming systems and entertainment rooms. …


Keep these obsolete patterns out of your code

Image for post
Image for post
Courtesy of Icons8

Recently, I wrote about my new labor of love — replacing old JavaScript code with more modern practices for the tech publisher O’Reilly. The job involves staring down some dust-collecting scripts from five or ten years ago. In a short amount of time, I’ve seen plenty of old routines that still work, but don’t reflect today’s best approaches.

Which raises a good question. When is it time to intervene? If you’re dealing with proof-of-concept examples and company standards, you want the best possible solution every time. But if you’re looking a complex and established codebase, there’s a good case to be made for stepping carefully. Make changes when you need to touch the code for another reason (for example, to add an enhancement). Make changes when you’re opening up an old module to add test coverage. Make changes before you consider using the same code or approach in a new project. …


We’ve lived with C# for two decades. How much has it changed?

Image for post
Image for post

When C# first appeared in the summer of 2000, it was immediately clear that something was different. At the time, Microsoft was a massively dominant software company, but it wasn’t known for crafting its own programming languages. Instead, Microsoft preferred to build its own implementations of standard languages (like Visual C++ for C++, or Visual J++ for Java), and amplify them with proprietary frameworks (like MFC). Truth be told, they hadn’t created a language that was entirely their own since BASIC.

But Microsoft’s “great platform reset” — the shift from COM to .NET — unleashed new ambitions and gave rise to two major new languages. One (VB.NET) evolved slowly over the years before eventually slipping into near-irrelevance. …


The web is full of dangerously old code. Here are some gems that cover today’s JavaScript.

Image for post
Image for post
Courtesy of Icons8

The web is drowning in outdated JavaScript advice. You probably already knew this. I certainly did. But I didn’t really grasp the size of the problem until I started to dig into some old code.

Recently, I’ve been helping to update an old (but classic) JavaScript book from tech publisher O’Reilly. On the way, I’ve been researching corners of JavaScript that I haven’t touched in a while. And I’ve come across plenty of awful advice.

The problem isn’t clickbait. (It’s pretty easy to spot when a writer is more interested in getting you to scroll past a few ads than to share some genuine insight.) The problem is old content that no longer represents best practices. And the search ranking of this content is often surprisingly high. If you aren’t specifically looking for a hot new feature that was introduced with one of the last few ECMAScript releases, the sheer weight of old information often overwhelms newer and more relevant content. …


What happens when a successful OO language cross-pollinates with FP ideas?

Image for post
Image for post

There are programming languages, and there are the ways we use them. Sometimes the two line up, and sometimes our expectations and conventions obscure the full range of possibilities.

For example, many programmers who’ve never touched a line of C++ think of it as an object-oriented version of the ancient C language. And they’re not entirely wrong (after all, C++ is a direct evolution of an experiment called C with classes). And yet, any modern-day developer who actually uses C++ knows that it’s a wide-open multiparadigm language that can go in plenty of different directions.

C# is a different story — or is it? It started out as a streamlined, Java-influenced, thoroughly object-oriented language. (For a brief time, it was even codenamed Cool, for “C-like Object Oriented Language.”) But recently, the ground has been shifting. Among the many improvements in C# 9 — the version we’ll see released this year with .NET 5 — are some features that have the distinct flavor of functional programming. …


You can become a better developer if you understand these security principles

Image for post
Image for post
Illustration adapted from Icons8

Cryptography is the science of secrets. In the distant past, it was simply about scrambling messages so adversaries couldn’t read them. In the modern computing era (a span of time that stretches less than 50 years), cryptography has become a keystone of computer security, encompassing all the ways we hide data, verify identities, communicate privately, and prevent message tampering.

Something else has changed, too. Today, every developer needs a solid grasp of security and cryptography basics. The stakes are simply too high to ignore them. You can’t reverse an exploit that’s already happened. …


The summer of 2020 will be remembered for plenty of things. A new disease briefly closed the world. Life turned into a never-ending Zoom meeting. And politics went from ordinary crazy to full on bonkers QAnon insanity.

And over at Young Coder, we rolled out some of our most successful stories ever. So if you’re looking for a diversion from all the other stuff, check out the top tech stories that we published this summer:

  1. What’s behind the current obsession with attacking OOP? Find out in The Case Against OOP is Wildly Overstated.
  2. Microsoft and Python: a match made in Heaven or Hell? …


Good programmers follow the insights. Poor programmers worship the rules.

Image for post
Image for post
Wisdom from above [Wikimedia Commons]

Programmers love rules. We make sweeping architectural commandments and canonize them with official acronyms (like DRY, YAGNI, and SOLID). We make fine-grained laws and legislate tiny details. (See, for example, this research paper that use eye-tracking cameras to argue whether camelCaseNaming is better than underscore_naming.)

And once we make rules, we start to argue.

When the internet was small enough that you could fit all the world’s web servers into an empty swimming pool, coders were already using it to roast each other about the right way to program on usenet. Flame wars could be about foundational coding philosophies, or minor details like tabs versus spaces. Visual Basic was scorned for years for plenty of good reasons and at least one trivial issue — its convention of counting array indexes starting at 1 instead of 0. …

About

Matthew MacDonald

Teacher, coder, long-ago Microsoft MVP. Author of heavy books. Join Young Coder for a creative take on science and technology. Queries: matthew@prosetech.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store