Projects

I just shipped a single-page application without any frameworks and I feel fine

This past week I built a tool for a freelance client’s website that allows their visitors to find the nearest dealer for their products.

The previous version of this tool was written in Classic ASP (which I also maintained) and pulled its data from an MS Excel spreadsheet. Yes, you read that right, an Excel spreadsheet was the backend data repository for a live website in 2016. I suspect this approach is still out there more than us modern web developers would care to admit.

Anyway, my first job was to move the Excel data out to a real database, MySQL in this case simply because that’s what the web host supported. It ended up being pretty easy thanks to Excel’s ability to export to CSV.

Next, I built out a basic search class for sending queries to the database. I needed to be able to filter the data by any permutations of the available fields (think business name, city, province, etc.). A few simple 5–10 line functions later and it was done.

The API was even easier, I just checked $_GET for my trigger argument and called the associated function in my new search class, returning the result as a JSON payload. This made implementing the client JavaScript super simple.

Other than jQuery (simply for the XHR abstraction) the client-side was built with vanilla JavaScript. I had a few functions for drilling down in the filters, for example, if you selected a province I would only show ‘city’ options that were in that province. There was also one for rendering the HTML of search results. None of these were more than 15 lines of code.

I’m quite happy with how it all turned out and so is my client since they understand the code without having to learn some framework. They’re also able to make some changes on their own without having to involve me, which quite honestly I’m ok with.

Don’t get me wrong, I’m not against web frameworks, I find them quite useful when they’re appropriate. I do firmly believe that not all web things are in need of a framework. Next time you’re tackling something small, see what it’s like to write it by hand. You might just surprise yourself with how easy it can be and how simple the result ends up.

Posted by Wally in Programming, Projects, 0 comments

Does anybody need a monitor?

UPDATE: As of this Sunday, March 15th, this monitor will be visiting a recycling centre.  If you are interested in taking it off my hands and can pick it up, it’s yoursJust let me know!

I realize that I currently only receive about 5 hits a day to this page and that is my own damned fault since it has been nearly a year between this post and the one below it.  However I’m still going to go out on a limb and mention that I have a CRT monitor in my office that I am simply getting tired of looking at, does anybody want it?

Here’s the details:

Model NEC MultiSync Fe950+
Max resolution 1600×1200 @ 76Hz
Viewable size 18 inches
Size 44.2cm(w) x 44.8cm(h) x 44.4cm(d)
Extras OptiClear technology
Anti-static dark-tint screen

I managed to find a link to a review over at PCWorld.  They mention that it is a great display for graphics work, which I can’t argue with, this is an awesome screen.

Multisync950

I’m looking to find a home for this screen since it is still in great working condition.  I’m asking for $100 but I’ll accept any reasonable offers.  I have recently seen this same screen listed for $130 on Ebay.  I don’t want to ship it so I’m looking for somebody that would be able to meet to pick it up in the Burlington – Oakville Ontario region.

If you’re interested please let me know at wally@power-coder.net.  If you have any questions please feel free to ask them in the comments, that way everybody can benefit from them.

As for the rest of the stuff on this site, I have plans, check back soon and you might be surprised.

Cheers,
Wally

Posted by Wally in Programming, Projects, 0 comments