An XML Adventure: Reflections

After I finished Part 2 of my XML adventure I realized something. Little wins are often the difference between a successful project and one that slowly drifts into oblivion. Especially for coffee break coders.

My struggle with finding a way to parse XML with Java is a great example of this struggle. Java is a fantastic language (I'm in love with some of the features implemented in Java 8), but sometimes it's hard to get going with Java. The ecosystem is huge. There are multiple ways to do almost everything. Just getting to main feels like a trip sometimes. And if you're a blog reader, you might know that the F5 key is not a build process. Better figure that out too. If you're like me, you get embroiled in all of these details, and hours later not a single line of code has been written.

To go off on a short tangent, I recently started looking into Android development. I wish I had started earlier. Android studio gives you a nice file structure that gets you to main quickly, a build tool (gradle), and an awesome IDE experience. It gives you those first little wins to whet your appetite and get you going in Java. If I could go back in time, I think I'd start there.

Anyway, getting those first little wins makes a difference. Between writing Part 1 and Part 2, I couldn't help but try to go back and figure out how to unmarshal XML with Java. Of course, after all of my complaining, it only took a few minutes to find a solution. There is a fantastic post on Stack Overflow explaining how to use JAXB, and that was all I needed. I tend to forget that even though Java documentation can be a slog, I can always rely on the Java community to have answers to my questions. I just have to know what I'm looking for.

After going through the trouble to figure out a Python, Go, and eventually a Java solution to my XML woes, I realized that Python and Go do an awesome job of giving you those little wins, and are perfectly suited for coffee break coders.

Python's clear and simple syntax coupled with its powerful libraries make it easy to learn and easy to jump into an existing code base, whether it's yours or not. These little things make it easy to jump in, and learn as you go. The Python libraries abstract away a lot of complexity so that you can just focus on what you want to get done.

If you're interested in learning more about servers and back-end development, and really diving deep, Go is awesome. Like Python, it has a clear and simple syntax that helps you gain momentum. Then it starts adding more complex and interesting features like pointers and concurrency, but never so much at once that you feel overwhelmed. Go also makes it extremely easy to add additional packages and makes the build process a cinch. To top it all off, A Tour of Go on the Go website is a refreshingly simple and straightforward introduction to the language and features.

It's hard to argue against just using JavaScript as a coffee break coder. You can use it on the front and back end. It's easy to get started with, and everyone is using it. But if you're not satisfied with just knowing the one language, Python and Go have to be contenders for that second spot. In life, it's often the little things that keep you going. In coding, it's the little wins.

Reference: Java XML Solution with JAXB, A Tour of Go, the F5 key is not a build process