Exercise two is about comments. I already knew how to comment out code, so this was an easy one.
Zed explains that comments are important because they give you a way to explain, in plain English, what something does. Comments help future readers of your code understand what’s going on. They also permit you to disable parts of your program if you need to.
Comments in Python use the hash character (#, octothorpe), but today I learned that other languages use other symbols. I noticed this while reading Erik Dietrich’s post “Rapid Fire Craftsmanship Tips“. He gives a very specific example of when a certain type of comment is not so helpful.
Taking time to document what I’m doing helps with the learning process — it makes things “stick”. This is exactly why Zed often suggests that we go back and write comments around seemingly easy exercises. It can feel tedious, but I still do it.
In related news, “Very” Early Bird tickets for PyTennessee opened today and I got one! $50 for an earlybird ticket for a two-day conference is a steal, especially if I can find a couch to sleep on for the weekend. Hopefully I’ll be pretty far along in my journey by next February and will learn a lot from the experience.
Today is October first and in the spirit of my favorite month of the year I want to share one of my favorite recipes: chole (chana) masala. It’s one I love to make for crowds and dinner parties because it always pleases. I also enjoy preparing it for sick friends as it keeps exceptionally well, actually improving the longer it sits in the fridge (up to a point!). It is a variation of the recipe shared here. Let me know if you have any questions.Ingredients:
- 1/4 cup coconut oil (unrefined works)
- 1 very large yellow onion, thinly sliced (sweet onions also work — I’ve had great luck with giant vidalias)
- 1 small jalapeno or other hot pepper, seeded and minced (wear gloves!)
- 1 1/2 heaping tablespoons minced fresh garlic
- 1 heaping tablespoon minced fresh ginger
- 1/4 – 1/3 cup finely chopped fresh cilantro (omit if averse)
- 2 28 oz cans diced organic tomatoes in juice, undrained (no basil or seasonings added)
- 1/2 teaspoons salt (add more to taste if your tomatoes are unsalted, but most are salted)
- 3 1/2 – 4 cups cooked chickpeas
- 1 tablespoon agave nectar
- Juice of one small lime or 2 teaspoons tamarind concentrate
- 1/2 cup coconut cream
- Post Punk Kitchen spice blend
- 1 tablespoon plus 1 teaspoon ground cumin
- 1 tablespoon ground coriander
- 1 teaspoon ground turmeric
- 1/2 teaspoon fennel seeds, chopped
- 1/2 teaspoon cardamom
- 1/4 teaspoon cinnamon
- 1/8 teaspoon ground cloves
- 1/4 teaspoon ground cayenne (add more or less to taste)
Please note that in this and any recipe, it’s incredibly important to use fresh, fragrant spices for the best-possible dish. I’ll cover proper storage of spices in a later post, but for now: if your spices smell like sawdust, they’ll probably taste that way, too. Toss ’em and invest in something new.
Preheat one of your largest pans or pots over medium heat. I use a large, heavy-bottomed pan because I have one and it helps the tomatoes cook down faster, but if you don’t, you can use a large pot.
Make your spice blend by combining spices in a bowl and whisking with a fork or small whisk.
When the pan is hot, add coconut oil. Allow it to warm. Add the onion (you should hear it sizzle) and cook about ten minutes. Onion will become soft and golden, and depending on how hot your pan is, may brown some. You may elect to leave the onions mostly undisturbed, or give them a good toss every few minutes or so. Just don’t burn them!
After about ten minutes, add the hot pepper, garlic, and ginger all at once, and stir constantly for about 30 seconds to a minute. Add the spice blend and stir constantly for about another minute. Make sure the onion-pepper-garlic-ginger mixture is thoroughly coated.
Add the tomatoes and mix well, scraping the bottom of the pan to get all that sauteed goodness. Add salt and chickpeas. Cover the pan and raise heat to medium-high, but once it has reached a strong simmer, uncover. Reduce heat to medium. Allow to simmer enthusiastically for about twenty minutes, stirring every few minutes or so. Be mindful of the heat – you don’t want anything to burn. The point is to get the tomatoes to cook down so that the dish is thick and saucy rather than watery.
Once it’s reached a good consistency, stir in about a half a cup of coconut cream. You can use more. Creaminess is wonderfulness.
Add the lime or tamarind and agave nectar. Taste for seasonings and adjust as necessary. Add cilantro if using. Remove from heat and allow to sit for about ten minutes.
Thanks to Isa and Terry at the Post Punk Kitchen for inspiring me with this recipe.
One thought on “LPTHW: Exercise 2: Comments and Chana Masala”
Pingback: Super quick creamy coconut chickpea curry | Coding with Knives