Friday, September 27, 2013
First Week of Programming Re-Introduction
I'm sneaky like that.
I originally wanted to work on a project using Ruby on Rails. I've been reading Why's Poignant Guide to Ruby during off-time and occasionally during lunch at work, but the practical hands-on project I've been working on is written in Visual Basic .NET.
Yeah, I know, Visual Basic. I already explained why in a previous blog entry.
What have I learned this first week?
I'm still re-familiarizing myself with details of how things work in VB and Visual Studio. I'm no doubt making some tasks harder than they need to be; a side effect of practical inexperience. Re-learning...not as bad as learning, but frustrating when you know you've done something before but just can't remember it.
It doesn't help that I'm not focused for periods of time on the project. I tend to work on it for an hour or two a day, after coming home from the office. I get home a little late, I watch something while having some dinner, then work on the project, go to bed later than I should, wake up, yawn, and wish I had gone to bed sooner. Repeat.
The last thing I really learned was that Joel Spolsky was right; write a spec. Or for a small one-person project, take the time to plan out what you're doing. I have been doing the seat-of-pants approach to this mini-project, primarily focusing on "here's what I want it to do, and to do that, I need it to do X,..." then I tried to create X. Then identify the next obstacle and work on that. I didn't know if I was really going in the right direction so much as I was creating a series of fixes that may or may not repeat functionality or at least overlap.
That's pretty much the project summary. A lot of re-familiarization and a hint of re-planning with a few drops of wishing I could dedicate more than an hour a night to it. Is this how most software projects work if it's not your day job? Because for me it gets just plain frustrating (in addition to the frustrations of running into logic problems and figuring out why something just doesn't work.)
Wednesday, September 25, 2013
Blogsy: Blogging on the Go
I enjoy blogging. I never claimed to to be great at it and I don't have a substantial number of readers, but I find the practice of writing to be cathartic. Sometimes it's even helpful, as I forget the keyboard shortcuts to applications like Screen and OH HOW HANDY I posted them on my blog.
I also find myself traveling around quite a bit. I probably find myself on a bus back to my home in PA once a month, and that bus trip is between three and four hours long.
Ugh.
Sometimes I fill the time with podcasts or reading. But other times I want to feel more productive. Writing a blog post entry scratches that itch nicely.
Of course there are a few problems.
I tried using the laptop. Being a bus, there really isn't a lot of room to get situated with a laptop, but I've managed to do it. The next obstacle I commonly encounter is internet access; I don't have a cellular hotspot device, my phone doesn't support tethering and even if it did, you're either unfamiliar with traveling through PA or wildly optimistic to think cell coverage would work without frequent drops. Some of the buses offer wifi, but they are still tethered to the cell network and prone to dropping out; that is, when they have wifi working at all.
My wife bought me an iPad Mini as an early birthday present. I thought, "It's small but not too small, I don't mind the keyboard, maybe there is an app to blog on the iPad..."
I thought there would be many. There weren't. The ones I did find weren't that great.
I stopped searching when I found Blogsy.
Blogsy worked with Blogger (required!), let me access photos on my iPad (handy!) and format my text (nice!).
Best feature for me: no Internet connection required (perfect!). Blog posts could be composed locally and uploaded later, meaning the crappy bus wifi wasn't an issue (unless I needed to research something or test links for a post...that got a little irritating, but was hardly Blogsy's fault.)
Another bonus: Blogsy can access many other sites to link content to your posts (when there's Internet access, of course.) The right side of my screenshot has an iconic display of services like YouTube, Facebook and Picasa in addition to the local photo storage.
Another feature some users will appreciate is access to the raw HTML with the swipe of some fingers. So far I've had to use it to tune the positioning of some tags for links, but if you like exact control over the appearance of your posts then this is a surprisingly handy feature to find in an iPad blog editor.
New users can be easily overwhelmed with the interface; Blogsy has PLENTY of documentation available as well as training videos and FAQ's, both on the website and linked within the app.
In my usage of Blogsy I've had two consistent issues. One, the publishing date setting doesn't seem to like to hold the date while I'm editing. It's FANTASTIC that I can still control when the post goes up, as I'm often queuing posts to appear over the next several days, but the Publish Date setting seems to like resetting to "Auto" instead of the specific date and time I set.
The second issue is the disappearance of my text behind the virtual keyboard as I'm typing. I'm not sure if that's a Blogsy thing or an iPad thing; can the app detect when the cursor is disappearing from view? I end up having to pause and scroll the page so I can review what I'm typing.
Feature requests? It would be nice to get some stats off the blog using Blogsy. For example, how many views has a particular post received? Perhaps the authors of the app want to focus on Blogsy as a posting editor more than a blog management platform, but when the app already has nice touches such as the word count I think statistics would be an equally nice touch.
Bottom line, if you enjoy blogging and occasionally want to write while at the park (as I am doing with his entry) or some other location where a laptop is a hindrance but your iPad is handy, give Blogsy a try. It's inexpensive and has more features than many bloggers would end up using while being compatible with every popular blog platform out there!
Friday, September 20, 2013
What's Wrong With Visual Basic?
There are a few things that the letter addresses. My background in the education system gives me a slightly different perspective, but I won't bother getting into the more popular issues it raised. It's already being repeated and rehashed online and all over. So much so she already issued a few updates and a followup post. It would be pointless to rehash the brogrammer culture, even though in this case it's more of a high-school moron culture.
The thing that kind of stood out to me was item number four on her list of suggestions for high school programming; I hope Ms. Endsley doesn't mind me borrowing from her blog here. Her suggestion read:
"Don't be boring and out-of-date. Visual Basic? Seriously?? Yes, I know I said I'm not writing to complain about your choice of programming languages, even though I'm still scratching my head on this one. The reason I mention your choice is that it doesn't help you make a good first impression on new programmers. I have no idea what my teen learned in your class because she wasn't excited about it. Without touching your minuscule class budget, you can offer a range of instruction with real-world applications. With resources like Codecademy, for example, students could try a variety of programming languages, or focus on ones they find interesting. Have you considered showing kids how to develop a phone app? Program a Raspberry Pi? Create a computer game? Build a website? Good grief, man — how were you even able to make programming boring"
First, the choice of programming link goes to an article where the author downplays learning VB because a search on Dice.com shows few jobs with VB experience in the title. Cobol is gone with the dinosaurs. The first thing to make me pause in his article was the statement that new programmer job-seekers need to focus on web development skills, then followed up stating that Java was more important than Javascript. I'm not a professional programmer, but something didn't quite add up there. I'd love to hear what people in the industry think.
Second, if you're going to do searches for programmer jobs, let's look to the pros at the StackOverflow Careers site (note: I work for these guys.) A search for "Visual Basic" turned up 263 jobs out of 1689 job listings, or about 15.5%. Not great, but it's still out there and in use.
StackOverflow.com has over 53,000 questions tagged "vb.net" out of 5,700,000. That's slightly under one percent. Yikes! On the other hand, the "ruby" tag has 82,400 questions carrying that tag. Java has 478,000, and Javascript has 443,500. Erlang, 3,700. Clojure, 5,800. Not quite the results I expected after reading the article from the Dice.com author.
Then again, you could use something like the TIOBE index for measuring language popularity (don't know why the author didn't use that to begin with...) Java was at the top, followed by C, C++, Objective-C, then PHP, and C#. Visual Basic was 7th. Then Python, Javascript, Ruby at 10th, and down at 13th place was VB.NET. The fact that "(Visual) Basic" was 7th while "Visual Basic .NET" was 13th would lead me to believe there are a lot of VB5 and VB6 applications out there that will continue to need maintenance.
Third, Rikki goes on to point out that her child...and I left out the huge amount of exposure to technology she described earlier in the post...was not excited about the class, and it's because VB doesn't make a good impression. Let's try a variety of languages!
Really? I'm not even sure how this would practically play out in a school setting. You have a teacher who probably isn't programming savvy. If he were, he'd probably be a programmer, not a teacher, considering the education environment today. But this is mere speculation. The programming classes I knew in the districts I worked were typically business or math teachers, primarily, and programming courses came from a course book. The teacher simply doesn't have time to work in a multitude of languages and have it not devolve into a nightmare in terms of keeping up with the student's work.
These are high schoolers. Most of them don't know anything about programming. And they are suddenly open to the choice of all these languages, as proposed...how would they know what's "good?" And it's not like they have four years to choose what they want to dabble in. They probably had to fit it into a semester. And actually accomplish something.
Which brings me to the next point...the first steps of learning the language is boring. Or a pain in the ass, depending on how you're wired. You can't do much with any language without understanding the basics (no pun intended); loops. If-then. While. Functions. Methods. Maybe getting into objects. You want to write a novel, but first have to understand what nouns and verbs are, and how to construct a sentence, then how to construct a paragraph, and somewhere along the way learn how to construct a narrative.
And some of these kids...these are just kids, most of them taking the course to fill in some credits in all probability...won't be able to quite grasp how loops work. Or a function. It'll be tough for them, if they even keep trying; often they give up, or just screw around in class, not caring that they're making it harder for other students who may want to actually learn.
If learning the programming concepts is hard, and learning the syntax is hard, that is still a bit of a cakewalk compared to learning the IDE. Visual Studio is complex. It's got tons of features that beginners won't even touch while making something that is still moderately useable. You could spend a week just exploring all the things Visual Studio brings to the table. But when you are looking for a professional job in programming, Visual Studio is the key tool behind any company using the Microsoft stack. Because of this, you can get tons of examples and help when you have a question.
But it is yet another item that takes time to learn, and for a beginner can get in the way. Not only are you learning concepts and the language, you have to learn to model in your head how event-driven programming works, and how your code ties to specific GUI elements on the form.
I've read that languages like Python and Ruby may be good for beginners. I used Python before; it was nice in many respects. But on the other hand, when learning concepts, you end up with a lot of programs that run at the command prompt. You learn some of the logic behind how to do simple tasks, and the command line is fine for that. Languages like Ruby and Python are great because you install them and can edit them from any text editor. Does that really excite kids though? Learning the concepts but not having anything fancy or graphical to show for it? Maybe you need to install a framework to enable a quick website creation. Then you get to introduce them not just to the language, but to the framework.
"I'm learning Ruby!"
"No, you're learning Rails, and was exposed to Ruby."
The fact is that in most schools, programming courses are little more than "install Visual Studio Express and follow the exercises." You can criticize the teacher if you want, but there are constraints in budgeting, time, and what the class can be expected to achieve in terms of getting projects done and graded. Nothing prevents the kids from learning more outside class time, and I'm really betting the class is just an introduction, not a training course for a career.
And what of a career with VB.NET? Is it really so horrible? Dot-NET applications are, as I recall, compiled down to a Common Intermediate Language, regardless of the syntax behind them. The Visual Studio family of languages ends up with CIL and are tied to those .NET installs you have to update on your home computer. Is there a performance difference if these kids used something like C# over VB?
I did a quick Google and discovered that I apparently had this question before. It even attracted an answer from Jon Skeet. Basically, no, it doesn't really matter once it is compiled down. You use the language whose syntax you're comfortable with and works for the job at hand.
A little more poking around the sites (for Programming and StackOverflow in the StackExchange network) seems to show that VB.NET has more bias against it not because it is necessarily inherently bad, but because of its heritage. Another irony to the "Why would you choose VB.NET to teach beginners?!," given that BASIC was meant for beginners. It's in the name. Beginners All-purpose Symbolic Instruction Code. While VB grew to something that little resembled the initial language, many professional programmers apparently came to hold disdain over those that would use VB and its ilk, because VB encouraged people who couldn't program to make programs. Similar to hatred towards AOL'ers in the early days of home Internet access because it brought the hopelessly non-technical into the realm of geeks.
That stigma apparently continues today.
I had used VB, among other languages. And as I previously alluded to in a blog post, I decided to make learning a new language a project. I started reading a guide on Ruby; mainly to immerse myself in a bit of the culture while starting to absorb some of the "Ruby way" of doing things. But Rikki's blog post kind of made me want to try something else to get into the beginner's programming mindset. I started working on a project in VB.NET. I'm still reading the guides for Ruby, but I want to see how far I can get on this other project.
I'm sure it wouldn't be a popular choice among real programmers. I'd be the target of disdain and derision, if any programmer read this and took the time to criticize my choices. The only ones I really fear showing anything to are my coworkers since they are working with C# and I'd actually value their opinions.
But I'm not a professional programmer. I don't have years of experience with full time programming. I'm coming to this with just enough experience to know terminology, the basics of a few languages, and eyes fresh enough to have a perspective professionals have probably lost. I suppose the end product will speak for itself, if there is one.
And if it sucks...which it probably will...maybe the next one will be better.
Also, if you are a programmer and have some insight as to why VB.NET is not something to subject new programmers to (using reasons that are rational), I'd love to hear them.
Wednesday, September 18, 2013
Program Design Pride
Everything associated with your company name says something about your company. I've always associated this with "branding" or "marketing," although I'm not sure if those are proper terms for it.
Small businesses often don't think they need to pay much attention to properly marketing themselves. I grew up in a small town where just opening a restaurant or new store was enough to get some attention.
SOMETHING IS DIFFERENT! WE MUST GO THERE TO FIND OUT WHAT THAT PLACE SELLS!
What many businesses fail to understand is how much little details can matter. I cringe when I see blatant typos on business signs. If they care that little about the sign board in front of their store, how much care must they take in their product or service? I know it's a fallacy to think that because a restaurant can't spell today's special properly it means they can't properly prepare it in the kitchen, but of all the things you have control over in running a business, a sign with programmable or movable lettering ranks rather high on the ease of quality control items.
Small businesses in my home town often have this problem. But more shocking are businesses with literally seven digits (at least) of profit flowing that make similar mistakes when creating an application to interact with their customers. I'm not talking about spelling errors but rather simple interface issues that leave me scratching my head wondering who thought this was a good idea. Some blatant earmarks of crappy design:
- The application is obviously an interface to your website. As in, you made an "app" that scales a mobile version of the website. If I want that I will bookmark your site. A bank I do business with seems to do this. When I have a problem with them, the application is another on the list that bugs me as I get wound up to talk to customer service.
- The application was designed for iPhone. Literally. As in, I launch the app on an iPad and the interface comes up as if the display is the size of an iPhone, rather than properly scaling to fit. That same bank app, as well as a healthcare company, both do this; fortunately they have a "2x" button to scale them to twice the iPhone size. It looks cheap and crappy. Don't do it. (Be sure to say the "fortunately" with a sarcastic tone in your head.)
- Make notifications obvious. My Google Hangouts app pulls this crap on me all the time; the icon wears a big numbered notification alert badge, I open the app, and I find no obvious reason for the notification. I click around, reading random requests and old chats, exit, and the same damn number is still there. WHAT ARE YOU TRYING TO TELL ME?!
Not being an iOS developer, I don't know how hard it is to fix these kinds of issues. As a fairly technical end user, I can say that in my opinion it makes the product look cheap and shoddy. Do they simply think their customers aren't worth the effort? Why did you bother making an application if you're not going to make it usable and high quality? I wonder if you didn't just throw something together by outsourcing the job just so you can claim to have something your competitors have.
I also wonder: what do the developers think? Were they forced into compromise, or were they hired as outsourced guns that don't care a whit for the company brand?
Saturday, September 14, 2013
Programming for Dummies
My programming skills are lacking.
I've been exposed to programming concepts. I've worked on various small projects in the past. I remember using POKE and PEEK on a Commodore 128d in C64 mode to make simple games...yes, I'm that old. But I've not used COBOL.
In that general timeframe I remember using various dialects of BASIC on the TRS-80 and Apple II (let's loop and keep adding one to the variable to see how high it can count and this is AMAZING!) Then there was QBASIC on DOS (let's loop and keep adding one to the variable to see how high it can count and oh my gawd this is SO MUCH FASTER IT'S AMAZEBALLS!)
By the time college rolled around I started using C++, with a little Visual Basic and PERL thrown in. I excelled, of course, in none of these. Once I had the degree in hand I felt I had reached a juncture; systems administration work, or pursue a more programming-focused path.
I'm not sure exactly why I chose the work I do. It might be because at the time I enjoyed working at the small ISP in the area, which had me working on repairing computers and working on administration-type work. From there I slid into systems work for the severely weird world of public education.
Neither of these particularly called for programming expertise, and coming from a rural area, there wasn't much call for technology jobs, let alone a programming career. And before someone says it, this was also before work-from-home was becoming acceptable in tech jobs.
The closest I've come to a need to program as a profession was teaching a few intro courses in Java and Visual Basic at a community college. That in itself is a learning experience. If nothing else it reinforced the idea that unless you've taught others a subject they had little to barely any interest in while you're accountable for their learning outcome, you really need to keep quiet your opinion on what teachers in schools deal with.
"But if you wanted to be a programmer, you would have done it on the side as a hobby!"
I suppose there are programmers for whom the bug is an obsession. Or the DEbug. Haha! I slay me!
But I think as with many things the need or interest in programming runs a spectrum. And I don't know where I am on that spectrum. I'm not a programmer and never claimed to be one...but I loved the feeling that came from suddenly understanding the solution to a problem in the logic of a program, or having the program cleanly compile and not explode with a runtime error. There's something magical about that "click" moment when the comprehension pours over your brain like chocolate syrup over a dome of vanilla ice cream. Yummy, yummy comprehension.
Plus I was creating something out of cold, pure logic. Everything worked by a set of rules hidden behind the interface presented to the user. It was an art. I was a brain damaged Picasso using bytes as a medium.
But when I considered doing something more ambitious I would freeze. True programmers were good. They always seemed to be ten steps ahead of my understanding. That learning curve wasn't a curve, it was a fucking mountain. The idea of trying to actually becoming fluent in a programming language was intimidating.
So I didn't.
Now I work for a web company in their IT department. You may have heard of us; we run a site called StackOverflow. Is this irony or a sign?
The urge to program is bubbling again. Of course the intimidation factor is ramped up even more; we have some extremely talented people working here, and programming tends to be a field dominated by meritocracy. Showing one of our programmers a code sample and asking for feedback would be like taking a bacon sandwich to a master chef and hoping the offense to his palette didn't leave him vomiting. Programmers are not known for gentle tutelage or taking an apprentice under his or her wing.
I think a second factor to my hesitance is a fear of failure. To take on a project or goal and fall flat on my face? Yikes! Whatever meager credibility I've collected over time would suddenly evaporate in a big cloud of stinky fail.
I've spent the past year having to deal with a few personal demons; nagging voices and doubts. I managed to go through my first year at StackExchange without getting fired (always a plus!) I decided to play a little more with that old programming bug.
If nothing else I should at least be reacquainted with that magical, "Holy shit! It compiled!," moment.
Wednesday, September 11, 2013
Handy Tool of the Day: How to Use Screen
"Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells)."
How is this handy? I mean, in Linux, you can already use several virtual consoles using alt-function key combinations. Most desktops today utilize a GUI, so you can open multiple terminal windows.
Here's where I ran into a good use case.
The quick explanation is that I had a large file in a remote location to transfer to my local computer. My local computer can see the remote system (with the large file) only if it connects via VPN. The remote system can see my local system through a forwarded SSH connection on my router.
The VPN connection, for reasons I haven't tracked down, acts flaky with my connection. I can connect to the VPN, but if I SSH into a remote system, the session seems to periodically pause or drop, with little reason why. From what I can tell, though, outgoing non-VPN'd sessions seem to work fine.
I need this file, so I connect to the VPN and use rsync over SSH to copy the file. The problem is that the session will hesitate or blink out, just long enough to cause my rsync to disconnect or go wonky.
A little more clever would be to tell the remote computer to copy to my local computer, since that wouldn't go over the VPN. I try that. SSH into the remote system via the VPN, initiate the rsync. But whatever affects my session over the VPN seem to kill my copy job once my terminal is affected.
This is where Screen comes in.
I connect to the VPN. Then I connect to the remote computer via SSH. Then I run Screen with the "screen" command. It looks just like a regular terminal.
The difference is that the shell is running within "screen."
I then start the rsync to my local computer, which is routed not over the VPN but over the public Internet.
I "disconnect" from screen by hitting control-a (control-a is a command that tells screen you want its attention) then "d" for "detach."
I'm dropped back into the base shell. The rsync is still running in the background.
I can exit from my session and drop back to my local computer. Later, I re-connect to the remote computer via SSH and get a list of running Screen sessions by running
screen -ls
...which will give a list of running detached sessions. I reconnect to the session using:
screen -r <session name>
...and I am reconnected, and can see what is currently happening with my running rsync session. If my SSH session is disconnected while in the middle of the screen session I can still reconnect and reattach as described above.
Now when my connection goes wonky, the copy continues uninterrupted! When I'm done, I can use "exit" to close out the shell, which should also close the Screen session if it's the last process in the session. Failing that, control-a k (for kill) should end that Screen window.
Screen can also create other windows using control-a c. A new Screen window is created, and I can start another process there. I can switch among them using control-a n (for next) or control-a p (for previous.)
Alternatively, if you have more than a few windows created, you can switch with control-a <number> to jump to other sessions, numbered 0 through X. You can get a list (and select which to use) by hitting control-a " (yes, the quote sign) and from there use up and down arrows to select the session you want.
To summarize:
screen: starts the program
screen -ls: lists detached, running sessions
screen -r <session>: reattaches to a running session
While in Screen:
control-a d: detaches from a running screen window
control-a k: kill a running screen window
control-a c: create a new window
control-a n: go to the next window
control-a p: go to the previous window
control-a <number>: jump to window <number>
control-a ": list available windows and select from menu which to jump to
control-a ?: display help
control-a A: change the name of the session to something more meaningful for the lists
There are other options available as well, like naming your sessions and displaying a history; these are just a summary of the most useful commands to get started. The man page is your friend!
Saturday, September 7, 2013
It's Been a Year: Personal Edition
Arnold Schwarzenegger