My favorite bread pudding recipe…

Published by:

I had forwarded a post up on Facebook about the 12 Best Bread Puddings in New Orleans and got some recipe requests. Here’s the one I use, lifted many moons ago from one of bourbon websites. Enjoy!

INGREDIENTS

Bourbon Sauce:

	* 1/2 cup (1 stick) butter, melted
	* 1 cup sugar
	* 1 egg
	* 1 cup Kentucky bourbon whiskey

Bread Pudding:

	* 1 loaf French bread, at least a day old, cut into 1-inch squares (about 6-7 cups)
	* 1 qt milk
	* 3 eggs, lightly beaten
	* 2 cups sugar
	* 2 Tbsp vanilla
	* 1 cup raisins (soaked overnight in 1/4 cup bourbon)
	* 1/4 teaspoon allspice
	* 1/4 to 1/2 teaspoon cinnamon
	* 3 Tbsp unsalted butter, melted

Bourbon Sauce:

In a saucepan, melt butter; add sugar and egg, whisking to blend well. Cook over low heat, stirring constantly, until mixture thickens. (Do not allow to simmer, or it may curdle.) Whisk in bourbon to taste. Remove from heat. Whisk before serving. The sauce should be soft, creamy, and smooth.

Bread Pudding:

  • Preheat oven to 350°F.
  • Soak the bread in milk in a large mixing bowl. Press with hands until well mixed and all the milk is absorbed. In a separate bowl, beat eggs, sugar, vanilla, and spices together. Gently stir into the bread mixture. Gently stir the raisins into the mixture.
  • Pour butter into the bottom of a 9×13 inch baking pan. Coat the bottom and the sides of the pan well with the butter. Pour in the bread mix and bake at 350°F for 35-45 minutes, until set. The pudding is done when the edges start getting a bit brown and pull away from the edge of the pan. Can also make in individual ramekins.
  • Serve with bourbon whiskey sauce on the side; pour on to taste. Best fresh and eaten the day it is made. Makes 8-10 servings.

25 Random Things About Me

Published by:

There was a meme going around Facebook a while back where you were asked to write “25 Random Things About Yourself, Then Tag Someone Else to Do It”. This was one of the posts that got lost in the transaction from my old web host to the new host. So, I thought I might copy this over for the sheer joy of your reading pleasure. So, here’s 25 random things about me (most of which I suspect people might not have wanted to know)

  1. I have stood on the walls of the Old City of Jerusalem and watched the Sun rise over the Mount of Olives.
  2. I’ve been programming computers for almost 30 years.
  3. I wonder why it took me 15 years to realize that I would be much happier if I finished my Ph.D.
  4. I am allergic to coffee and marijuana.
  5. My mother is amazed by the fact that I like to work in my yard and to garden given how little effort I put into helping in the yard and garden when I was little.
  6. Only one baby picture of me survived the fire that destroyed my parent’s mobile home when I was five years old.
  7. I hate vacuum cleaners as result of my brother always making me vacuum the house when he babysat my sister and I when we were growing up. This explains why I get along so well with the Dust Bunnies in my home.
  8. I am terribly afraid of bees, hornets, and wasps due to an emotionally scarring experience at a family picnic when I was 4 years old.
  9. However, it was that same picnic where I first learned to fear bees that resulted in my fascination to this day with trains.
  10. I was a complete and total emotional train wreck during most of my undergraduate years at Sewanee.
  11. Of all the courses I took at Sewanee, I have found that the acting classes have best prepared me best to work in academia due to fact that I treat every lecture as a performance.
  12. I suspect that I’m like every other graduate of Sewanee who’s is working on or has completed their Ph.D.: I wonder if I could ever join the faculty?
  13. As much as I love to read science fiction novels, I really cannot stand most of the science fiction on television and in the movies.
  14. People always seem to underestimate the comic genius of The Three Stooges.
  15. I spent New Years Eve of the Millennium Year 2000 in a trauma center in my hometown awaiting gall bladder surgery. You see the most fascinating things in a trauma center on the New Years Eve of the Millennium.
  16. I have spent extended periods of time in London, Tel Aviv, Jerusalem, and Mexico City.
  17. I have been to every state except for New Hampshire and Vermont. I intend on rectifying this deficiency once I complete my Ph.D.
  18. I have a great fear of heights.
  19. Someday I hope to be invited to lunch with Nero Wolfe and see the orchids in the greenhouse on the roof of his brownstone.
  20. Someday I hope to be able to play Shakespeare’s merry rogue, Falstaff.
  21. It is difficult to write, it is damned difficult to write well.
  22. Guilty admission time: I really like The Benny Hill Show.
  23. I will continue to practice until I can consistently make a good pan of biscuits.
  24. Someday travel plans: go back to the Holy Land, visit the Isle of Lewis in Scotland, again drink a pint in a country pub in England, ride the train over the Andes in Chile, drink wine in the wineries of South Australia, and see the Taj Mahal.
  25. I have been greatly blessed by all of those whom I’ve had the great fortune to have met over the years, hope to be able to meet the rest of you, and wish you all “Bon Chance” and “Auf wiedersehen” wherever you may go and whatever you may do.

