Category Archives: Programming

Building software.

Quora Answer: What did Steve Jobs mean by programming ‘teaches you how to think’?

I originally wrote this as an answer to a question on Quora.

It forces you to figure out how to solve a problem in a way that can be explained to a computer.

By doing this you learn to break down a problem into its components, how to define the problem using constraints (you have to figure out what’s going to go in and what’s going to come out of your code), you have to be precise, and you have to have a full understanding of all of the components of the problem and its solution in order to solve the problem.

This define and disassemble approach to problem solving is something that is very applicable to problems across many domains, especially science, engineering, and mathematics.

Quora Answer: What are some ways that programming was better in the past?

I originally wrote this as an answer to a question on Quora.

In the “bad old days” the actual programming work wasn’t much different, just worse. Monitors were smaller and lower-resolution, chairs more uncomfortable, you had to spend a lot more time waiting for the computer to finish what it was doing, hardware was much more expensive, tools were barely capable, there weren’t pre-existing libraries for much of anything, open source wasn’t a thing, and there weren’t good marketplaces for selling what you created.

There was no internet, no StackOverflow, and no communities to go to for help. You did not have a Meetup group in your town where you could talk to other people working with similar technologies.

The one thing that was better in some ways is that fewer of the “interesting” problems had been solved yet, and many of the solutions and applications that were built were created by a single person with an itch to solve a particular problem.

Though sometimes I wish I could go back to a time where Java did not exist yet, programming really was awful in the old times. The same goes for the web. Sometimes it feels like it would be nice to go back to a time before it was hypercommercialized and mainstream – a time before the popup ad existed and before you couldn’t avoid being inundated with inane celebrity gossip on sites like Twitter and Facebook – but no. It was nearly useless back then.

Quora Answer: Which career is more fun, networking or programming?

I originally wrote this as an answer to a question on Quora.

Full question:

“Say networking is a blanket, for IT, systems administration, and network security. We’ll say programming is basically web app development. Can anyone with experience in either of these fields give some pros and cons about what they do and do not like?

I have basic knowledge in web development and none in networking, but I have recently taken a liking to getting involved with network security, and I think I would like systems administration more than programming so I am curious as to your opinions.”

I’ve done both, and still do both.

I almost always prefer building software, but there are almost no days where it’s easy. The big draw for me is that it’s creative work and is a form of artistic expression, more in the way that literature is than painting. I also find that my level of enjoyment is inversely proportional to the number of people involved in the process.

Both paths rely on having a great deal of knowledge. While you can look up specifics, having enough background to understand the specifics takes a lot of  learning and experience. Once you know the material well, networking and system administration are usually easier and less stressful, requiring a lot of thoroughness, attention to detail, and keeping track of things.

Both rely on having a set of tools that you rely heavily on. In software, it’s your IDE, debugging tools, libraries, frameworks. In systems it’s a set of utilities, commands, scanning tools, or even hardware tools.

What I dislike about what you put in the umbrella of “networking” is that if you’re good at it, it can get to be pretty boring. When systems are running well, you’ve earned your pay, but it’s when things are breaking that it gets most interesting. And stressful. And you get the least recognition for your efforts. Though ages ago I was an MCSE and worked with Microsoft products regularly, I’ve grown into being a Linux bigot and can’t stand working with non-open-source systems. Luckily I’m in a position where I don’t have to, but you may not have a say in what things you end up working with.  Same goes for programming, really.

One place where it gets interesting is when you combine the two, and that’s what I refer to as DevOps. It’s system administration AND programming. This involves working with tools that create and configure servers, deploy things, set up security, and perform all sorts of IT administration tasks, but instead of being done by a team of 20 IT staff, they can be done by one person. Things like Chef, Puppet, Vagrant, Salt Stack, Ansible, Fabric, Capistrano, and Nagios are popular and worth exploring.

