Archive for the ‘Programming’ Category

Michigan Google Developers DevFest 2014

I will again be speaking a the Michigan Google Developers DevFest this year. I enjoyed myself last year and made contacts that have affected my career.

This year I am talking about dependency injection in Android. Unit testing is important, and dependency injection is vital for designing testable classes. Come see me and learn about it.

Google Developers Logo

Posted on:
Posted in Mobile, Programming, Speaking | Comments Off on Michigan Google Developers DevFest 2014

Android Best Practices Book

As of this week I am a published technical author.

As a result of my speaking at Michigan Google Developers DevFest in April of 2013, I met Godfrey Nolan, who was also speaking at the event. In June he invited me to contribute to his upcoming book. The result is Android Best Practices, published by Apress. I contributed the chapter on Web Services. I am honored that Godfrey chose me, and I am pleased with the result. I got my physical copy of the book yesterday, it was published officially on the 14th.

Critical Thinking in Software Design

There is a great article published at Inc which enumerates four secrets of great critical thinkers. I find this is totally relevant to designing software or software architecture. So I’m adding my take on these four secrets:

  1. Slow Down
    One of my main gripes about meetings is making a decision on the spot. At least for me, my best thinking occurs somewhere else after the fact. I need time to consider the implications and possibly see alternatives before I can be certain it’s the correct decision. So to make the most effective decisions, postpone immediate decisions as often as possible. Make the time to explore the alternatives.
  2. Break from the Pack
    This is the basis of one of the main arguments by Ted Neward in his keynote at Codemash 2012 that I already covered. The “best practices” are found in books, on the web, in corporate documents. Generally, these can get the job done. But I doubt it’s always the best or right solution to a problem. It’s certainly the safest. If that’s the goal, then go that way. But in business we are always looking for the advantage, and I doubt the best practice gives you the advantage. More likely, it’s a starting point which you should use to find the best solution. Slow down and think about how the best practice solves the problem and if that is really the solution you need.
  3. Encourage Disagreement
    I have long used this as a metric in my interview process. I want team members who will express their opinions. Usually the best answer to a problem is not the result of the idea of a single person, but an amalgamation of ideas or compromise between multiple ideas. If no one can disagree with the boss/tech lead/manager then you might as well adopt only the best practices and call it done.
  4. Engage with Maverics
    I think this one is a little harder in an enterprise environment, since often a big corporation is not the home for maverics. I think what you need to do here is actively engage with people whose viewpoints are not aligned with yours. People who think differently about a problem may provide you with some insight you may have missed or not considered properly. I have always thought of code reviews as a source for this. I approach them as a way to see someone else’s problem solving at work. I’m not interested in telling them how they did it wrong, but seeing what they did well and adapt that to my problem solving toolkit.

CodeMash Nuggets

codemash2010

This year I was fortunate enough to attend CodeMash in Ohio. Just like last time, it was an amazing experience. The speakers, the venue, the food, the folks in attendance. All of it made for a great experience. I learned, I laughed, I left exhausted.

General Observations

I went to mostly mobile-oriented talks, and over a two day period every single speaker I watched used a Mac. On top of that, all the presentations were very minimalist. I don’t know if that’s the tools on the platform or folks finally rejecting the glitz of PowerPoint and focusing on content. I hope it’s the latter. Sales folks take note.

Mobile developers are actively rejecting the BlackBerry platform. One even pointed out how his company just stopped accepting work for that platform. Another who was building a mobile product pointed out that the expense of supporting the BlackBerry platform across three different active versions was too much. Has any technology died so publicly?

In the Java-oriented talks I saw, there was very little Eclipse. Mostly I saw IntelliJ Idea. This was interesting for me, because I love ReSharper for .Net work, and have been using WebStorm for HTML5/JavaScript coding.

Notable Quotes

As always, there were a number of notable quotes that summed up so many aspects of what was being conveyed.

Ted Neward, Keynote Address

“Reject the Goal of Reuse”

