The Raspberry Pi is not going to change the world

…at least not in the way that people think it will. I keep seeing things all over the internet about what people plan to do with their Raspberry Pi when they finally get one. I swear on some of the threads it seems like each post is trying to come up with something more asinine than the last.

“I’m gonna stream netflix” “I’m gonna make an autonomous robot” “I’m gonna play Crysis 3″

Edit: If you don’t know what the Raspberry Pi is, or are not a very technical, skip to the end of this post. My sister read this, and asked me to define half of the nouns I used. She recommended that I summarize this post in the same words that I summarized it for her. If that sounds like you, then this blog is probably not for you, but thank you for visiting.

Unfortunately the RPi is being hyped by the same people that love to push linux on all of their non-techie friends by saying “You can do whatever you want with it!” Not quite. You can do anything in linux that you want if you can also write your own scripts and compile programs from the ground up. You can do anything with an RPi that you can figure out how to program in Python and then figure out how to interface to the GPIO.

For most people the possibilities just got really limited.

I greatly admire what the Foundation is working towards and I think that they are on the verge of getting a huge group of kids interested in computer science in a way that no one has yet. I’m just tired of hearing people think that they will suddenly be able to do things with an underpowered computer that they most certainly can’t do with the PCs they currently use to troll the internet.

Will I get one? Yes. But I don’t really have high hopes. I am hoping that I can use it as a WordPress-capable web server, and maybe a NAS controller, simply because of the ultra-low power consumption. I think it would be really cool if someone figured out how to use its graphics processing abilities for folding@home, but I understand that even if all of those things do work, they will probably perform so poorly that I will keep using other, beefier machines for those purposes.

While, as an electronics guy, the GPIO makes my ears perk up, I think I will still primarily use ultra-cheap PIC microcontrollers for most of my digital projects. The true selling point of the RPi for DIY is its ability to connect to the internet in a way that makes the Arduino look like its sending smoke signals in comparison. (I’ll be ranting about the Arduino culture at some point)

If you really want to change the world with a Raspberry Pi, make a donation to the Raspberry Pi Foundation

 

Non-techie summary: The Raspberry Pi is a credit-card sized $35 computer. It is not going to be a very useful tool for media consumption, or advanced development. However it has already let a huge group of little kids get into computer science, by letting them program simple scripts and create basic video games. It is severely underpowered for high-level computing, but is an excellent education platform.

Visual Basic – Review

Is it weird to do a review of a programming language? I’m not sure.

I would definitely label myself a “jack of all trades”, always appended with “master of none”. This is also the case with programming. I have used more programming languages than I can count, but I have never really been super comfortable with any one particular language. My programming is almost always limited to accomplishing a simple task that I just can’t figure out how to do with a third-party tool. With that in mind, here is my first programming language review from the point of view of a novice programmer.

 

The Situation:

I’m not sure how, but I earned a reputation at work of being an Excel guru. A user came to me with this notion and a frequent .xls report that he was having to manually copy and paste pieces of to distribute it to his employees. It looked something like this:

Sales Report
Co. #CustomerAcct MgrItemItem PriceQtyValue
1Spacely SprocketsBlow, Joe80800.04710000000470000
1Cogswell CogsBlow, Joe37460.0489800000470400
50Acme CorpBlow, Joe54559.995004995
50Aperture ScienceBlow, Joe1000011600005800000
99MicrosoftBlow, Joe600179.9980000000063992000000
1Black MesaWho, Cindy Lou999998000121176000
1UNSCWho, Cindy Lou1337600000017102000000
1Natas MiningWho, Cindy Lou666610000004444000000
1Blizzard NorthWho, Cindy Lou555559.99650000003899350000
50PopCapWho, Cindy Lou44548.991100000098890000
99Nintendo of AmericaWho, Cindy Lou7777149.99160000002399840000
99General MotorsWho, Cindy Lou1400000020
99Loudifier AmplificationWho, Cindy Lou1111

Only with way more fields. Joe isn’t allowed to look at Cindy’s sales figures and vice versa, so he was having to copy Joe’s data into a new workbook, email it to Joe, and then do the same with Cindy’s data.