How to tide yourself over until someone restarts the Hostess brand

Published by:

Well, the maker of Hostess Cupcakes (and other pre-packaged snack cakes that might survive a nuclear attack) has gone to Chapter 7 bankruptcy and is closing down. While it’s pretty clear that someone will buy their brands, it may be a while before you can get the Hostess Twinkie fix.

The people at America’s Test Kitchen published a recipe for a version of the classic Hostess Cupcake that I’ve used a couple of times. While it may not have the ability to be used as survival food, it’s pretty darn good.

This is based on the ATK original, tweaked to address some food allergies that I suffer from… There’s a rather neat trick here for filling the cupcake by cutting out a conic section, slicing off half, and then replacing and frosting over the top.

CUPCAKES
1 cup all-purpose flour
0.5 teaspoon baking soda
0.25 teaspoon salt
0.5 cup boiling water
0.3 cup cocoa powder
0.3 cup semisweet chocolate chips
0.75 cup sugar
0.5 cup sour cream
0.5 cup vegetable oil
2 large eggs
1 teaspoon vanilla extract
FILLING
3 tablespoons water
0.75 teaspoon unflavored gelatin
4 tablespoons (0.5 stick) unsalted butter, softened
1 teaspoon vanilla extract
Pinch salt
1.25 cups marshmallow creme
GLAZE
0.5 cup semisweet chocolate chips
3 tablespoons unsalted butter
  • MAKE BATTER: Adjust oven rack to middle position and heat oven to 325 degrees. Grease and flour 12-cup muffin tin. Combine flour, baking soda, and salt in bowl. Whisk water, cocoa, chocolate chips, and espresso in large bowl until smooth. Add sugar, sour cream, oil, eggs, and vanilla and mix until combined. Whisk in flour mixture until incorporated. Divide batter evenly among muffin cups. Bake until toothpick inserted into cupcake comes out with few dry crumbs attached, 18 to 22 minutes. Cool cupcakes in tin 10 minutes, then turn out onto wire rack and cool completely.
  • PREPARE FILLING: Combine water and gelatin in large bowl and let sit until gelatin softens, about 5 minutes. Microwave until mixture is bubbling around edges and gelatin dissolves, about 30 seconds. Stir in butter, vanilla, and salt until combined. Let mixture cool until just warm to touch, about 5 minutes, then whisk in marshmallow creme until smooth; refrigerate until set, about 30 minutes. Transfer 1⁄3 cup marshmallow mixture to pastry bag fitted with small plain tip; reserve remaining mixture for filling cupcakes.
  • ASSEMBLE CUPCAKES: Microwave chocolate and butter in small bowl, stirring occasionally, until smooth, about 30 seconds. Cool glaze to room temperature, about 10 minutes. Cut cone from top of each cupcake and fill cupcakes with 1 tablespoon filling each. Replace tops, frost with 2 teaspoons cooled glaze, and let sit 10 minutes.

Finally time again to both blog and bake…

Published by:

