EppsNet Archive: Programming

Teaching Computer Science: Lessons Learned

1 Mar 2015 /

We did a programming lab in class . . . before we started, I mentioned several times that Java code that would be useful for the lab was posted on the class website.

So it surprised me that several groups got stuck during the lab when they got to the part where the sample code would have been useful because they didn’t go to the website and download the sample code.

Going forward, I will preface important announcements by saying “I cannot emphasize this strongly enough . . .” while pounding my fist on a solid object.


Teaching Computer Science: Collected Thoughts

10 Jan 2015 /

If you recognize the person on this next slide, please raise your hand. Don’t yell out the name, just raise your hand.

Derek Jeter

About two-thirds of you recognize Derek Jeter. I thought everyone would recognize him, but still a clear majority.

I’m not a Yankees fan or a Derek Jeter fan particularly but the Captain and I are on the same page on this topic. I have to admit I was pretty competitive as a student. I didn’t want anyone to do better than me and I especially didn’t want anyone to do better than me because they worked harder than me.

This Jeter quote reminded me of a quote from another notable sports figure . . .

Bob Knight

This is Bob Knight, college basketball coach, most notably at the University of Indiana. He won 902 games, three NCAA championships, and he coached the 1984 Olympic basketball team to a gold medal.

Notice that he says “everyone” and “no one.” He doesn’t say some people don’t want to come to practice. There’s a universal aspiration to accomplish great results without a corresponding level of effort. I recognize that in myself, definitely. As far as I can tell, this approach rarely if ever works, even for people we think of as prodigies.

Mozart used to say that anyone who thought composing music came easily to him was very much mistaken. While all the other kids were playing kickball, Mozart was in the house practicing his music lessons. In case you’re thinking that kickball wasn’t even a game at that time, you may be right. The point is that if there was kickball, Mozart wouldn’t have been playing it because he was practicing his music lessons.

One more on this topic . . .

Michelangelo's David

This is a quote from Michelangelo. Nothing great seems to happen without a lot of practice.

Once again, please raise your hand if you recognize the person on this next slide.

Anton Chekhov

He looks Russian.

Yes, he is Russian.

Dostoevsky? Tolstoy? Mendeleev? Pushkin? Boris Pasternak?

No . . . he’s known as an author of plays and short stories.

[A student sitting next to a smart but quiet young man from Russia points to the Russian boy and says, “He knows.”]

Who is it? Chekhov.

Right . . . this is Anton Chekhov. He wasn’t a programmer but his advice is relevant to many different endeavors.

Don’t overcomplicate things. A good heuristic – which is a fancy way of saying “rule of thumb” – is to do the simplest thing that could possibly work. Method A could work, Method B could work — which one should we try first? Try the simplest one first.

Note that the heuristic doesn’t say to do the simplest thing. If the simplest thing couldn’t possibly work, don’t do it. Do the simplest thing that might actually work.

One final slide. I don’t think anyone will know these people so I’m not asking for a show of hands.

2 days in a closet

I saw an article last week about a man and a woman who were “trapped” in a janitor’s closet at the Daytona State College Marine and Environmental Science Center for two days. They got themselves in the closet last Sunday and finally on Tuesday, the gentleman on the right got the idea to call 911. Why that idea took two days to incubate is unclear. Police showed up to let them out and found out the closet was not locked. They could have opened the door themselves.

Maybe the lock was meth’d up, like the woman. “Meth’d” up, get it?

Are they students at Daytona State College? The article doesn’t say. Do any of you have Daytona State College on your college wish list? If so, you may want to take it off. Or just keep it as a safety school in case Harvard and the Sorbonne don’t come through for you.

What can we learn from this story? I don’t want to say “don’t make assumptions” but don’t make unwarranted assumptions. Don’t make assumptions about things that you can easily verify. If you’re in a closet, don’t assume the door is locked. Try it and see. A lot of uncertainty can be dispelled by trying things out.

Assumptions can hurt you as a programmer. You might be stuck because you’re assuming some condition is true that isn’t true. Or you’re assuming that some condition can never be true when it really can be true. Don’t make unwarranted assumptions.

I couldn’t help noticing that a lot more people recognized Derek Jeter than recognized Anton Chekhov. If you want to achieve great renown, if you want to be part of the public consciousness, entertain people in a simple-minded way, like hitting a ball with a stick and running around in a park. People can be entertained by Derek Jeter without expending any effort.

Where Chekhov went wrong is that he failed to anticipate a world where nobody reads anymore. Furthermore, he believed that the role of an artist was to ask questions, not to answer them. His plays and stories don’t have a traditional structure where everything is tied up neatly at the end, so you not only have to put in the time to read them, you have to go into overtime to ponder the moral ambiguities. Who has time for that in their busy lives?


