VSM Cover Story

The Montana Programmer: Coding VB.NET While Fishing, Hiking and Dodging Grizzly Bears

I was recently trudging along a trail to fish for some trout in a remote Northwest Montana mountain lake when I met a guy coming out.

Whereas I was gasping up the rocky path in military surplus camo pants, thrift-shop hiking shoes and a plain white T-shirt, he looked fit, sleek, high-tech and competent.

We talked a bit and it turned out my new acquaintance named Bob Hosea is a software developer -- when not fishing, hiking, hunting, taking photos and otherwise enjoying the great outdoors in one of the wildest chunks of paradise in the lower 48: the Kootenai National Forest.

When not slinging code, he documents his adventures for thousands of followers on Facebook and has shared great photography on the Web site TheBobFactor.com.

He presented such a contrast to my stereotypical idea of a programmer -- a headphone-wearing, pizza- and energy-drink-fueled 20-something keyboarding away among the same ilk in a trendy San Francisco loft or something -- that I had to find out more.

Here's what it's like to live and program in the mountains of Montana.

The journalist and the programmer
[Click on image for larger view.] The journalist (left) and the programmer. Bob thinks it's fun to carry 40+ lb. pontoon float boats into mountain lakes. The author, not so much.

Visual Basic and Electrical Diagrams
Bob is the programmer in a tiny dev shop called CMH Software Inc. near the small town of Libby, specializing in electrical design and training software.

The other members of the shop consist of his wife, Sandy, partner Kevin Christensen and Kevin's wife, Mary, who all handle financials, sales, Web duties, databases and so on.

Bob got into programming as a hobby in 1982 with a Radio Shack TRS-80 computer, finding BASIC easy to learn. His first project combined his programming hobby with his interest in all things electrical. He decided to make a digital version of the complete "RCA Semiconductor Replacement Guide," hundreds of pages with thousands of semiconductor pinout diagrams, plus all of the detailed specifications for each one. "And that was for almost every transistor ever made in the world at that time," he said.

He soon found there were limits to what you could do with 4Kb of RAM, though, and had to give up that project for a high-tech recipe program for his wife, Sandy. "And I think she used it twice just because I asked her to use it," he said.

 Bob atop Carney Peak  in the Cabinet Mountain Wilderness Area
[Click on image for larger view.] Bob atop Carney Peak in the Cabinet Mountains Wilderness Area (source: Bob Hosea).

His day job was mining, specifically hard-rock drilling, but a 1987 accident made him start thinking about what he would do if that gig ended. To help prepare for that, he transferred to the electrical department, where Kevin was his supervisor. When a mining layoff came in 1993, he started working on some ideas he and Kevin had for mining-related software. The first product to come to fruition was called Constructor.

"This program allowed electricians to completely build complex circuits in what is called a 'ladder diagram,' which is standard in the electrical industry, and then simulate the entire electrical circuit on their computer," Bob said. "It lets them create and test the operation of diagrams without having to spend money on any electrical components first. Saving them time and money. Plus, the Constructor program shows them any potential problems in their circuit if they exist. The program was written completely in BASIC and it worked well."

Kevin quit his mining job to come on board for more programs and CMH Software was born. And Constructor still lives, now at version 13.

What's a Bubble Sort?
Being a self-taught, mom-and-pop-shop programmer isolated in the middle of the Rocky Mountains -- Bob might be the only software developer based in the Kootenai -- makes for some special challenges.

One of those challenges is keeping up with the industry and relating industry buzzwords with what he was doing.

"There have been a lot of times where I figured out that some new term that I just heard about, which sounded outlandish and alien to me, was actually something that I had already been doing, or already knew about," Bob said. "I just refer to it in a totally different way, the correct way I would always figure. Then I would wonder how on earth someone ever came up the term that they are using."

The CMH Software Web site
[Click on image for larger view.] The CMH Software Web site.

A prime example of that phenomenon -- which is surely familiar to self-taught hobbyists-turned-pros -- is bubble sorting.

"Early on in my programming, I came up with my version of an algorithm for sorting names and numbers in arrays, for both ascending or descending order," Bob said. "It's really not that complicated at all, but what programmer doesn't think their code isn't totally unique and brilliant? And because of how the algorithm worked, where it would compare itself to the next element in an array or to the previous element to determine the next action, I always just thought of it as my 'look-ahead' or 'look-behind' sorter.