Been a while since I’ve posted here on my blog. Lots of stuff gone under the bridge since my last post back in January of this year: job hunting, mad rush to finish the dissertation, finding a job, graduating, moving, and then starting the new job. Things are finally settled enough to where I can again pay attention to blogging.

Well, it’s time to start getting back into the flow. We’ll start things off with a recipe for chocolate chip cookies that I used the other day for a picnic supper (thanks Kelley and Derrick for the invite!). This is based on a recipe I found about 5 years ago in Cook’s Illustrated. They do a few things different than the standard Toll House recipe for chocolate chip cookies. First, they do a mix of white and dark brown sugar. Then, they switch to 1 egg and 1 egg yolk rather than 2 eggs. Finally, instead of the standard creaming of the butter, they brown about 3/4 of the butter in a skillet and then add the remaining butter in before adding to the mix. Combining these things together gets you a more chewy cookie while keeping the crisp edges people seem like in their cookies.

It’s good…

INGREDIENTS
1 3/4 cups unbleached all-purpose flour (8 3/4 ounces)
1/2 teaspoon baking soda
14 tablespoons unsalted butter (1 3/4 sticks)
1/2 cup granulated sugar (3 1/2 ounces)
3/4 cups packed dark brown sugar (5 1/4 ounces) (see note)
1 teaspoon table salt
2 teaspoons vanilla extract
1 large egg
1 large egg yolk
1 1/4 cups semisweet chocolate chips or chunks
3/4cup chopped pecans or walnuts, toasted (optional)