60 Million Students

29 Dec 2014 /


Teaching Computer Science: Exam Tips from the Pros

18 Nov 2014 /

When I cover something in a review session or study guide, it’s because I know it’s going to be on the test. There were questions during this morning’s test about the workings of several Java methods, all of which were covered in the review session and the study guide. I can’t answer questions like that during the test so if you have questions about review topics, ask them in advance of test day.

Some people seem to think that having an excuse for not knowing something is as good as actually knowing it. “But we hardly spent any time on Topic X in class.” “But we just learned Topic Y yesterday.”

Even if either one of those were true, what difference would it make? It’s on the study guide and it’s going to be on the test.

Given a choice between knowing something and having an excuse for not knowing it, always go with the first option: knowing it.


Teaching Computer Science: Diversity Takes a Hit

24 Sep 2014 /

They told us during teacher training in the summer not to scare off the students. But programming is difficult. There’s a lot of complexity and detail to master. The first couple of programming classes I took, we started off with around 50 people on the first day, and had around 12 left for the final exam. Entry-level programming classes have very high dropout rates.

One of our students dropped the class this week, a girl. So much for promoting diversity in computer science . . .


Teaching Computer Science: Applause

23 Sep 2014 /

Applause

We did an interactive exercise to write a simple program that prints numbers and the squares of the numbers — a for loop, basically. We went around the room with each student providing one element of the loop and me writing them on the whiteboard: for, open paren, int, i, equals, 1, semicolon, etc.

I thought it went very well. The timing was good and it was obvious that most of the class understood what was going on. When we got to a girl who’s usually ahead of everyone and knows all the answers, what we needed from her was “curly bracket” but what she actually said was “semicolon” and there was a collective groan from the rest of the class.

When the last student said “close curly bracket,” there was spontaneous applause, immediately, before I even wrote it on the board. It wasn’t like a concert at the high school auditorium where a piece ends and there’s a gap — “Is it over? Do we clap now?” It was like a classical concert with a high-brow audience that knows exactly when the piece ends and when to clap.


Teaching Computer Science: Asking for Help

15 Sep 2014 /

I’m not sure students are asking for help enough despite my repeated admonitions to do so.

On the first day of class, I said, “Ask for help early and often. If you ask for help when you’re in trouble, you waited too long. Ask for help when things are going well. That’s a good heuristic in this class and in other areas of life as well.”

Later I said, “Learn to distinguish between persistence and floundering. Persistence is good. Floundering is bad. Don’t flounder.”

Yesterday I said, “You may think, ‘Well, if I was a better programmer, I wouldn’t have to ask for help.’ That’s incorrect. As you get to be a better programmer, you’re given harder problems to work on. I’ve been programming for 30 years — almost — and I ask for help every day.”

Honestly I feel like a mental case repeating the same thing over and over and yet out of 34 students in the class, 12 didn’t turn in the first assignment, most apparently because even though they finished it, they didn’t know how to turn it in (via an upload link on the class website) and didn’t ask for help or couldn’t figure out how to locate Java files in a project directory and didn’t ask for help . . .


Teaching Computer Science

1 Sep 2014 /
School

Tomorrow is my first day as an AP Computer Science teacher at Corona del Mar High School. It’s a volunteer gig through the TEALS organization.

Only about 10 percent of U.S. high schools offer computer science classes and at most of those schools, it counts as an elective, like Home Ec or Wood Shop, not as a class that can be applied toward graduation like math or science.

The most popular AP exam in 2013 was US History — 439,552 students took the AP US History exam. Only 31,117 students took the AP Computer Science exam. That’s about the same number as the AP Art History exam. I don’t want to denigrate the study of art history, but given the ubiquity of computers and software and programming in daily life, the study of computer science seems more likely to enable a person to be self-supporting and to contribute to the common good.

I’ve heard people say that computer science should be taught in every high school in America. That may be a good idea, but no one ever says where all the qualified computer science teachers are supposed to come from. The TEALS vision is to put high-tech professionals like myself in schools to teach computer science and to teach teachers to teach computer science.

I’m happy to have the opportunity but I’m also scared, I might as well put that out there. What am I scared of? Like everything else, that I won’t perform to expectations and that I’ll be exposed as a phony.


Programmers Don’t Play Polo

16 Aug 2014 /

On the product page for a book on software development principles, Amazon showed me this:

Customers also viewed ...

