# Programming posts

Programming

#### Goldilocks and the Three Functions

###### 2017-03-05

How much code is enough code? Does the phrase “less is more” apply here? Some people take pride in condensing their code into “one-liners,” but the reality is that makes for obtuse, unmaintainable code where defects love to hide. Sure, there are some cases where gaining performance or some other type of efficiency justifies writing code that’s a little hard to follow, but as a general rule I avoid this kind of code whenever possible.

Programming

#### Reading the Event Log with Windows PowerShell

###### 2015-12-03

This post is part of the #PSBlogWeek PowerShell blogging series. #PSBlogWeek is a regular event where anyone interested in writing great content about PowerShell is welcome to volunteer for. The purpose is to pool our collective PowerShell knowledge together over a 5-day period and write about a topic that anyone using PowerShell may benefit from. #PSBlogWeek is a Twitter hashtag so feel free to stay up to date on the topic on Twitter at the #PSBlogWeek hashtag. For more information on #PSBlogWeek or if you’d like to volunteer for future sessions, contact Adam Bertram (@adbertram) on Twitter.

Programming

#### Internationalization with Import-LocalizedData: Part 2

###### 2015-08-27

When I first sat down to write this post, this one came out instead. If you’re not familiar with the Import-LocalizedData Cmdlet, you might want to start there.

Programming

#### Internationalization with Import-LocalizedData

###### 2015-08-24

Recently I was working on a PowerShell project that involved internationalization. When researching the best approach, I learned about the Import-LocalizedData Cmdlet and it made it incredibly easy to support internationalization in my scripts.

Programming

#### Strong Typing Considerations

###### 2013-07-31

You could also call this one “Why I Hate JavaScript,” but there are many popular languages today that do not employ strong typing. JavaScript was just the language I happened to be working in when the following code had me pulling my hair out for nearly twenty minutes:

Programming

#### A Small but Useful PowerShell Script

###### 2013-04-16

I always keep this little script handy for when I need to search my source code for instances of a particular word or phrase. Most modern IDEs have this kind of functionality built in, but you never know when you'll have to work with a language or tool that isn't quite as robust.

Programming

#### Ruby Woes - Can't Modify Self

###### 2013-04-11

I’ve always liked to think that anyone can change if they want to badly enough.  After about half an hour of searching, I discovered that Ruby objects, within the context of class methods, cannot.  I was looking to extend the Numeric class (this is something really cool you can do in Ruby) to add a method that would “clamp” the number to be within a certain range, between a minimum and a maximum value.  For example:

Programming

#### Searching Your Code with Windows PowerShell

###### 2010-08-12

I frequently need to search through source code to find references to variable and object names. When I got a new workstation running Windows 7 x64, I wanted to find a search utility that would take full advantage of all the horsepower I had at my fingertips. Previously, I had used Windows Grep, but There didn’t seem to be an x64 version available. After some searching I found a lot of people pointing towards Windows PowerShell.

Programming

Programming

### Authors: Ben Collins-Sussman, Brian W. Fitzpatrick, C. Michael Pilato

Programming

#### Mandatory Programming Education

###### 2008-10-06

I recently read this article at InfoWorld which discusses the idea of requiring students at the middle or high school level to learn how to program. The author, Neil McAllister, cites the increasing need for basic computer literacy in our technology-dependent world. While I agree that computer literacy is of critical importance today, I don’t entirely agree that courses on programming are the way to get there, at least not the way programming courses are taught currently.

Programming

#### Caching Object Data with Time Stamps

###### 2008-09-18

When you build an application backed by a database, one of the things you want to minimize is the amount of data transfer between the application and the database. There are, of course, two types of data transfer: the application retrieving data from the database, and the application sending data to the database. In this post, I want to focus on the former type.