I’ve been seeing this message more and more lately. Reuse happens so rarely unless you are actually building a library, that otherwise you are probably wasting effort and introducing bugs by striving for reuse in code that was not necessarily intended for reuse.

“Best practices are merely average”  “Best practices == avoid thinking”

The bigger the company, the more they care about best practices. So there will be fewer risks, fewer rewards, and overall mediocre results. Seen it, sadly still living it.

“Reject the temptation of the familiar”

I’ve been working on this one for almost the last year. I’m learning the mobile paradigm, learning Java, writing services in something other than .Net. I am very surprised how much I had blinders on when I was immersed in Microsoft-only development.

Bill Pugh, Effective Use of FindBugs in Large Software Development Efforts

“The challenge for FindBugs is to find the intersection of stupid and important.”

I have long been a fan of automated tools for helping me tighten up code. His quote sums up the intent perfectly, finding the stupid mistakes you may have made that could result in important problems in your code.

Ted Neward, Android: Where You Can Stick Data

Answering questions about SQLite on Android: “It’s not Oracle, and if you treat it like it is you’re doing it wrong.”

Understand your platform and user paradigm. Enough said.

Bruce Eckel, Polyglot Programming: The Power of Hybridization

“You don’t know where the difficult parts will be”

So don’t plan to optimize anywhere, you won’t be right ahead of time. I have seen this myself more than once. The real trouble isn’t visible at the beginning. See any article on estimating for another aspect of this issue.

“Typing is noise”

Bruce favors languages with minimalist syntax, believing those languages express your solutions clearly for those who come after to read your code. This has inspired me to start learning Python.

“Go will replace C++ as the low-level language used in high performance applications”

I’m recording this for posterity. Bruce says he’s remarkably good at predicting these things, even though no one listens. I’ve read some of his work and have faith, so you read it here first.

Bruce Eckel, Reinventing Business

“The best people would be leaving companies all around you to come work for you if you were hiring the best

There is a metric for your recruiting staff.

Geeks Are Funny

After dinner on Thursday, there was a Pecha Kucha competition which was great entertainment, hosted by the inimitable Scott Hanselman, with a geek celebrity panel of judges consisting of Ted Neward, Julie Lerman, and Keith Elder. The winner was Leon Gersing, the heartfelt and real @rubybudda. Here are a couple cell phone videos of the event:

Jon Skeet Coding in the Style of Glee

Mel Grubb Urinal Rules

Leon Gersing On Love  Tiebreaker (Talking to a set of slides he’s never seen before)

Just as good as the talks was the Twitter stream on the big screen behind the presenters. You see a brief glimpse of it at the beginning of Jon’s talk. Geeks are funny.

Looking Back and Forward

What Happened in 2011

  • I spent too much time with SharePoint (as the Cloud lead developer) so
  • I changed jobs which means
  • I moved into mobile development
  • And therefore I learned to write code for BlackBerry and Android which means
  • I learned Java
  • I got to deploy my first apps in the cloud for mobile back-ends, using both Azure and Google
  • Spent a fair amount of time with Mobile Web

Goals for 2012

Today I found a great post by Michael Crump about goals for the coming year. I guess I’m doing OK because I am already doing most of the things he advocates, and I agree with all of them. I’m going to incorporate some of those with modifications for myself.

My own goals for 2012:

  • Continue becoming a polyglot developer
    • Learn a new programming language (Objective-C)
    • Learn and use a new design pattern (TBD)
  • Read and Contribute to Stack Overflow more often
  • Get an app in two app stores
  • Consistently generate blog and Twitter content
Posted on:
Posted in Programming | Comments Off on Looking Back and Forward

Technical Resumes and Interviews

Having done a few horrible technical reviews lately, I figured I should post a little info to help prospective interviewees out. So here are some of my pet peeves that I run across during interviews (or on resumes) that will immediately get you removed from consideration.

Listing Skills or Technologies You Don’t Know