The product on the right — is that a bug in the cross-selling algorithm? I’ve worked in software development for about 30 years and have never met one person interested in the game of polo . . .


This Kid Made an App That Exposes Sellout Politicians

8 Jul 2014 /

Via VICE:

http://www.vice.com/read/greenhouse-app-hannah-ewens-nick-rubin-201

Yes, the algorithm is


if (isPolitician(x)) {
    x.sellout = true;
}

Thus spoke The Programmer.


3 Links

26 Jun 2014 /
  1. 9 Things Bruce Lee Taught Me About Programming
  2. What a coach can teach a teacher, 1975-2004: Reflections and reanalysis of John Wooden’s teaching practices
  3. Wolfram Programming Cloud Is Live!

“Not Knowing How to Code is Like Not Knowing a Basic Skill”

20 Jun 2014 /

9 Links

1 Mar 2014 /
  1. Data Structure Visualizations
  2. Good Tech Lead, Bad Tech Lead
  3. Google Java Style
  4. Guide to 12 Disruptive Technologies
  5. How to Write a Cover Letter
  6. The Landing Page Optimization Guide You Wish You Always Had
  7. Selendroid: Selenium for Android
  8. UX Axioms by Eric Dahl
  9. Yelp’s got style (and the guide to back it up)

A $15 Minimum Wage is Not Going to Help You

6 Dec 2013 /

Fast Food Workers Will Strike On Thursday In L.A. : LAist

Fast food workers staged a one-day strike for “living wages.” More specifically, they want the federal minimum wage to be raised from $7.25 an hour to $15.

Fast food

(Photo credit: H Dragon)

You want to make a living wage? I’ll tell you how to make a living wage. I’ve had a lot of jobs and this method has never failed me.

Here it is: Before accepting a job offer, you always ask yourself, “Does this job pay enough for me to live on?” And if the answer is no, then you don’t take that job.

If you want to earn $15 an hour, do what I do: get a job that pays $15 an hour. Who’s stopping you?

If no one’s willing to pay you $15 an hour, it’s because the skills, intelligence and motivation that you bring to the table don’t allow you to do anything that’s worth $15 an hour. You need to do something about that. You need to be able to deliver $15 of value to an employer. Figure that out.

Setting the minimum wage at $15 is not going to help you. If you set the price of something at more than it’s worth, people are not going to buy it.

Imagine this: My friend Paul Epps is a programmer. Let’s say we passed a Minimum Wage for Programmers law that says that programmers must be paid at least $200,000 a year. Is that good news for Epps?

No, it isn’t.

His boss calls all the programmers into a meeting and says, “Well, according to the new Minimum Wage for Programmers law, I can’t hire any of you for less than $200,000 per year. You know what that means?”

“We all get a big raise?” Epps suggests hopefully.

“No, it means you’re all fired. Get out of here.”

Or imagine this: We pass a Minimum Price for Restaurants law that says you can’t get a meal in restaurant unless you pay at least $15 for it. What will that do to sales of Quarter Pounders and Jumbo Jacks?

People will stop buying those things. Many restaurants serve meals for which customers are willing to pay $15, but a fast food burger isn’t worth $15, even with fries and a drink, so people will stop buying those things.


Fast Work

17 Nov 2013 /

A junior high school math teacher posted this on Facebook:

math-test

That makes perfect sense to me. Work gets done a lot faster if the results don’t have to be correct.

Thus spoke The Programmer.


Agile, ALM, and Agile 2.0 — Putting the Cart Before the Horse?

1 Aug 2013 /
Cart before horse

Speaking of selling chickens still in shells, an august panel of industry giants laid out their recent improvements and plans for ALM products (Application Lifecycle Management, for those not in the know). These guys dazzled the audience with how they’ve moved far beyond simple source code repositories and testing tools to a complete integration of all modern software practices. Quite a coup, indeed, since most real live software developers I’m seeing out there today still aren’t using the practices automated by the ALM tools. . . .

In other words, many software developers aren’t using practices such as test driven development or source version control. Yet here are HP, Microsoft, and IBM announcing new ALM tools that automate more advanced practice in areas not even in use in the first place. Unbelievable.


Engineering Humor

9 Mar 2013 /
Root beer

An engineer walks into a bar and orders 1.0E20 root beers.

Bartender: “That’s a root beer float.”

Engineer: “Make it a double.”

[HT: Scott Hanselman]


Victor Szalvay: Technical Debt for PMs

Posted by on 5 Mar 2013

HTML5 Date Tag

21 Dec 2012 /

I learned something interesting about the HTML5 date tag. Look at this calendar dropdown:

HTML5 date tag

