Quality Devs and Coding Contests

I've been planning to put together a response to Alfred Thompson's recent post - Software Developers - Quantity vs Quality.

TL;DR, although it isn't really long and I do encourage you to read Alfred's post: a couple of articles talk about how the U.S. has the most people entering CS competitions like HackerRank but Americans are not at the top of the leaderboard. does this mean that there's less talent in America? Does it even matter?

Before getting to "does it matter," I looked over at the Kaggle leaderboards. Looking at their top 10, 2 were from the US - no other country had more than 1. The 11th placing competitor was also from the US and then 12 was from China, giving them 2 in the top 12. I also looked at recent IOI results and a quick glance seems to indicate that the USA seems to do reasonably well. In short, if you buy into ranking a country by these types of individual results on specific competitions then we're doing fine.

But, does filling the leaderboard mean a country's producing the best tech talent? Probably not.

Coding competitions focus on a specific skill set. There are problem solving aspects but they also require speed, knowledge of data structures and algorithms, and, yes, even accurate, fast typing skills. They also require you work alone. They don't encourage well designed, architected, or written code, working on existing code bases or working with a team.

Over the years, I've known some very smart and talented individuals who've excelled at these types of competitions. If you extend the pool to math and science competitions, I've known quite a few. These individuals have by and large done well for themselves but as a group, you couldn't call them more successful than any other subset of my former students. A number of them have gone on and are doing well as professors or programmers but, by and large, they're not the ones who've gone on to found companies and provide jobs for scores or even hundreds of other people and they're not necessarily the ones who've led teams that have developed major platforms and projects1