"After that when I would read responses from programmers in forums, and they might mention using 'bubble sorting,' I would always think I should check that out sometime. Eventually I did, and wow, it's the exact same algorithm that I wrote, with a different name. And the name 'bubble sorting" fits it perfectly."

Although he says "it's not pretty in any way," below is some 16-bit "bubble sort" code that Bob wrote in 1995 for the company's first Windows version of the Constructor program. He explains the code: "In the Constructor program the main diagram layout is shown in rungs and columns. So this code sorts assignments by the rung number values in an array from small values to large values, and then does the same thing with the column values.

"The first Do/Loop actually shows the bubble sort logic all by itself. This sub just uses two of them for this task."

Type AssignmentType
    Rung As Integer
    HorzVert As Byte
    Col As Integer
    Class As Byte
    Mode As Byte
    SpecialData(4) As Byte
    Property1 As Single
    Property2 As Single
End Type



Public Sub SortAssignments(temp_ptr%)

If temp_ptr < 1 Then Exit Sub 'fail-safe

Dim a%
Dim change_made%
Dim  temp_assignment As AssignmentType

'--------------------------------------------------------
'sort assignments by rung number first
'--------------------------------------------------------
Do
    change_made = 0

    For a = GLB_Lad_Assignment_Ptrs(temp_ptr).PtrStart To GLB_Lad_Assignment_Ptrs(temp_ptr).PtrEnd - 1

        If GLB_Lad_Assignment(a).Rung > GLB_Lad_Assignment(a + 1).Rung Then
       'store current higher value in a temp
            temp_assignment = GLB_Lad_Assignment(a)

       'swap the two assignment values, overwrite the higher value with the lower value
            GLB_Lad_Assignment(a) = GLB_Lad_Assignment(a + 1)

       'copy the higher value assignment to the new location in the array
            GLB_Lad_Assignment(a + 1) = temp_assignment

            change_made = 1
        End If

    Next a

    'restart if a change was made
Loop While change_made

'-------------------------------------------------------------------------------------------------------------------
'sort assignments that are using the same rung number by their column numbers next
'-------------------------------------------------------------------------------------------------------------------
Do
    change_made = 0

    For a = GLB_Lad_Assignment_Ptrs(temp_ptr).PtrStart To GLB_Lad_Assignment_Ptrs(temp_ptr).PtrEnd - 1

        If GLB_Lad_Assignment(a).Rung = GLB_Lad_Assignment(a + 1).Rung Then

            If GLB_Lad_Assignment(a).Col > GLB_Lad_Assignment(a + 1).Col Then
                 'store current higher value in a temp
            temp_assignment = GLB_Lad_Assignment(a)
                      
               'swap the two assignment values, overwrite the higher value with the lower value
           GLB_Lad_Assignment(a) = GLB_Lad_Assignment(a + 1)
           
                'copy the higher value assignment to the new location in the array
           GLB_Lad_Assignment(a + 1) = temp_assignment
                
           change_made = 1
            End If

        End If

    Next a

    'restart if a change was made
Loop While change_made

End Sub

What's a Namespace?
Namespaces are another example. "This kind of took a long while for me when I first started working with .NET," Bob said. "I'd already been using and building different classes. But I couldn't see the difference between a so-called Namespace and any of my Class/Sub-Class/Structures. Lol. Ok, there is a difference and I can see it now. It just took a while."

Jack of All Trades
Although Bob wedded his programming hobby with his interest in electrical topics, his programs have gone far beyond electrical diagrams. Bob and his partners at one time worked on underwater remotely operated vehicles (ROVs), and while they never commercialized that project, they developed a ROV they still use to explore the bottoms of local lakes.

Other projects included a simulation engine for a large metal detector manufacturer and a program called Illumination Studio that consisted of the software, and also the circuit designs, to control Christmas lights, or any lights, via a computer.

Visual Basic 6, VB.NET and Visual Studio
I asked Bob what tools he uses most in his day-to-day work. "Some of our software is still written in VB6, with DLLs that are compiled with the PowerBASIC DLL builder," he said. "The newer programs are written in VB.NET, using Visual Studio 2017."