It’s a lot harder to find a “sane” work environment in programming. Almost nobody who hasn’t done it appreciates how incredibly difficult it can be. Douglas Crockford said that “computer programs are the most complex things Humans make”. Being able to manage an environment like that where people aren’t just cogs in a machine takes a special kind of person, and unspecial managers abound. Lots of little things can add up to make a chaotic and stressful environment. It’s often more “interesting” in product companies, but those are a small part of programming. Most programming is writing “boring business apps”, like order entry systems, sales report generators, accounting tools, and other business-specific pieces. It’s no less challenging, but often less stressful and more stable than building software products. The challenges are just different, and one’s not better than the other. I’m a product person, you may not be.

Before making a decision, I’d recommend exploring the world of DevOps first. Not only is it a growing trend and career path, it’ll give you a taste of the administration side of things and you may fall in love with it. Or you may like every part except for the programming and go full IT.

Quora Answer: Is it rude to change a co-worker’s badly written code?

I originally wrote this as an answer to a question on Quora.

Full question:

“I joined a company as a new grad and currently working with two mid level and one senior designer. It’s a chip design company. One of my co-worker’s code is very badly written and I am pretty sure there are many other good ways to implement the same thing. Badly written code bugs me a lot and I’m tempted to change/improve it. Will it look bad if I go ahead and change his code? Or should I ask his permission beforehand ? I’m not sure what will be a good move as I’m comparatively new in industry. I don’t wanna look arrogant!”

Yes. It’s also rude to write bad code.

The best way to handle that is a code review. It’s not necessary to have anything formal – just spend a few minutes going over the code together so you can point out what had issues and why.

Just changing the code without communication will cause two problems: The original writer is likely to resent it, and the original writer won’t learn anything and will keep doing things the same way. There’s also a risk that you don’t fully understand the intent or scope of the changes and your “fixes” might break something.

Don’t make it adversarial or approach it in a way that puts the other developer on the defensive. That will make them non-receptive to the conversation, and the goal is to improve the code and the developer both now and in the future.

ModernMUD Source Now on Github

As dumb as the name might be, I decided to go with “ModernMUD”.

The source code is available on Github under the BSD license:

https://github.com/Xangis/ModernMUD

There’s a lot more to be done with documentation, but the XML comments are decent enough to make IntelliSense useful. I’ll probably be posting more about invidiual sections of the source, particularly the clients (all four of them!), in the near future.

If you’d like to chip in, or use the code to build your own MUD, you are more than welcome to do so.

New Editor Builds

For this build, version 0.59, the name has been changed from “Basternae Editor” to “ModernMUD Editor”. This is because I’m in the process of open-sourcing the codebase, and the editor will work not only for Basternae, but any MUD based on the same codebase.

Other than the name change, there are a few stability fixes, and probably some new bugs. Download links for Windows and OSX/Linux are on the right side of the blog. Enjoy!

The Magma Codebase Is Worth Millions!

I love how Ohloh estimates the value of open source projects. For instance, here’s their take on the Magma MUD codebase:

I believe Envy is just over 100k lines of code. At the average developer salary of $91,000/year, about $1 million in “value” was created by the Basternae II rebuild team. Value that, due to the DikuMUD license, could never actually be “claimed” through any means.

Just a curiosity, really, but still fun.

Sniktiorg’s Zones

Sniktiorg, one of the most creative and prolific zone creators in the world of MUDs, has granted Basternae 3 permission to use his areas. Woohoo!

I’ll attach them as I get them converted to the new format and figure out where in the world they should go.

Preserving Newlines in XML Serialization

With .NET’s XML serialization, it kills newlines when you serialize XML to disk. More specifically, it converts a CR+LF into just an LF (\r\n becomes just \n).

This was causing annoyances with the spell editor, since you can edit source code for spells with it, but the code would appear all on one line after saving and reloading.

The fix was to declare XmlWriterSettings with a newline preference.

The code was this:

         public void Save()
         {
             XmlSerializer serializer = new XmlSerializer(GetType());
             Stream stream = new FileStream(FileLocation.SpellDirectory + FileName,
                 FileMode.Create, FileAccess.Write, FileShare.None);
             serializer.Serialize(stream, this);
             stream.Close();
         } 