Here is the sum total of code needed to make that happen in a Chrome browser:

  1. <input type="date" />

That’s it! No Javascript, no CSS. Programmers these days have it easy.


How to Lose Your Job : A Fictional Memoir (Part I)

4 Sep 2012 /

Because of the huge productivity differences between good programmers and bad programmers — 10x? 28x? More? — my biggest leverage point as a development manager is my ability to hire people.

At my last job, we had an HR Director named Lucy. In every one of our annual Employee Satisfaction Surveys, Lucy’s group had the lowest scores in the entire organization. Nobody liked or respected her.

She was, however, close with the CEO, which made that irrelevant.

Clowns

Lucy’s friend Kathy Slauson runs the Slauson and Slauson recruiting agency, so that’s where we got our programming candidates, who were mostly terrible.

The Slauson agency doesn’t specialize in IT candidates, although they do have a “technical recruiter,” who unfortunately knows nothing about technology.

They don’t bring candidates in for in-person interviews. They take whatever candidates give them in the form of a résumé and they pass the résumés along to clients like me in hopes of being paid a fee.

  1. Candidates send résumés to Slauson.
  2. Slauson sends them to me.

What value does this add over candidates sending résumés directly to me? None.

Slauson doesn’t qualify candidates. They don’t map abilities and skills against the requirements of a position. They add no value to the process, and I had to screen all the résumés myself, the same as if I’d just bought them from a job board.

When I saw that Slauson was just going to throw résumés at me, I asked them to please add a short write-up, indicating why they thought each candidate was a good fit for the job.

What I got was write-ups like “Candidate is good with Technology X,” where Technology X is something I indicated as a job requirement.

When I asked “How did you assess that the candidate is good with Technology X?” they would tell me “We asked him.” Or “It’s on his résumé.”

In other words, “Candidate is good with Technology X” meant “Candidate states that he’s good with Technology X. Unverified.”

 

(If you’re wondering at this point why an HR department would funnel good money to a recruiting agency for doing nothing, go back and reread the part where I mention that Kathy Slauson is a personal friend of Lucy the HR Director.)

 
Money to burn

I said earlier that Slauson has a “technical recruiter.” She was in the office one afternoon and handed me a résumé.

“He doesn’t look like an ASP.NET programmer,” I said after looking it over, “which is what we’re looking for. For example, I don’t see any C# experience.”

“It’s right here,” she said, pointing at the résumé where it said this: C++.

If you’re not a programmer, you might say, well, easy mistake to make. C# (pronounced C-sharp, like a musical note) and C++ (pronounced C-plus-plus) are both programming languages containing the letter C followed by one or more symbols.

But whereas C# is the primary programming language for web development on the Microsoft platform, C++ is a lower-level language used for system development. Nobody does web development in C++.

Not surprisingly, a high percentage of Slauson’s candidates bit the dust in the initial phone screen with me, because the phone screen was their first encounter with someone whose programming knowledge was non-zero and could possibly tell a good programmer from a bad programmer.

According to Kathy Slauson, that was totally unacceptable. She thought that because she had an in with the HR department, we should be hiring every candidate she sent over, qualified or not, and paying her for the privilege, which is the way it worked before I arrived on the scene and screwed up the process.

Money and whiskey

She was always very polite to me in person, assuring me that she was doing her best to improve the quality of candidates, but behind the scenes, she was telling Lucy the HR Director that I shouldn’t be allowed to interview candidates anymore.

(That information was never supposed to reach me but it did.)

Think about that: we had a recruiter telling our HR Director that a manager shouldn’t be allowed to interview their candidates. (The fact that I no longer work there tells you which side of the issue Lucy came down on.)

Kathy also told Lucy that the candidates I was rejecting were perfectly good candidates because after I turned them down, they were being hired at other companies.

Imagine that!

Of course they were being hired at other companies. They were being hired by companies with lower hiring standards for programmers. The best thing that could happen with some of those candidates is for them to be hired by competing organizations.

Do you think Amazon or Google worry that candidates they turn down get hired somewhere else?

(No, I wasn’t trying to match hiring standards with Amazon or Google. I’m just saying that it wasn’t my goal to be the employer of last resort, or to be able to say, “If we don’t hire ‘em, nobody’s gonna hire ‘em!”)

Everyone I hired was an order of magnitude improvement over the people they replaced.

I like to work with talented people. I’m not trying to get rich and I don’t have a career path. I’m trying to learn and get better and contribute to my profession.

If you give me a job where I’m responsible for hiring people, I’m going to hire the best people available, and decline to be force-fed unqualified candidates by a friend of the HR Director.

To be continued . . .


Next Page »