Bob's day-to-day work mostly includes working on the next version of one of CMH's two main program. He's just now finishing up Constructor version 14, which has taken about 3-1/2 months to code. After having lost an ace graphics guy who decided to change careers, Bob has lately also had to devote a lot of time to design/graphics work along with coding and bug-hunting.

"While I'm working on the actual code for the newest version, we will do a lot of debugging to help shake out any problems in the code," Bob says. "There's always a lot of bugs. Doing it that helps. But it never gets them all. So once we have our final release code we will start debugging more by installing and running it on all of the Windows OS's that our software supports, which is now back to Windows-7, and on both 32 and 64 bit systems. We have many versions of our actual program, and the setup, which includes a site license version, a student version, upgrade versions and full install versions. So each one of them will need to be tested individually on a clean (fresh Windows installed) computer."

Challenges of Being a Rocky Mountain Programmer
Along with keeping up with industry trends and buzzwords, being based in such a remote area also presents other challenges in staying current, with the lack of local, immediate access to conferences, programming social events such as meet-ups and other developer socialization resources. The Internet, of course, alleviates that somewhat.

"The drawbacks would be not being exposed to the ongoing changes in software development, because there aren't any other full-time programmers working in this area," Bob said. "I do use a lot of online forums to ask questions, and I try to read about new stuff that's available for software development on different Web sites, but it's not always on a day-to-day thing.

"Usually, it's only when I've hit a roadblock and I have to look for help from others. It would be nice to have other programmers in the area so that we could talk about software development more often. It took me a long time to finally move into the .NET Framework world. A long, long time."

A Yaak River sunset.
[Click on image for larger view.] A Yaak River sunset (source: Bob Hosea).

The business side of things, though, doesn't seem to suffer from being tucked away in the wild mountains.

"With the power of the Internet I don't think our remote location really affects our sales at all," he said. "We actually have very few sales in our neck of the woods here in Montana. Most of our sales are in the United States. But we do have sales in many other countries now too, including Canada, Australia, New Zealand, Taiwan, Romania, Italy, Germany, South Africa, Israel, Qatar, Mexico, Honduras, Belize and Brazil."

Dodging Grizzly Bears
Talking to Bob, however, gives one the sense that the benefits he enjoys in his remote Kootenai base far outweigh the drawbacks. That's because of his love of the outdoors. Whereas most developers might look forward to checking out a trendy new city eatery or watering hole in off hours, Bob heads for the woods -- specifically high mountain peaks, alpine lakes, pristine wilderness and blue-ribbon trout streams.

The Kootenai, where Bob was raised, is a special place. In the lower 48 states, it's one of the few areas where you can find untouched primitive areas still hosting all manner of native Rocky Mountain wildlife, some now extremely rare. These include deer, elk, bighorn sheep, mountain goats, wolves, bobcats, lynx, mountain lions, wolverines, caribou and the big daddy of them all: grizzly bears.

In fact, when I first met Bob, the talk of the area was a grizzly bear researcher who had been badly mauled by one of her subjects in the deep, wet wilderness. Now just about everybody you see in the woods up here has a bear spray canister attached to their hip, or the bear-protection handgun of choice: a .44 Magnum, popularized by Dirty Harry.

Grizzly sow and cubs
[Click on image for larger view.] A grizzly sow and cubs sighting posted to Bob's NW Montana G-Bearings Facebook site (source: Bob Hosea, posted by Bill Cripe).

Coincidentally, one of Bob's many interests include maintaining a site that lets people track and share grizzly bear sightings.

The heightened grizzly bear scare hasn't deterred Bob from weekly excursions into the wild, either, where he is known for his first-rate photography.

The Photography
"Originally I started taking pictures just to show to friends and family," Bob said. "Even though some of them lived in the same area, they'd never seen some of the remote areas we had around us. Then I started getting into making videos of some of the hikes in my area and posting them on YouTube. That way others could see what the hike was like in case they wanted to do it themselves.

Bob routinely runs into wildlife, like this mountain goat.
[Click on image for larger view.] Bob routinely runs into wildlife, like this mountain goat (source: Bob Hosea).