I don't argue that people who populate competition leaderboards are talented and a necessary part of our tech ecosystem but they're only a part. I probably want one of these programmers on my team, but not as the entire team (see Fake Grimlock's laws of startups - law 9).

Competitive programming is a piece of the puzzle as competitive programmers are a part of the population. So are project based events like Dream it. Code it. Win it., science fairs, and hackathons, which can be either cooperative, competitive, or a combination.

What do we want? Balance. I think the Stuy program does it pretty well. StuyCS graduates who wish to take part in coding competitions can do so but if they want to excel at it, they have to work at it on their own time. At the same time, the students learn how to work in teams and take a project from idea to delivery all the while learning some good academic CS and software engineering practices. They'll learn more in college on the academic side and the rest on the job. I'd love to see better balance in the colleges between CS programs preparing kids for graduate programs and CS programs that prepare kids for industry. I'd also love to see CS minors that were more targeted towards CS+X rather than half of a CS major targeting students going to grad schools.

I also think there's a tremendous opportunity for community colleges to fill the role currently occupied by code schools. They could more easily strike a balance between academic depth and practical preparation.

I'm working on building Hunter College's honors CS program and while I can't move the Hunter curriculum, I'm seeking that balance in my own way.

Will we get there? I don't know. Given the way education works, I figure at some point people will decide that we have to have more of a presence on the CS leaderboards and we'll see programs pop up with that in mind. I have no doubt that when that happens, we'll see many more Americans near the top. We have a large enough population that talent shouldn't be in question. This will be great for students to whom these competitions attract. It won't do much, however for the rest of the students. I'm not really concerned one way or another. Unlike math, where there's a natural progression through K12 math classes with math team and math competitions being a natural add on, the driving forces in CS - be they from industry, government, or academia don't seem to have partaken in any code competition Kool-Aid so code competitions won't become a driving force in CS ed any time soon.

Footnotes:

1

Some are but probably a smaller percent from that group than from the general pool.

Starting with scheme

Scheme is one of the languages used in Stuy's intro CS course. Like any other language, there are pros and cons of using it to introduce students to CS. Here are some of the reasons why I like Scheme as a first language and why despite that, I don't recommend it in many cases.

Scheme certainly isn't mainstream. That's not the main reason why I like it but it is a side benefit. It's less likely kids come into class knowing it which creates a level playing field. The few times I've had a student with a background in Scheme, they've been good, helpful kids rather than ones that tried to show off and dominate the class.

I like scheme because it's simple. It looks different than other languages but is (+ 3 4) really that different than add(3,4) or 3+4?

We can tell kids "everything's a function." While technically not true, and I tell my students that it isn't, it's close enough for our purposes. Everything's a function and the way we write a function is:

(f a b ...)

Apply function f on arguments b c …. So we have (+ 2 3) to add 2 and 3, (and a b) for logical and (= 3 4) to test to see if 3 is equal to 4, etc. We also have the same basic notation for things like conditionals. In java, we might write:

if (a > 5) {
 return 5;
} else {
  return 10;
}

In scheme, it would be:

(if (> a 5)
  5
  10)

Even though we're fudging the rules, we can lay out a handful of rules for the kids such as lambda and define follow a similar form to create and name functions:

(define add2 (lambda (a b) (+ a b)))

where (lambda (a b) (+ a b)) returns a function that adds a and b and define associates it with the identifier add2. Now we can use the function: (add2 5 10) which evaluates to 15.

With lambda, define, if, and a few more basics, it's off to the races. The simple, consistent syntax makes things easy for the kids and the constrained tool set lets us focus their way of thinking.

Of course this wouldn't work had DrScheme (now Racket) not existed. That gave us a nice learning IDE to work in.

Using Scheme, we can not only cover the basics like conditionals, abstraction and such but also deeper concepts like recursion, map, filter, and reduce. When we move on from Scheme, the kids also have a frame of reference for all the other languages and paradigms they use.

There are downsides, however. Outside help is harder to come by and there is some pushback from parents and it isn't as pretty and flashy as some other tool-sets. Scheme worked at Stuy for a number of reasons. When I created the class that used it, there were no good pre-AP classes in the school and I had a pretty good reputation as a teacher. The class also used multiple tools with NetLogo being the primary other one and tackled a variety of CS and non CS topics. First time through, reputation and buzz filled the classes and after that, the class developed a solid enough reputation to fill itself.

It also didn't hurt that our program developed from the inside out. First, we had APCS-AB on the books as a junior year course, then I added our post AP senior year electives. Since it was easy to show what the kids were already graduating with, it was easy to diffuse any pushback from not using mainstream tools in the first class.

Scheme worked at Stuy and I feel that it still does. Would I use Scheme for a first experience in a drop in program at an after-school where kids might not come back if they don't get to a payoff immediately? Probably not. Would I recommend it at a school where I want to integrate CS with some of the other subjects quickly, again, probably not (except for integration with algebra where Bootstrapworld is a terrific program).

In any event, if you're a high school CS teacher and haven't played with scheme or some other functional language, I highly recommend it - you might not actually ever teach it or use it but it can really help develop you as a programmer and an educator.

Selecting a starting language - why not Javascript

I was catching up with the team at Stuy the other day and they mentioned that they were periodically getting pushback on their choice of languages, particularly in the intro class. The pushback was mostly in the form of "why don't you start them with Javascript?"

Back in the day, when I created our intro class where we use Scheme, NetLogo and then later Python, I'd get similar pushback but then it was "why not Java?", "why not C?", or "whu not C++?"

We had a good discussion on this and I shared my thoughts as to why I don't like Javascript as a first language and I thought I'd share some of them here. I'll try to get around to the rationale behind Scheme and NetLogo in a later post.

To start, let me say that I Love Javascript - particularly when approaching it as a functional language. I also think every school and situation is different so there are likely times when Javascript is the right beginner language for the job.

Let's dive in.

Why are some of the pluses for Javascript as an intro language.

  • Ubiquity and availability:

    If you have a browser, you have Javascript - it's also available through online IDEs and online lightweight sites like JSFiddle.

  • Interactivity:

    You can tweak websites almost live, use the HTML5 canvas pretty interactively and mode

  • It's mainstream
  • It's quick to get up and running

This is all true, but there are also downsides.

One of my big problems with Javascript is the lack of simple solid educational tooling. I love to use tools like DrJava, DrPython, and Racket (formerly DrScheme) with beginners. All simple learning IDEs. True, you can use a simple online IDE but I haven't found them to have as strong a learning interface. They also, generally, keep you in an oversimplified programming sandbox. There's no clean transition from the sandbox to the real deal - particularly given the non-trivial state of js build tools and environments. These simple learning IDEs set the stage and then we can transition to more powerful development environments.

I also prefer, where possible, to have kids learn locally so that they can learn something about the underlying operating system even if only at a user level.

A problem relating to the lack of tooling is the fact that a JS program can fail to run and not give you any meaningful feedback at all - this is a problem for a beginner.

Javascript also has all sorts of wonkiness. We have =, and == which is pretty conventional, but then there's also ===. We have potentially confusing scoping issues and also some other real weirdness:

console.log(53-3); //  50
console.log(53-'3'); // 50
console.log('53'-3); // 50 
console.log('53'-'3'); //50

console.log(53+3); //  56
console.log(53+'3'); // '533'
console.log('53'+3); // '533
console.log('53'+'3'); // '533'

For more, check out the this video. Start watching at about 1:20 - it's a riot.

All of this weirdness actually makes sense - just not to a beginner.

Javascript also gives plenty of freedom - there are many ways to do things. This can be great for the developer but not necessarily ideal for the learner. Loops, recursion, mapping functions - you name it, Javascript's got it. I like simpler languages for beginners because it's easier to get them thinking and problem solving in certain ways when there tool set is somewhat restricted (more on that when I write about Scheme).

Finally, the fact that Javascript's a mainstream language can be a minus. Given its popularity, a beginner class could have at least a few kid who've at least played with the language. This can lead them to think they know more than they do and more importantly, this can be intimidating to the real newbies who develop the impression that "everyone knows this but me." A less mainstream language puts everyone on a level playing field.

Let me say again that I love javascript as a language and before a student graduates Stuy they can learn all about Javascript, front end development, some functional programming, and more. It's just not the right language to start with - at least not at Stuy.




Enter your email address:

Delivered by FeedBurner

Google Analytics Alternative