Seems obvious, but clearly it is not. If you list a technology on your resume (especially the harder ones or ones not strictly in your specialty), I’m going to ask about it. For instance, if you list all the technologies in a project you were on, but all you did was update ASP.Net pages and someone else did the WCF/SQL Server/whatever it is, you shouldn’t list it. Technology acronyms may get the recruiter’s attention, but I am going to ask you about it, and if you don’t know it, I’m going to assume your resume is a batch of lies. I don’t have the time to figure out what you do know so I’m just going to eliminate you.

And since we’re discussing technologies on resumes, stop applying bold to the technologies and phrases in a seemingly random manner all over your resume (STOP IT!!).  While you may think it’s helping people skim through your resume, it actually harms the people reading it. So my impression of you is that you don’t understand users, and probably make poor choices when trying to build a system that interacts with people, because you can’t format a document intended for people to read.

Listing Clients as Employers

Your clients did not hire you as an employee, but a contractor. Those are very different scenarios. If you work for a contract house and worked on a project at Proctor & Gamble, P&G is not your employer. I have personally seen contractors list Microsoft as an employer because they worked on a project led by Microsoft Consulting Services. You were not an employee of Microsoft, you were a sub-contractor. You did not go through the extensive hiring process at Microsoft and pass. Someone at MS hired your company to provide developers, and not specifically to hire you. That’s not the same thing at all.

Brush up on Basics

If you are a developer whose main skill set is Java or .Net, you should know OOP basics. How about the four pillars of OOP? I am amazed that interviewees with 10+ years of experience can’t answer this question. If you know C#/Java/whatever, you should be able to tell me what the language keywords mean and their effect. I expect you to be able to write code in the interview. I don’t think you should be able to write up a connector for WIF, but some basic coding without the benefit of Uncle Google is a prerequisite.

Opinions

I am consistently shocked by the number of developers who won’t express an opinion, on even the simplest of questions, like what do you like better about C# compared to language X?. I don’t want team members who won’t tell me what they think or even tell me if I’m wrong. I’m pretty sure if you can’t express your opinion in an interview you can’t work on my team.

Look up your Interviewer

Again, seems pretty basic, but it doesn’t happen. I know the recruiter gave you my name. In almost 10 years of interviews, only two people actually looked me up ahead of time. If you are reading this before I interview you, congratulations, you are on the right track, but I’m pretty sure you are the minority. This is an easy way to demonstrate some initiative.

Listen

Again, I can’t believe I have to write about this, but listening to the interviewer is kind of important. I can tell when you aren’t listening to what I say, and if you can’t listen to me in the interview, why would I think you would listen to your team once hired?

Ask Questions

If your only question is what is the project this interview is for, I’ll just assume you are just another contractor looking for a gig and not looking for a career at my company. Again, I don’t want you. If you don’t know anything about my company going in, I’m going to assume you are lazy in your work as well.

Learn About Tech Interviews

Do yourself a favor, learn about tech interviewing:

What Great .NET Developers Ought To Know

On Interviewing Programmers

The Guerrilla Guide to Interviewing

Java Posse Discussion

A .Net Developer’s Journey into Java

In my new job working in mobile development, I am getting know Java more in depth, because native applications for both BlackBerry and Android are typically built with Java. I was excited about Mono for Android as an option for me, but I think it’s a little too new to gather much acceptance for the kinds of clients I am currently dealing with, as well as my colleagues who are mostly Java developers. And now the uncertainty around the Mono project makes this untenable for the near future.

Differences

As I continue to dive deeper, I am genuinely surprised at how much Java and C# overlap. There are of course differences, but these are much fewer than the similarities.

IDE

Of course this point has nothing to do with the language differences, but it affects how you get there. Getting to know Eclipse has been interesting. Since I was a recent convert to ReSharper with Visual Studio, initially Eclipse seemed like a real step backward. The autocomplete is not as good as VS Intellisense, and the syntax highlighting isn’t as good. I learned about FindBugs, a plug-in for Eclipse that performs code quality inspections similar to ReSharper. It’s not as robust, but for the time being it’s workable. I still haven’t found the productivity tools ReSharper provides. I want to get to know IntelliJ IDEA (assuming it’s as good as ReSharper because it’s also from JetBrains), but I have two problems so far:

  • BlackBerry development can only be done with Eclipse
  • All the Java devs around me are using Eclipse