"I expanded on that by making my TheBobFactor Web site so that people could go on to my site and search for specific lakes or peaks in our area, and then get information about it. I also made a TheBobFactor Facebook page, which is a lot easier to for me to maintain when I have new pictures and videos to post about a hike. Because of that I only post new information about my current hikes on the Facebook page, and not the Web site. The site and my YouTube channel get a lot of hiking visitors though. And it's cool when I meet someone on the trail and they recognize my name from a hiking video."

On that YouTube channel, this modern Renaissance man -- his other interests include astronomy, astrophotography, bow hunting, geocaching and more -- also provides videos on repairing Canon 60D DSLRs, lens repair, hunting and more.

Spirit of Christmas
The photography Bob is undoubtedly most known for is his unique "Spirit of Christmas" series, in which he dons snowshoes to pack a lighted, battery-powered Christmas tree to high mountain lakes and other remote areas for spectacular evening photos, hiking out alone only with the aid of headlamp.

Working on Spirit of Christmas on Pipe Creek for cancer awareness.
[Click on image for larger view.] Working on a Spirit of Christmas project in Pipe Creek for cancer awareness (source: Bob Hosea).

"It just kind of morphed into something bigger from a lot of smaller ideas I think," Bob said. "My wife and I always like putting out a lot of lights and decorations around our home on Christmas. And we have a lot of lit Christmas trees on the place. And when I would be out hiking I would see places that would just look like a perfect place to see a fully illuminated Christmas tree."

The idea to light up a big star and Christmas tree on the couple's property really took off with the advent of LED lighting (prior to that he was thinking of using a car battery or solar panel for power).

"We thought that it would be cool to make people wonder how on earth a lit star got way up there," Bob said. "It wasn't until a few years later that LED Christmas lights were available and I was able to convert a string of 120-volt LED lights to work on a small 12-volt battery. It worked great for lighting up a small tree. And the small battery could run it for hours. Then I added a star and a long-range remote control to turn everything on and off."

From that, the idea of photographing a colorful, lit Christmas tree in the wilds was born.

Bob working on a Spirit of Christmas shot at Libby Creek Falls
[Click on image for larger view.] Working on a Spirit of Christmas shot at Libby Creek Falls (source: Bob Hosea).

"After the first couple of times out though, I figured out pretty quickly that I was spending way too much time looking for the perfect tree to light up once I got to there," he said. "And there were a couple times I just couldn't find a good tree at all, and the ones that I found looked like Charlie Brown trees by the time I was done with them. So to help out, I decided to start packing a six-foot artificial tree with me. Between that, the Christmas lights, the battery, my camera gear, food, flashlights, my gun, snowshoes, and extra warm clothing, my pack started to weigh in at about 50 pounds. It was worth it though. The tree looked much better I thought."

Others thought so, too, and the "Spirit of Christmas" series has been written up in many newspapers and other publications, propelling Bob to the status of what might be called an Internet celebrity, though he denies that characterization. Even so, he continues to entertain thousands of followers and his post often garner hundreds of comments.

No Slowing Down
Now, getting closer to that time of life when a lot of people start thinking about retirement, Bob continues to venture into the remote areas of Montana, regularly climbing high mountain peaks. Recently, he carried on the tradition he and a friend started of mounting a U.S. flag on the high, remote Northwest Peak, just a few miles from the Canadian border, so, as his friend said, those Canadians venturing into their own wilderness could see what country they were looking at to the south. With a recent spate of forest fires in the area, the flag was threatened so he took a day off work to go rescue it. His access was blocked by the Forest Service because of fire danger, however, and the Forest Service radioed to a fire team en route to protect the Northwest Peak fire lookout station to also take down and stow the flag.

Bob in a Kenelty Cave.
[Click on image for larger view.] Exploring a Kenelty Cave (source: Bob Hosea).

His loyalty to the U.S. is matched by his fondness for his old stomping grounds, which he'll probably never leave.

"If your absolute dream job ever became available -- literally everything you wanted concerning salary, benefits, nature of your work, etc. -- would you leave Montana?" I asked him finally.

His answer immediately reminded me of my favorite line by Brad Pitt in one of my favorite movies, A River Runs Through It, famous for succinctly summing up the splendor of this state, where I was born and raised.

Bob's answer: "I'd have to say no. Not if it's a choice. Both Sandy and I would have a hard time ever leaving Montana. It's our home."

comments powered by Disqus

Featured

Subscribe on YouTube