Enter me. I don’t want to get into trying to have a bunch of statically linked workbooks out there pointing to a central workbook, because it’s messy, and because the data is going to be moving around vertically on a weekly basis. The verdict is I will finally be forced to learn some of the VBA magic I see every time I try googling for anything about Excel.

The basic solution, in pseudo code, is:

  • Identify the first cell with a sales person’s name
  • loop through the list until a line is recognized that doesn’t match the first sales person
  • copy the data between the starting point and the point where the loop broke to a new workbook
  • copy over the header to the new workbook
  • save the new workbook as the sales person’s name, close it
  • start the loop again where it broke last time
  • when a blank is encountered, end the macro

Having experience with basic programming control structures, variables and such, I start by figuring out how to declare variables, set up a while loop, and make comments.

The good:

VB (VBA in this case) is very powerful. Microsoft gives the end user an astounding level of control over Office applications, especially when you consider how much you can do in Excel before using VBA. I was able to record a macro automatically, and then look at the code that was generated to try and reverse engineer some of the code, which was very helpful. VB is an object-oriented language, which makes coding flexible. Most importantly, it’s universal. Learning VB will get you far in a Windows environment and allow you to automate repetitive tasks, like splitting excel files, or even create logon and startup scripts to apply with AD.

The bad:

Documentation.

I spent a lot of time trying to figure out how to resize a range object before I finally “selected” the range, did a selection.resize, then assigned the selection to the original range object. Kinda kludgey. The Visual Basic Editor IDE very helpfully suggests Range.Resize when I start to type that, but for some reason It would throw an error every time I tried to run the macro.The community is amazing. Every time I searched for a solution to a problem, or just the proper syntax for some code, I found a post full of great, usable code examples for specific situations. Unfortunately, I only ever found examples. Even the Microsoft websites for VB are dominated by examples, with little explanation as to why a bit of code is structured like it is. I want to learn how to use VB, not copy someone else’s examples and then staple the crap out of it until it kind of works.

The syntax

Visual Basic is a modern, high-level language with a complete object creation and manipulation structure. Why the fuck can I not make a block comment? If you dig up a hidden button in the menus, you can comment or uncomment a selection of lines, but last time I checked, comment lines individually != block comment. Objects inherit characteristics in the Parent.Child format, which works well, until the IDE gives you suggestions that simply don’t work. Speaking of the IDE, it will move your code around without asking, making it hard to read. For some reason, there are single-line and multi-line versions of commands that require very different structure. Good luck adding another line to what was previously a single-line if statement.

Fragmentation / Lack of integration

It’s a fact of life. If you need to script in a Windows environment, there will always be a new language to learn. While VBA is tightly integrated with Office and is the quickest way to automate tasks in Excel, the language itself rarely uses terms related to Office Applications. Microsoft is always so busy trying to sell developers on their next half-assed set of development tools and languages (here’s looking at you, Metro) that they orphan stuff like VB. They are now pushing you to use PowerShell for anything that you would have used VBS for in the past, forcing you to learn yet another set of rules and commands. VB for Applications is trying to do too much and not enough at the same time. I have the full range of Visual Basic at my command, but I really just want to do some comparisons and move data around. Microsoft doesn’t really want me to use VB for anything but Office, so why not give me a Visual Office Macro language?

The Verdict:

Visual Basic isn’t worth mastering. I was able to patch together some code for a specific purpose, but the language was actually getting in my way. While it is the most direct route to advanced Office scripting, there are simpler methods for most other scripted Windows tasks. Do some google searches. Copy and paste from the tireless angels that post replies on stack exchange, and quit when it works. Anything more just isn’t worth your time.

I give it 6 commas out of 10

Hello, Computer

In almost any programming language, one of the first things you learn to do is create a “Hello World” program.

In a blog, this manifests as a “Hello World” blog posting. Unfortunately, at the time of writing, this blog doesn’t actually go out to the world. It is just a lonely little black and white post, echoing off the walls of localhost. If you are reading this (and you are not me) then this has actually gone somewhere, and hopefully it has turned into something cool.

We’ll see.

Copy and paste the following code into notepad, and save it as hello.cmd

@echo off
@echo Hello, World.
pause

Double-click on hello.cmd and congratulate yourself on the programming equivalent of learning “Smoke on the water”.