Martynas Bardauskas

Martynas Bardauskas

Readings: Clean Code by Uncle Bob

One of my recent readings was Clean Code by Robert C. Martin. Thorough book with lots of examples on it. Firstly, the author describes the principles, patterns and practices of writing clean code. Then introduces several case studies of code cleanups with varying complexity. And at the end, introduces a list of “code smells” and heuristics.

What I really liked about this book is how the author shows the whole process of refactoring in detail, step by step. I used to think that such rock star programmers simply have this incredible brain capacity to tackle down big problems and refactor stuff in one go. Reading the book helped me understand that this is not the way to go. Simply by doing lots of small refactorings helps you isolate one problem at a time and work on it effectively, quickly moving on to another. In the end, you have more features and cleaner code. Not surprisingly, the tests plays a big part in such refactoring cycle.

Read More

Automated cache busting with Gulp

You probably want most of your image and other resources to be cached, so the users would have fast page loads with each page reload. Cache is great until there’s a need to update the website. Busting cache allows to have cached resources and painless updates.

There are ways to bust cache. Some use filename revving, some rely on query string for filenames. Some leave it to their CMS and others don’t think about it at all. I’ll cover only filename revving since it seems to be most effective.

Read More

Hello World v2

It’s been a while since my last post.

Lately I’ve been really interested in static website generators. I believe it is the future for most of the promo websites, since they they are all basically static websites, but using CMSes for easier content management. Also, static content is secure (because there is nothing to hack) and faster - everything is already processed so you just need to download it and view it.

The biggest drawback for static website generators is ease of use - now you have to be a bit technical person to edit content. However, in time, I believe, the content editing process for static website generators will be as simple as with any popular CMS. Well, it almost is. If you are able to setup a wordpress website by yourself, you will be able to use a static website generator with command line interface.

I was pleasently surprised by how easy it is to migrate from wordpress to, for example, Hexo. All you need is Hexo, Hexo plugin for migration and wordpress export file. With few command lines you are done. It took me roughly 15mins to go through the docs, play around with it and migrate the content.

I didn’t stop there though. After migrating the blog, I’ve decided that I need a CI for the blog, so I’ve created a git repo for the blog source and build process with Jenkins on my raspberry pi (a real use at last!). The latter took me a lot longer than the migration, but that was due to the fact, that I haven’t used Jenkins before. And raspberry pi is quite slow, the build process takes a lot longer than on my local machine. Anyway, now it’s automated!

Reading

It pays off to have a few days off (or weeks) without a constant internet connection to catch-up on other things you always wanted to do. One of those things for me was reading JavaScript books I have on my kindle for quite some time now. Particularly I wanted to finish reading “JavaScript: the Good Parts” by Douglas Crockford.

The book was preached by the people who read it and recommended it to me, though for me it did not live up to its name. Some of the content seem outdated and the methods seem to be controversial. If you are constantly reading up and following what’s new in JavaScript world, you might feel the same way after reading it. Nonetheless, it had useful parts for me.

Read More

Leaving architecture and becoming a web developer

Two years ago (8th of November to be exact) was my last day as an architect. Fortunately and coincidentally, the next day I started working as a web developer. Here’s my story.

From the beginning

I was always fascinated by technology, computers and web. Especially web. I’ve been playing around with MS Frontpage, Dreamweaver (I know I know, bare with me) and Flash since I got an internet connection.That was around 14 years ago. I remember I sold my first flash website 12 years ago being a teenager. Everything I knew I’ve learned from the web or by trial and error.

Read More