And now it’s this:

        public void Save()
        {
            XmlWriterSettings ws = new XmlWriterSettings();
            ws.NewLineHandling = NewLineHandling.Entitize;
            XmlSerializer serializer = new XmlSerializer(GetType());
            Stream stream = new FileStream(FileLocation.SpellDirectory + FileName,
                FileMode.Create, FileAccess.Write, FileShare.None);
            XmlWriter writer = XmlWriter.Create(stream, ws);
            serializer.Serialize(writer, this);
            stream.Close();
        }

I can have my newlines and eat them too. Oh joy!

I Am Addicted To Github

Until recently, the only code I’ve released as open source has been the Magma MUD codebase.

In the process of posting the Magma source on Github, I kind of got hooked on posting code online. Since then I’ve posted the source for a handful of applications, a mix of Linux and Windows desktop apps. A 12-day commit streak so far, yay!

I’m also considering open-sourcing the Basternae 3 codebase. The main things that make it easier to work with than old-timey C-based MUDs are the use of C#, which has amazing exception handling and debugging capabilities (no more attaching gdb to a core dump), and speaks XML natively, so data files are Human-readable, portable, fairly robust, and extensible. The editor is also getting to be pretty good.

To open source Bast3, I’d need to write a lot more documentation, and I’d need to “genericize” a lot of things that are specific to Basternae. It’d be a lot of work, but I think it’d be a fun project. The source is already in a private repository on Github, but that’s the easy part.

Magma MUD Codebase Now on Github

The Magma MUD codebase, last updated in 2008, is now on Github: https://github.com/Xangis/magma

I’ve cleaned up the build a little bit, but it’s still the same old Magma that was used to start Basternae 2, warts and all.

If you feel like cleaning up any bugs (there are plenty) or adding any improvements, go ahead.  If you want to send a pull request I’m Xangis on Github (as you can probably tell from the URL).

Using MonoDevelop

I’ve almost always used both Windows and Linux, but I stopped using Windows a few months ago.  One of the things that only runs on a Windows machine is Visual Studio.  The Basternae code was compiled on a Windows machine and then uploaded to the Linux host.

Without access to that, it was time to try using MonoDevelop.

MonoDevelop
It was able to load the Visual Studio solution, with some exceptions:  The client WPF project didn’t load, nor did the abandoned Silverlight project.  I could probably install more packages to make WPF work, I’m not sure yet.

I noticed that the compiler works differently for some things, like terminal characters.  The ECHO_ON and ECHO_OFF sequences broke logging in, but some weird prompt formatting that’s been around for a while just fixed itself.  It will be interesting to see what other diffferences turn up.  Even though C# is supposed to work the same on all platforms, I suspect that it might work better when both the build and run machines have the same operating system.

Client Version 0.24 Released

I’ve released version 0.24 of the Basternae Client.  Use the download link on the right side of the blog or on the basternae.org front page to get it.

This release mainly has cosmetic changes:

  • Changed the font for most things from Segoe UI to Verdana.  It just looks better.
  • Added “show group” and “show equipment” settings to the settings dialog so you can have those always show up when you start the client if you like.
  • Improved the look of the menu bar a little.
  • Reworked the settings dialog so it looks a little more organized.
  • Fixed a crash that would happen if you open and close the about box twice in a row.
  • Improved the layout of the status window.

There’s nothing groundbreaking or particularly complex about this release, it’s mainly just a small update to get me used to the code again, since I’ve been away from it for a while.

ANSI drawing and parsing glitches remain, and that’s the main thing that needs work right now.

Goodbye FindMUD

For a few years I ran findmud.com. It was mainly an exercise in customizing Drupal, but there was no real need for it. The Mud Connector filled the mud listing and community need quite nicely.

FindMUD is gone now. It was time that it was put out to pasture. It was fun while it lasted.

New Client Artwork From John Baker

John Baker, a friend of mine for a long while, did some work creating graphics tiles for me. It was intended for use in two old-style RPG projects I’m gradually working on. I’m sure you’ll hear about them later as they develop. Neat thing is, they were designed with both those projects and the Basternae client in mind.

Expect to see them in future posts and/or releases of the client. Stay tuned.

For now, check out his site:

argofjohnbaker.com