INSTRUCTIONS

  1. Adjust oven rack to middle position and heat oven to 375 degrees. Line 2 large (18- by 12-inch) baking sheets with parchment paper. Whisk flour and baking soda together in medium bowl; set aside.
  2. Heat 10 tablespoons butter in 10-inch skillet over medium-high heat until melted, about 2 minutes. Continue cooking, swirling pan constantly until butter is dark golden brown and has nutty aroma, 1 to 3 minutes. Remove skillet from heat and, using heatproof spatula, transfer browned butter to large heatproof bowl. Stir remaining 4 tablespoons butter into hot butter until completely melted.
  3. Add both sugars, salt, and vanilla to bowl with butter and whisk until fully incorporated. Add egg and yolk and whisk until mixture is smooth with no sugar lumps remaining, about 30 seconds. Let mixture stand 3 minutes, then whisk for 30 seconds. Repeat process of resting and whisking 2 more times until mixture is thick, smooth, and shiny. Using rubber spatula or wooden spoon, stir in flour mixture until just combined, about 1 minute. Stir in chocolate chips and nuts (if using), giving dough final stir to ensure no flour pockets remain.
  4. Divide dough into 16 portions, each about 3 tablespoons (or use #24 cookie scoop). Arrange 2 inches apart on prepared baking sheets, 8 dough balls per sheet. (Smaller baking sheets can be used, but will require 3 batches.)
  5. Bake cookies 1 tray at a time until cookies are golden brown and still puffy, and edges have begun to set but centers are still soft, 10 to 14 minutes, rotating baking sheet halfway through baking. Transfer baking sheet to wire rack; cool cookies completely before serving.

Selah.

Memories of elementary school: Moravian Chicken Pie

Published by:

I’ve been wanting to try this for a few weeks. I saw a similar recipe in a recent issue of Cook’s Country magazine and it reminded me of a pot pie that was served in the lunchroom of our elementary school back in the late 1960s in the NC mountains (back when they actually cooked stuff in elementary school lunchrooms). The magazine version used a homemade sour-cream pie crust, this version uses pre-made crusts.

2(10- to 12-ounce) bone-in split chicken breasts, trimmed and halved crosswise
3(5- to 7-ounce) bone-in chicken thighs, trimmed
Salt and pepper
1 tablespoon vegetable oil
3 cups low-sodium chicken broth
1 bay leaf
2 tablespoons unsalted butter
1/4cup all-purpose flour
1/4 cup milk 
2 prepared pie crusts
1 large egg, lightly beaten
  • Pat chicken dry with paper towels and season with salt and pepper. Heat oil in large Dutch oven over medium-high heat until just smoking. Cook chicken until browned all over, about 10 minutes; transfer to plate. Pour fat (you should have 2 tablespoons) into small bowl; reserve. When chicken is cool enough to handle, remove and discard skin. Add broth, chicken, and bay leaf to now-empty pot and bring to boil. Reduce heat to low and simmer, covered, until breasts register 160 degrees and thighs register 175 degrees, 14 to 18 minutes. Transfer chicken to bowl. When chicken is cool enough to handle, shred into bite-size pieces, discarding bones. Pour broth through fine-mesh strainer into second bowl and reserve (you should have about 2¾ cups); discard bay leaf.
  • Adjust oven rack to lowest position and heat oven to 450 degrees. Heat butter and reserved fat in now-empty pot over medium heat until shimmering. Add flour and cook, whisking constantly, until golden, 1 to 2 minutes. Slowly whisk in 2 cups of reserved broth and half-and-half and bring to boil. Reduce heat to medium-low and simmer gravy until thickened and reduced to 1¾ cups, 6 to 8 minutes. Season with salt and pepper to taste. Combine 1 cup gravy with shredded chicken; reserve remaining gravy for serving.
  • Line pie plate with one of the pie crust rounds. Transfer chicken mixture to dough-lined pie plate and spread into even layer. Top with second dough round, leaving at least 1/2-inch overhang all around. Fold dough under itself so that edge of fold is flush with outer rim of pie plate. Flute edges using thumb and forefinger or press with tines of fork to seal. Cut four 1-inch slits in top. Brush pie with egg and bake until top is light golden brown, 18 to 20 minutes. Reduce oven temperature to 375 degrees and continue to bake until crust is deep golden brown, 10 to 15 minutes. Let pie cool on wire rack for at least 45 minutes.
  • When ready to serve, bring remaining ¾ cup reserved gravy and remaining ¾ cup reserved broth to boil in medium saucepan. Simmer over medium-low heat until slightly thickened, 5 to 7 minutes. Season with salt and pepper to taste. Serve pie with gravy.

With a tip of the hat to the folks at Cook’s Country

A philosophy of teaching

Published by:

The supreme end of education is expert discernment in all things — the ability to tell the good from the bad, the genuine from the counterfeit, and to prefer the good and the genuine to the bad and the counterfeit.
— Samuel Johnson

I enjoy teaching and have done it for several
years, both in academia and industry. The main subjects in which I have gained teaching experience include Computer Architecture, Computational Science and Scientific Computing, and Information Technology. I have experience teaching students at all levels, from teaching introductory class for non-Computer Science majors, to teaching upper division classes for Computer Science students, and to mentoring both undergraduate and graduate students in independent studies. I can teach these subjects with utmost ease and look forward to an opportunity for teaching these as well as other related subjects.

In a recent article in Sewanee, the quarterly magazine for
alumni of The University of the South, Dr. Joel Cunningham, Vice
Chancellor Emeritus of the University, addressed the question “What is worth learning?” In his remarks, Dr. Cunningham related a conversation he had with a recent alumnus of the University about Andrew Lytle, a noted author of literature about the American South. The alumnus recalled that Mr. Lytle took the position that the modern focus on “What do you do?” is wrong. Rather, Mr. Lytle thought it to better to ask “Where do you come from?”, “Who are your people?”, and “Who are you?”. As educators, we must, through scholarship, strive to guide
our students towards an understanding of these questions and aid our students in their search for their own answers to said questions.

The Carnegie Foundation for the Advancement of Teaching defines
scholarship in teaching as being built from three components:

  • discovery: research and performance that adds to
    a knowledge base and intellectual climate of an institution,
  • integration: drawing together and interpreting
    diverse kinds of knowledge, and
  • application: applying knowledge to practical problems.

Scholarship of discovery means we strive to create a sense of discovery and wonder in our students whether we are in the classroom or the laboratory. The experience goes beyond classroom and laboratory; for as we enable our students to absorb concepts through experience, they provide us with new insights into the subject. This inspires us to teach in more creative
ways by exploring alternative approaches.

By fostering a sense of discovery in our students, we build
enough foundation and kindle enough appetite in them that they
realize that they are capable of scholarship of integration upon their own volition. Today’s students pull information from many sources and it is my task to incorporate traditional teaching tools, hands-on experience in labs, and non-traditional teaching tools from the Internet such as social media to provide the best possible learning environment. In particular, complementing the in-person classroom experience with an on-line presence and research opportunities helps the student link coursework with practical real-world experience.

Effective learning requires the student to be able to apply knowledge taught in the classroom to practical situations. I accomplish this by highlighting how the subject being taught plays an important role in our daily lives, the applicable commercial products and specific companies producing hardware/software in that area, and promise and challenges of that subject in the coming years. Laboratory exercises, programming assignments, and classroom lectures in my classes are designed with the
objective of linking material in the classroom environment to practical application. This fosters independent, logical, and analytical thinking into my students so that they learn how to solve problems on their own. As my students devise their own approaches and bring novel ideas in being, I learn from them in turn.

In higher education, we have two goals towards which we must
strive. First, we must be able to answer Mr. Lytle’s questions for
ourselves so that we can answer without thought or hesitation: “This is who I am!”, “These are my people!”, and “This is me!”. Then, we have to answer to the most difficult challenge: coaxing, convincing, and with just a little bit of forcing those whom we teach to be able to answer those sorts of questions for themselves with the same sort of verve and elan that we expect of ourselves.

We’re back

Published by:

So, I’m back in the blogging business…

For about 10 years, my web site and blog were hosted by a small web hosting provider based in Germany. They always came across as being a bit dodgy but kept their servers running, provided me the base service I needed, and generally stayed out of the way.

Well, finally the excrement hit the oscillating device and we had a bit of a tiff over billing; they charged my card the annual renewal, turned off my access, and tried to screw me out of the refund. Sadly, it ended up with the overseas outfit locking down my old domain and refusing to provide me the transfer code.

At this point, I’ve now switched over to the one of the large web-hosting providers and moved over enough of my content to get back on my feet. I’m still restoring content from my old blog and well be adding stuff over time. In the meantime, enjoy!

Selah.

Computing like it’s 1999

Published by:

One of my recent “science fair” projects has been trying to get an older ASUS EeePC 900A netbook configured to a usable state. This was one of the first really practical netbooks with a 1st generation Intel ATOM processor with 1GB of Memory and one of very first practical SSD cards for file storage with 4GB of space. Not the most capable of machines from a hardware standpoint. ASUS shipped the machine with a rather hacked-up lightweight Linux distro. Sadly, the distribution they selected wasn’t one of the mainstream distributions like Debian, Ubuntu, or Fedora. This meant that you didn’t have access to a lot of the stuff that you need to work in an academic environment like my workplace. So, you say “Big deal, just install the NetBook Remix of Ubuntu?” It’s the problem of “Linux… just too darn fat” raising it’s ugly head again. Even the netbook oriented repackages of Ubuntu or Fedora assume a much more capable machine than what the 900A can handle.

That got me thinking: you know the specs on this machine would have been pretty sweet back 10 years ago. So, how would I have configured Linux back around 1999 and would that configuration be useful today. First step: how to setup the OS. GNOME and KDE are right out… And that gets rid of a ton of fat right there. Think about it: how much of what those desktop managers install do you really use in the normal course of business. OK, do we even need X-Windows? Could I really be that “Tech Neanderthal” and just work with text-mode EMACS on a Linux console?

Problem is web browsing. The guys at Google may be onto something with ChromeOS given how much time I spend during the day doing useful stuff in the web browser. However, while you can do a lot stuff using text mode browsers like w3m, a lot of the stuff you want to do just requires a GUI. OK, so we need a X-Windows and, thus, some sort of window manager to go with it. The best solution I’ve found was Fluxbox: it’s lightweight and works well.

Beyond web browsing,everything else that I do in my life I can do from inside EMACS. Writing documents (with AUCTEX and TeXLive), reading and responding to E-mail, manage my day-to-day tasks can all be done using the “editor that thinks it’s an operating system”. So, with the base OS, X/Windows+Fluxbox, Firefox, and GNU Emacs installed, I’ve used up about 80% of the 4GB SSD. Put my /home partition (where user data is stored) on a 4GB flash card in the flash card slot combined with a well-tuned command-line installation of Dropbox and I’m in business.

Of course there are still problems. The hardware is pretty slow, esp. when surfing to graphics-intensive web sites. I have to aggressively manage what files I keep local to the netbook given the available space. Particularly vexing is dealing with the dependency hell that is modern Linux package management. Good example is UI toolkit that I had to install for teaching purposes the other day. For one package, I had to install nearly 40 other dependent packages. It’s getting almost as bad as DLL-hell on Windows.

So, worthy experiment? Yep, I now have a usable travel machine that’s about 3 pounds lighter than the MacBook Pro I use at work. Still saving up to get a MacBook Air, tho’. And it does lend some credence to the thought that the GNOME, KDE, Windows, and Mac OS X folks have gotten complacent about the amount of resources they use when building applications.

Selah.

Talk to me about being effective, not being efficient

Published by:

In the course of finishing up the dissertation, I’ve been reminded about that old argument between being effective vs. being efficient. Like just about every graduate student, I was getting the “work harder, work faster” speech from my committee chair. A large part of those diatribes involved discussions about being more efficient in my work and dealing with adjusting the focus knob.

Here’s how the words are defined by dictionary.com:

Effective (adj.): Adequate to accomplish a purpose; producing the intended or expected result.

Efficient (adj.): Performing or functioning in the best possible manner with the least waste of time and effort.

Getting my head clear about the difference between these two things has been one of major roadblocks towards finishing my dissertation. I’ve become quite efficient about doing the things I’ve needed to do to get through the last semester but most of what I’ve been doing hasn’t been very effective  in moving me towards finishing.

So, how to break the pattern? It varies from person to person but I started with a  two step plan. First, keep track of what you do during the day. This is something some people do without thinking… I’m not one of those people and a I think I’m a member of the majority in that regard. The result is that I find myself becoming very interrupt-driven. I quickly noticed just how scatter-shot my time had become.

Second, do some “post-mortem” (and “after-death” is the right term here given how my advisor wants to shoot me) and look at how you spend your time after a few days of tracking your work. Then, prune and watch what you do.

Selah.

The C++11 standard and C++ as a teaching language

Published by:

The C++ Standards Committee recently published the 2011 update to the language standard with a large body of new features. Looking over some of the changes got me thinking again about my experiences as a software developer using the language and as an instructor teaching others how to use C++. And I’m not certain that the changes in the standard bodes well for the use of C++ as a teaching language.

A Historical Perspective

Like many who were first introduced to computers in the late 1970s and early 1980s, I learned how to hack using BASIC and assembly language, how to program using Pascal, and finally understood computer science when I grokked LISP and Smalltalk in my first run at graduate school. My introduction to C was in the late 1980s while learning to become a UNIX system administrator while working on my Master degree and C++ in my first real job writing point-of-sale software. So,like most people in my generation I’m not a native C++ speaker; most of the time I’m really thinking in C.

So, why comment now?

Part of my Ph.D. experience has involved working as a part-time instructor in our undergraduate program. Our department is very old-school in many ways; one of which is that we use C++ as our primary teaching language. And we teach C++ exactly as I learned the language 20 years ago in that we first teach imperative programming using the language as more fancy version of C and then we teach the object-oriented features. In other words, for the student’s first three or four semester we teach them that “C++ is just a better C compiler” and then dump object orientation on them when they have to also struggle with all of the theory of data structures. This brings us back to some of the features in the new language standard and how people who are taught to program in C++ in this traditional manner will never think to use them.

So what are some of these features?

Danny Kalev is a tech blogger and consultant who served on the C++ standard committee who recently posted a blog (here) that highlighted what he considered to be important new features of the standard. Let’s take a look at a few of those features from a teaching standpoint.

Null pointers

One of the big problems with not only C++ but also C is the way one dealt with concept of null pointers. From day 1 in both languages, the concept has been that machine addresses were represented by an integral subtype with value of 0 indicating an invalid null address. This lead to many issues in programs with people being caviler about treating the integer value of zero as being the same as indicating a NULL pointer. You have to be diligent in teaching people the difference between the two concepts and how to avoid the problems that are introduced by this convention.

So the convention developed that you would define a preprocessor value called “NULL” that you set to zero to indicate you were working with a null pointer value. Eventually this macro was incorporated in the set of headers mandated by the standard. Consider an example from Kalev’s post:

void f(int); //#1
void f(char *);//#2
//C++03
f(0); //which f is called?

In both cases, very dangerous as the compiler can’t figure out which version of the overloaded function to call. Now think how to explain this concept to a neophyte programmer just learning about concepts of machine addresses, pointers, and overloaded functions.

So, the language standard introduces the concept of “nullptr”. For example, the nastiness from Kalev’s example becomes:

void f(int); //#1
void f(char *);//#2
//C++11
f(nullptr) //unambiguous, calls #2

A glorious and wonderful thing for the language and a feature that will help teaching. But a good illustration of the problems that exist in teaching C++ to new programmers.

Delegating constructors

Object orientation is one of most difficult aspects of instructing people in programing C++. The idiosyncrasies of constructors and destructors are bad enough as currently defined but the new standard is adding more complexity to the issue. For instance, the C++11 standard permits the use of delegation in constructors. Again, we consider an example from Kalev’s post:

class M //C++11 delegating constructors
{
 int x, y;
 char *p;
public:
 M(int v) : x(v), y(0),  p(new char [MAX])  {} //#1 target
 M(): M(0) {cout&lt&lt"delegating ctor"}
}

 

At last, we can now safely call other constructors, an excellent idea from an object-theroetical standpoint. However, the entire chain of teaching constructors becomes far more difficult with this feature.

Lambda expressions

The new standard adds the concept of lambda expressions to the language. A lambda expression lets you define functions locally at the place of the call to the function. In C++, this helps reduce some of the security risks that function objects incur in the language. Consider the following example from Kalev’s post:

int main()
{
   char s[]="Hello World!";
   int Uppercase = 0; //modified by the lambda
   for_each(s, s+sizeof(s), [&Uppercase] (char c) {
    if (isupper(c))
     Uppercase++;
    });
 cout&lt&lt"Uppercase&lt&lt" uppercase letters in: "&lt&lts&lt<endl;
}

In this case, we see an example of a lambda expression in the for_each construct where the Uppercase lambda expression defines a C++ expression for switching text to uppercase. Note the general form of the lambda expression

[capture](parameters)-&gtreturn-type   {body}

We see two pedagogical problems from this example: (1) the for_each construct is one that isn’t taught very well when you are inspired by the “C++ as better C” viewpoint of teaching, and (2) more critical, the entire concept of lambda expressions is one that you would not be able to teach until you have developed rather strong fundamental conceptual understanding of language design principles. Thus, not something easily taught to beginning programmers. In most undergraduate computer science programs, it’s a concept not taught until your third or fourth year in the program.

OK, how do we tie all of these thoughts together?

For me, the new standard makes the use of C++ as a teaching language even more problematic. Many of the concepts being added to the language to make it safer and cleaner make it more it more difficult and dangerous to use as a teaching language. Furthermore, it becomes even more problematic if your program is traditional and uses the “C++ as better C compiler” approach to teaching students just starting in their study of computer science.

Closing thought: C++ not a good teaching language

If we begin from the premise of C++ as being less than suited as a teaching language and becoming even more so with the introduction of the revised standard, what then should we use as a teaching language for new programmers? In my recent travels in search of a teaching position, it’s been my observation that many programs have switched to Java and C# as alternatives. These languages suffer from many of the same issues of C++. I’m beginning more and more to believe much as the teaching staff does as CMU and we should be teaching using languages such as Python.

Selah.

References

Danny Kalev: The Biggest Changes in C++11 (and Why You Should Care)

Robert Harper: Teaching FP to Freshmen

Enhanced by Zemanta