Website may be up and down over next few months. I'm currently doing a complete overhaul of everything. Going back to simple individual .htm pages, new overall site theme, sanitizing and cleaning up html of all pages and blog posts, attempting to implement a new tooling and publishing system etc etc.

Today I was writing some C# code where I needed to manage a multidimensional array. Specifically I needed to store a items using Column, Row, & Depth as indexers. Instead I wrote a Array3D class that used generics to store any type and internally it uses a single dimensional array and a little bit of math to select the right index.

Not long after I started writing it Déjà vu set in. You know I could have swore I’ve written this class some time ago. Searching through hundreds of projects and tens of thousands of files dating back to 2001 ala .NET 1.0 I came up with nothing. I even went a little nuts and searched back further into my old Turbo Pascal and QBasic code but still found nothing.

Google, DuckDuckGo, & Bing searches were no help either. I could not shake the feeling I have written or have come across this code before. Maybe not in C# but in some other language. I’m sure I have …

This is not the first time I have started to write code and had a strong sense that I have written this code before as I’m sure many programmers do. Maybe it’s just me but with all our modern fancy IDE’s and add-ons archiving code for long periods of time, as in decades, does not seem to be something that has been readily addressed. If there is one thing I absolutely hate is having to repeat my self to the computer when it comes to coding. it’s also why I have visual studio set to auto save every 60 seconds.

Also hard to believe .NET is pushing 12+ years already. Hard to believe that the so called high tech industry essentially has not changed at all since the early 1960’s. Yes, 1960’s & 70’s that’s the era when the first high level languages were originally developed. And here we are 50+ years later and were still just an endless sea of primates spanking our hands on the keyboard just hoping for the best. But that is a rant for another time. :P

So to try and address the issue of code loss I have decided to start a “Code Snippets” series to archive various code snippets in an effort to make searching for them a little bit easier.


Add comment



biuquote
  • Comment
  • Preview
Loading






Created by: X

Just another personal website in this crazy online world

Name of author Dean Lunz (aka Created by: X)
Computer programming nerd, and tech geek.
About Me -- Resume