Tag: technology

  • why you should learn powershell

    Are you already a user of Powershell? You should be, if you work with Windows at all. Microsoft describes Powershell thus:

    Windows PowerShell® is a task-based command-line shell and scripting language designed especially for system administration.

    That description is accurate but it really only scratches the surface. I would say Powershell is useful for anything from simple repetitive tasks to complex scripts or even full-on programs. For instance, my wife and I took a trip a few years ago, and we both took several hundred pictures with our respective cameras. I wanted to be able to put the pictures in an online album and have them arranged in proper chronological order. My pictures had names like P123456 and hers had names like CIMG1234; for both cameras the numeric part would increment with each picture. The problem is that standard alphabetic sorting would result in her pictures and mine staying separate. Enter Powershell: with one line of typing I was able to rename all the pictures so that an alphabetic sorting would properly show the pictures in chronological order.

    That’s probably not enough to sell you on the idea, so here’s a slightly more structured pitch:

    It’s great for customer support
    Whether your customers are the normal kind (the ones that pay you in dollars) or the informal kind (the family members that pay you in cookies), Powershell is great for customer support. All recent versions of Windows come with it already installed, so if you know how to use it, you have a ready-made tool for solving problems. No extra work required. This can be a life saver if you don’t have access to your regular geek toolkit.

    You don’t have to be a programmer
    Powershell was designed to be used by non-programmers. You don’t have to understand all the rules of C# or Java, you just have to understand a few simple concepts and be willing to experiment. You can also find tons of recipes online and in print for solving different problems. You’ll find you can do amazing things with very little typing.

    It will make you smarter
    If you already know how to program, Powershell will help you learn to think in different ways, since working with the object pipeline is comparable to functional programming, whereas most programmers do imperative programming. Or you can stick to what you know and write it like it’s C. Or you can mix and match!

    It makes a great bridge to “serious” code
    Since Powershell is built on the .NET platform, it easily connects to existing C# components. This means that you can do anything that the huge .NET Base Class Library can do. It also makes a great tool for automating large applications, especially if you take the time to build proper cmdlets.

    There you have it – four good reasons to learn Powershell. What are you waiting for?

  • 17,000 heads are better than one

    StackOverflow.com opened for business about a month ago. It’s dedicated to asking and answering concrete questions about programming. It already has more than 17,000 registered users, who have asked more than 31,000 questions. More than 90% of these questions have at least one useful response.

    This is great news for programmers.

    You probably know that computers are stupid, as evidenced by the incredible frustration they often cause. Programmers are tasked with training these blazingly fast mechanical morons to do useful tasks, and even the buggiest program probably represents hundreds or thousands of hours of someone’s time. Everything your word processor or email program does, every button and graphic, somebody made that happen. And it’s not easy.

    I recently had to implement printing in a basic graphing application. Going into it, I told several people that I figured it should be pretty straightforward, maybe a day or two of work. I’ve been doing this for almost ten years, so I figured I ought to be able to sort it out. But unless you’re working on a system that’s designed around paper (e.g. Microsoft Word), printing is a pain. You have to completely reconsider how to display the data so that it works on the printed page. In the end it took at least a week of work to get a solid implementation. I probably only wrote a few hundred lines of code, which isn’t a lot. The problem was that I’ve never done it before, and neither had any of my coworkers.

    One of the most important tools of in any programmer’s toolbox is other programmers. What might take hours or days to figure out on your own can often be solved in minutes by someone who has done it before. Certainly it’s also satisfying to figure something out yourself, but I’m not always in the mood. Sometimes I just want an answer so that I can go home for the day. Often coworkers fill this role, since they’re just an office away. But what if nobody at the company has ever done printing before? Or what if you’re working solo?

    That’s where StackOverflow comes in. With thousands of programmers on call, even the most esoteric question can find an answer in short order. It’s often only a matter of minutes before a question gets its first answer. And if the first answer doesn’t work, the second one or the third one might. You might even find out that a bunch of other people have already tried what you’re doing and they all figured out that it wasn’t feasible. It’s sure nice to know that before

     you spend hours and hours trying to do it.

    This is great news for all of us, because it means less time banging our heads on the table and more time making software. So far I haven’t needed it for anything terribly important, but I sleep better knowing that it’s out there.