I’m going to try IntelliJ IDEA for doing some Android work on the side. If it’s much better I’ll work on swaying my colleagues.

It’s also interesting that most folks have multiple copies of Eclipse installed, each one configured with the plugins dedicated to a certain kind of development, i.e. one for BlackBerry, one for Android, one for back-end web services, etc. Apparently Eclipse doesn’t use the registry, so multiple copies is not an issue. Installing the plugins is a pain. Sometimes you get them from the IDE using a built in feature, other times you download and install them separately. I guess VS is similar, you just need to do it much less often.

Lack of Properties

Right off the bat this was difficult for me. You can make members public, but as in .Net this is frowned upon. So you end up creating getPropertyName() and setPropertyName(value) functions explicitly, and they show up as methods not as members. I guess I am spoiled by the auto-implemented properties in .Net. I needed to change the way I looked at accessing data in a class.

Strings

While string objects themselves are very similar (immutable, StringBuilder, etc), formatting them is different. There is a static String.format() function, but it requires a little more stringent parameters than the .Net version, akin to the string formatting you do in .Net during declarative databinding in ASPX pages. Java also has dedicated classes for formatting numbers and dates

Events

While events are built into the Java language, it’s in a much more rudimentary way in comparison to .Net. You have to do all the plumbing yourself. Frameworks like AWT and Swing help with this, but as a mobile developer these aren’t doing me any good. It seems to me there isn’t as much focus on this as there is in .Net.

Linq

The kind of functionality you get from Linq is not built into Java directly. You need a 3rd party library to do something similar, like lambdaj. In fact, using 3rd party libraries is more of a pattern in Java than in .Net. There are tons of open source libraries to extend the language, which is not as common in .Net.

Open source continues to be a problem for me. I keep doing work for large corporations, and mostly they will not accept open source in software solutions. Essentially they don’t trust the source from a legal perspective, so unless some third party comes along and indemnifies the source for them (like RedHat or Novell has done for Linux) large corporations just don’t want to use it. Now that I have seen how easily hackers can affect open source, I can see where their paranoia is coming from. Ultimately, they are actively choosing sub-optimal solutions to avoid any risk, instead of managing the risk. I’m sure there is a scaling factor here for the largest companies. This is another hidden contributor to the costs and failures of software development.

Null Pointer Exception

Null Pointer Exception == Object Reference not set to an instance of an object. Which one is a clearer message describing the actual problem? Neither one.

Naming

The naming conventions in Java differ somewhat from what is accepted in .Net. Methods start with lowercase letters. I’ve seen a bunch recent code written by other Java developers and am deeply disturbed that Hungarian notation is alive and well. It’s down but not out in the .Net world, I hope I don’t find it thriving in Java….

Class Duplication/Refactoring

I’m finding with all the different namespaces and open source projects available, that lots of open source developers adopt the “not invented here” attitude and create their own version of a class, ranging from slightly to wildly different. Classes for handling JSON are a great example of this. I have found at least half a dozen implementations of the JSONArray class. Uncle Google is no help for this newcomer. Which one should I be using? Will I need to build a façade into my designs so I can use more than one? Do I now need to build time into my estimation to research all the possible implementations of a concept.  How do Java teams manage that?

As I continue delving into the differences I’ll likely have more posts.

Posted on:
Posted in Java, Programming | Comments Off on A .Net Developer’s Journey into Java

Why Use var?

Ever since the var keyword was released in C#, I’ve struggled with using it. To me var felt like using variant or object in VB, even though logically I know it is not.

List<string> items = new List<string>();
vs.
var items = new List<string>();

Since I bought Resharper, it’s been nagging me to use var in my declarations, so I  have acquiesced. Today that paid off. I had to refactor something which caused a few type changes. It was so much easier to deal with because I used var instead of writing out the declaration the old way, there were just fewer changes. I’m now a complete convert to var, thanks Resharper.

Don’t Forget Your Place

