Prism: lightweight, extensible syntax highlighter

In the process of wanting to start writing some more technical blogs, I was going to want to display code snippets and examples on my posts.

I did some searching and looking at several different implementations of getting this done. At the end of the day I ended up choosing Prism.

The main deciding factors that I had were that it was very easy to choose your options like theme, and languages, and some other cool features through plugins. Then you generate your .js and .css files that you can load directly into your site, very light weight.

One of the resources I found very useful while adding this functionality to my WordPress site was this tutorial . It walked me through adding the necessary files to my site and loading/ enqueue them to be picked up and loaded by the site, as I am pretty new to using a tool like WordPress to do everything for you, rather than building up the entire infrastructure myself.

Prism makes it very easy to just wrap your examples in a set of <pre> and <code> tags, and just tell it what language with a class name on your code tag.

<pre><code class="language-csharp">
… code
</code></pre>

Turns into

// HelloWorld.cs
using System;

public class HelloWorld
{
  public static void Main(string[] args)
  {
    Console.WriteLine("Hello, World!");
    for (int i = 0; i < args.Length; i++)
    {
       Console.WriteLine("{0}", args[i]); 
    }
  }
}

Book Review: The Pragmatic Programmer: From Journeyman to Master

The Pragmatic Programmer: From Journeyman to Master
By Andrew Hunt, David Thomas
The Pragmatic Programmer: From Journeyman to Master

The Pragmatic Programmer has been suggested to me by almost every source that I’ve looked to for suggestions on development books. Here I will highlight some of the take aways I had from the book.
One of the first things they get into is the idea of not committing to too much work. Be realistic about what is at hand. Don’t tell your boss that you can finish something by Friday, if it is clear that you cannot. Be flexible on the scope of the project.

Along those lines, they spend a lot of time going into the ideas of finding out what you’re working on. Take the necessary time to prototype, to build a solid understanding of what it should do, speak with stakeholders and use a language that you can both understand. Transition that language into the code. Name your development objects after the language you are using with the stakeholders and clients so that nothing gets lost in translation.

In agile/scrum, which we use at work, there is an emphasis on creating small ‘vertical slices’ of fully functional and deliverable product. In the book, they describe a technique of using ‘tracer bullets.’ Build the smallest piece of work that you can, that can aim at what you’re trying to hit. Does not have to be anywhere near fully functional, but lets you know if you are on track.

I really like their mention of the ‘broken window’ philosophy. Clean things up as you go along. As soon as you have bad, ugly, fragile code (a broken window), people are less likely to keep respect for it. When they (or you!) come into your code base, if it already has broken windows, they are more likely to feel comfortable committing less than perfect code as well. If it is all in good order, reads well, works well etc then you and others are more willing and likely to keep following that pattern.

I like their ideas of thinking in the mindset of ‘good enough.’ Scrum also emphasizes this paradigm. It is completely okay to iterate on your work and go back and forth with your users and stake holders to decide when you have met their needs. Deliver fast and often and you will know what is needed and what is not. There is nothing wrong with removing features that you thought were going to be useful, but no longer are. The same goes for the technologies you use. Just because another framework or library is going to do the job ‘better,’ if it’s going to take you twice as long to implement it or refactor to use it, it may not be worth it.

A big part of the book is dedicated to keeping up on your learning. To most of us, this should be a no-brainer. Our technology world is moving very fast. You need to spend time every week keeping up on current technologies and researching new ones. This does not mean you have to learn everything under the sun, but you should be keeping in the loop of what is going on and learning what is relevant.

They spend a lot of time describing how to use a good set of tools. The most important being your text editor. Make sure you are using a powerful, configurable tool. Get good at it. It will make your life much more productive. Spend time learning, using, and getting good at other tools that make your life easier as well. Build, automation, scripting, configuration, generation tools etc.

Motivation to start blogging

I would like to tell you a little bit about my motivation to start a blog.

My employer is pretty generous when it comes to learning.  They offer a lot of dedicated time to do learning and also to do open source.  They also provide a lot of subscriptions to software licenses etc, and one of the ones that I have taken advantage of a lot is www.pluralsight.com, where you can even get a free trial, which I highly recommend!  I will have another post on how valuable pluralsight has been for me, and possibly some reviews and recommendations of courses. But until then, go grab your free trial and try it out yourself!

Start a 10-day free trial at Pluralsight

I have watched dozens of courses and spent countless hours learning there.  John Sonmez of  simpleprogrammer.com is one of my favorite content providers there.  I would like to say that I took the time to go look him up after I had seen a few of his courses.  But, it wasn’t until a year or so later that I started listening to podcasts in the car and heard his name mentioned that I realized that he was well known and followed up to see what else he had to offer.

I started listening to his pod cast library, and looking at the rest of what he offered.  One of his suggestions was to create a blog.  I had always wanted a place to document my ideas and a place to share my ideas and what I had learned, both inside my company and more broad.  So I bought his blogging course which can be found here simpleprogrammer.com/blog-course.

John has a lot of good knowledge to share, even beyond programming.  I’ve watched, read and listened to a lot of his opinions on finances, real estate and what he calls soft skills.  I think it is a really good idea to keep a good balance in your life and be able to take care of you and your body, outside of your daily work.  He has a great book that talks about a lot of this, which you can also listen to on Audible.
Soft Skills: The software developer’s life manual
Try Amazon Prime 30-Day Free Trial
Try Audible and Get Two Free Audiobooks

I think it is also important to get your learning from many different avenues.  So I suggest reading books, listening to podcasts, watching videos, pair programming with others, any training that you can find.  And, mix it up.  Don’t just learn about your primary language or frameworks or architectures that you are working in.  Find out what else is going on in the technology world.  I will have some posts on some of my suggestions.

Hello and welcome to Smart Dev Now!

My name is RJ Schmertz.  I am a growing software developer that would like somewhere to write down my thoughts and ideas, for a couple of reasons.  I’ve always believed that reiterating something will help you remember it better, it can be living documentation and who knows, maybe I’ll be able to share some of my knowledge and experience with some others.

My goal for this blog is to capture information that is in my head, things that I have to learn or knowledge that I will gain as I go along.  And, to share that here.

I currently work for a pretty large global corporation in a dev shop that primarily writes services, tools and web applications on a C# .NET backend with a mix of technologies for our javascript frameworks, primarily AngularJS and ReactJS.  We have a good amount of legacy code in older frameworks like WPF, Knockout & Backbone, and even Silverlight.

We are a little bit unique in the fact that we write almost 100% of the software that we use.  We have large call centers and we’ve created all the software that keeps the call center running, from call routing and administrative tools to the actual software the agents are using, the services that handle all the data and transformations, integrating with 3rd parties all over the world to distribute that data, service bus software to handle the distributed nature of the work, internal web tools and of course a public facing website for our main product.

I feel blessed to work for a company where I get to touch so many types of software, in so many different languages and architectures.  But, as you can imagine, it keeps my mind busy.  I am constantly learning something new for every project that I touch.  Which I love!

So, that is why I’m here.  I need a dumping ground for all of the knowledge that is going through this brain of mine.  I hope to remember some more things, have some things documented, help some others learn, and maybe meet some cool people on the way.

Thanks for visiting!