Archive by Author

How to Apply for an Internship at Logos

16 Apr

Written by:

Sometimes, when promoting internships at Logos, I’m asked what kind of questions we ask on the interview. Or I’ll get an email from a candidate we rejected, asking how they could have done better. I’m not going to give out our list of interview questions, but I will give advice on how to really stand out when applying.

We don’t require a checklist of skills (“3 years experience with .NET 4”), nor are we impressed with a dense list of acronyms on a résumé. We’re looking for coders who are passionate about programming and who have the talent to tackle any huge problem we will throw at them. Here are some qualities we want to see in a potential hire.

CompSci Basics. Understand algorithms, data structures, computational complexity. Know the basics of hardware (e.g., order these by speed: HDD, LAN, L1, RAM, L2, Internet, DVD), bits & bytes (e.g., the “interesting” powers of 2), and software (operating systems, compilers, Internet protocols). Become familiar with technologies relevant to our field (Unicode, cloud computing, information retrieval, etc.).

Know the Company. Browse our websites, find out what we do & who we are, watch our videos, read our blog, use our products. If you go to church, maybe your pastor owns a copy of our software and could show it to you. (If they don’t own it, why not? Get them to watch the videos.)

Show Passion. Do something outside of school. Find an open source project and contribute to it. Learn what’s new in C++0x, C# 4, Java 7, or HTML5. Write a blog. Enter a programming competition. Download Python/Ruby/Haskell and work through an online tutorial. Write an online tutorial. Start a user group interested in some technology. Read a book that isn’t part of your CS curriculum.

For further reading, I recommend a three-part series posted by Tyler Hicks-Wright: How to Get a Job at Fog Creek (and Other Selective Software Companies), Part 1; Part 2; Part 3.

This post originally appeared on code.logos.com

A truly lazy OrderBy in LINQ

9 Apr

&w=490&h=200&zc=1&q=90" alt="A truly lazy OrderBy in LINQ" class="thumbnail" width="490" height="200" />

Written by:

Jon Skeet recently discussed what it means to be “lazy” (in the context of LINQ to Objects). He introduced some new definitions based on how the operator processes the source sequence. Another aspect (which Jon didn’t cover) is how lazily the operator produces output when its results are enumerated.

Let’s take a concrete example: what’s the difference in running time between these two statements?

The Visitor Pattern and dynamic in C# 4

9 Mar

&w=490&h=200&zc=1&q=90" alt="The Visitor Pattern and dynamic in C# 4" class="thumbnail" width="490" height="200" />

Written by:

Introduction

The Visitor Pattern allows new functionality to be added to a class hierarchy without modifying the hierarchy. It accomplishes this by having one (virtual) “accept” method that can call back many different visitor implementations.

The Visitor Pattern is a way of implementing double dispatch in languages (like C#) that don’t support it natively; as a result, many have argued (1, 2, 3) that the existence of this pattern is an indication of a missing language feature.

C# 4 addresses this limitation with the addition of the dynamic keyword, which allows method calls to be dispatched dynamically at runtime based on the runtime types of the objects involved. This can be used to implement the visitor pattern more simply.

Example

Consider a typical pedagogical class hierarchy:

Animal Class Diagram

What Makes Good Code Good?

19 Feb

Written by:

The Logos software development team has a large set of coding guidelines that have evolved over the years. We record them all on an internal wiki, each in its own article. The scope of each guideline varies widely; some guidelines give broad advice, and others indicate a particular coding style for a particular language.

Why do we have coding guidelines? To encourage the writing of good code. But what is good code? My favorite description of good code can be found in an MSDN Magazine article by the late Paul DiLascia. In his End Bracket article titled “What Makes Good Code Good?” he explains that

Cannot find property named ‘StringFormat’

12 Feb

Written by:

A few of our users have had Logos 4 crash on startup with the following exception:

System.Windows.Markup.XamlParseException: 'pack://application:Name.xaml'
value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'.
Cannot find DependencyProperty or PropertyInfo for property named 'StringFormat'.
Property names are case sensitive.

Creating hash codes

9 Feb

Written by:

In order for a hashtable to perform well, there should be few collisions when inserting objects into the hashtable. A good way to accomplish this is to have an implementation of GetHashCode that returns uniformly-distributed hash codes (especially for non-uniformly-distributed input). Bob Jenkins wrote a Dr Dobb’s article that covers the basics of a good hash function, as well as providing his own implementation that is a “generally good, fast hash function”.

His code is in the public domain; since it’s useful for implementing Object.GetHashCode for custom equatable types, I ported it to C#. It’s available as HashCodeUtility.cs.

The main method, CombineHashCodes, should be used to combine a series of integers into a good hash code. These integers could either be the values of your type’s fields (e.g., X and Y coordinates), or the results of calling GetHashCode on the non-integral fields that comprise the type. A sample use would be:

struct Point

{