It’s easy to get wrapped up in the technology you use, thinking everyone is using it because everyone you interact with is using it. But when you back up and look at the bigger picture (which you should do), you may not be where you think you are. Tiobe Software creates a monthly Programming Community Index rating the use of programming languages. Our beloved C# comes in a number 6, behind (Visual) Basic of all things! I’m not really surprised by the leading languages (Java, C, C++), and it shows that while Microsoft is strong in the marketplace, it’s development tools and technologies are not leading the pack. But when looking at the charts over time, two of those leading languages have been declining in use for many years. C and (Visual) Basic have been consistent for a long time, and C# has been growing. I think the programming landscape has been fragmenting, the dynamic languages like Ruby and Python are gaining more mainstream acceptance each year, and the popularity of new platforms like mobile phones is going to keep changing that landscape.

So does that mean my choice of Microsoft as a platform isn’t the best choice? Hard to say, but I believe it’s a solid, reliable choice. I certainly think that it’s getting harder and harder to be specialized in any one language. Employable developers are going to need many programming tools in their tool chest. The end result is that fewer developers will truly be an expert with their tools, but will be good enough to get some work done. I don’t believe this bodes well for software quality going forward. There is already too much to know and be good at, I certainly struggle with this problem myself. As a consultant, learning lots of different tools is a necessity, so I will continue to keep working towards expertise in the tools I know, and not letting my interests get too fragmented.

Posted on:
Posted in Programming, Reviews, Tools | Comments Off on Don’t Forget Your Place

Staying with the Fire Hose

At the recent Ann Arbor Day of .Net, my colleague David Giard arranged an excellent panel discussion with Jim Holmes, Mike Eaton, Jay Harris, Patrick Steele, and Jason Follas, about keeping current with the stream of constantly evolving technology with which we work (aka the Fire Hose). I felt this was one of the best sessions of the day, the audience was very engaged with the panel. It definitely ended too soon. *Update* David Giard posted a video of the discussion on his Technology and Friends webcast.

One of the discussion points revolved around training. I think a couple points were pretty clear from the discussion:

  1. Companies don’t provide enough or the right training
  2. You own your career, it’s up to you to get the training you need.

One of the discussion points that I wanted to contribute, was that the existence of Day of .Net is partly driven as a reaction by the community to the two points above. We attend these conferences to learn (among other things) just enough about new technologies so we can effectively evaluate them and see if they fit into our day-to-day jobs or personal interests. Traditional training methods (books, classroom training, CTBs) seem to be falling further and further behind as the fire hose continues to flow faster and faster. We are at the conference to get some of the training we need, because it’s not available any other way.

Technical Books

For me, books have always been part of my learning, but more and more they are falling short. Technology is changing faster than publishers can respond. More often than not the book I need isn’t going to be published for a while. Even today (May 2010), look at the number of new developer technologies that are hot in my circles:

  • Silverlight 4
  • Windows Azure
  • Windows Phone 7
  • Android
  • SharePoint 2010
  • .Net 4.0

These are by no means niche technologies. You would be hard pressed to find many books published on them (maybe some around beta releases, those get stale fast and are often of dubious quality due to the rushed nature of the title). I completely understand the lag time, but I think the publishers need to step up and start paying authors as full-time employees so they can commit full time to a book and get it released sooner. Typically book authors are doing this on the side, I am sure that slows down time to market. There are some Microsoft technologies, like Commerce Server, that haven’t seen a new book since 2002. Arguably that’s a much more niche technology (and certainly not as popular as SharePoint for instance), but if a company as large as Microsoft is investing money to develop the product, they have users of the software so there must be some kind of market for those books.

I know lots of folks don’t work on the cutting edge (I spoke to a group of VB6 developers yesterday that didn’t even have Visual Studio installed), so this is less of a problem for them. As a consultant, this is a constant problem for me. Maybe I am am the minority and there isn’t as much market for these books so early? That’s hard for me to say. Either way, I know the publishers are losing my money, because I end up digging up blog posts and finding online articles to meet my need long before the book hits the shelves for me to purchase it.