Real Life Sorting

Sorting is a basic part of any computer science program. My sister and I are currently engaged in helping my parents move. As part of that effort I am spending sorting things, which has reminded me of another place where it can be useful to apply things you learn in one field to another.

Bucket and Radix sorts are basic sorting approaches taught in any good algorithms class. The process involves sorting like items into buckets, and then resorting items, either within those buckets (bucket sort), or by their next property (radix sort).

Piles of coin mid-sort
Coins mid-sort, with like piles gathered, and quarters being sorted for uniqueness and rolling.

In practice, as a developer I nearly never implement my own sorting algorithms; a language library is almost certainly going to be better optimized than what I would write, and it already exists. What’s more these two sorting processes are rarely the best in practice for most datasets. But in real life, we need to sort stuff all the time, and where these don’t make sense in many computing settings they are often the best way to sort physical stuff.

I spent my evening applying this theory to sorting the coins my father has collected over time (he’s actually a few feet away sorting more coins right now). I took the embedded picture mid-process this evening between having gathered coins by type, and was pulling out Quarters for collecting vs rolling — other denominations will come later. My sister and I have been helping prepare for the move with a similar process on a larger scale of gathering like-items together to help review and pack them as we progress. There is even science behind the concept that this is the most efficient way to sort things.

Unlike that article, my point is not just to help you sort things faster, but to support for my general argument that having well rounded education is the best form of education for life-long engagement. When I first read the article saying that radix sort was the fastest way to sort socks it made total sense to me – I already sorted socks that way because I’d realized it helped break the problem down. I took the idea from the same place the author did, my computer science training.

Generally I make this argument in the reverse; non-CS courses made me better as a developer. But it’s just as true that my CS courses taught me things that make my day-to-day life better.

No one field has all the answers to our problems as individuals or as a society.

College Advice from a Professor’s Spouse

My wife is a college professor. That means, in addition to being married to a very smart person, I also get to hear lots of tips and tricks about how to do well in college – particularly this last year with my wife doing office hours from home on video from her office just outside our kitchen. So as a service to all those headed off to college in the fall (including our oldest nephew), students already working to complete degrees, and to all the professors and instructors out there, I thought I’d offer a few pieces of college advice I’ve picked up as a professor’s spouse. I’m also blending in a few things I learned getting my own degree and from working professionally with colleges on a regular basis (basically, if you don’t like anything in here, blame me not my wife).

The first two are so painfully obvious I hate to have to tell them to people:

  1. Read the syllabus.
    I mean actually read it, not just look at the words (although that is a start). 95% of the time the professor will literally tell you exactly what you need to do to get an A; or if you’re smart and lazy it lays out how to coast to a C. Heck sometimes they even give you extra credit just for showing signs of reading it because they know most of your classmates won’t bother.
  2. Read all the instructions.
    Your professors want you to succeed. Their lives are better when you do good work. They like seeing students learn and grading good work. So for each assignment they give you instructions about what you need to do to get a good grade. Read and follow those instructions.

Okay now for the advice that’s not so obvious and may be harder to follow.

You earn grades, you aren’t given grades.

Your grade should reflect the work you produce in that course, in that semester, for that professor. You aren’t entitled to a good grade unless you do good work by the standards set for everyone in the class. If that’s not happening – well I’ll get to that in a minute. But don’t confuse a hard assignment, or a professor with high standards as a lack of fairness. Grades are fair as long as the professor holds everyone in the course to the same standards.

Also remember professors should not lower their standards just because you are majoring in another subject. Your philosophy grade should reflect your philosophy course performance even if you are a math major (and vice versa for the philosophy majors). Complaining that the assignment is unfair because you don’t write clearly is the wrong way to move forward – ask for help writing better when you need it.

Complain to your friends, not to your professors.

As I just said: yes, sometimes an assignment is hard. Yes, some professors make it hard to earn A’s. Sometimes you stay up all night, work so hard it physically hurts, and your paper earns a D. These are all great things to complain about to your friends, on your own time, in your dorm or apartment. I did in college, so did my wife, and all our college friends – that’s part of college and the learning process.

DO NOT:

  • Complain to your professor that the assignment was too hard.
  • Stand in the hallway outside their office and rail at the injustice of it all.
  • Complain to your other professors.
  • Rant on social media about how it was hard to study cause you were really drunk. (Seriously, professors can see the stuff you post on the school Facebook page – stop it! Aren’t you all supposed to use other platforms these days anyway?!?)

Remember that your professor knows how all your classmates performed. They may know some of your classmates started that paper two weeks ago, asked for advice along the way, and earned an A. They already know if an assignment was actually too hard (it does happen) and almost certainly took that into account when assigning grades.

Hard work and good work are not the same thing.

That paper you stayed up all night writing was probably hard to complete on time, and not your best work. Just because it was hard to do, doesn’t mean you did it well. In your non-college life this is most obvious in things like physical engineering and computer programming. If your phone’s app crashes all the time, it’s bad. If the bridge falls over, no one cares if the engineer was up all night checking their math. It’s also true on standard college work like papers and art projects – if your picture is overexposed or your paper poorly written the outcome was bad and the grade you earn should reflect that reality.

Ask for help – do not demand special treatment.

Most of the people doing classroom instruction in most colleges like helping students succeed (research professors can different – although not all, and you shouldn’t assume they don’t care). They have office hours so you can easily find them to ask questions. This is not so you can easily yell about your grades. Professors do not take well to being yelled at, threatened, and generally treated as if they are supposed to “give” you anything. Remember, you are not an education customer and the professors do not work for you. Never tell a professor you pay their salary; you don’t, and saying it won’t help matters.

Professors all know how to ace their classes. They should, they designed the class after all. Professors understand all the material they are teaching you (even if you don’t feel like it sometimes) that’s how they earned those advanced degrees – probably at a deeper level than you realize exists. If you are confused or struggling they are the best source of help around. They are good at this stuff – give them a chance to help you get there too.

Exceptions can, and sometimes will, be made.

Sometimes a professor they might cut you a break or offer extra help if you ask. But these favors should be asked for rarely and very carefully. Try to understand what you’re really asking them to do for you. Exceptions for you might be deemed unfair to others in the course and have to be explained to a dean. Changes in deadlines, taking incompletes, and other accommodations may require the professor to do extra unpaid work.

When I was in college I wanted to leave early one semester, to attend an international conference. Of my four courses that semester three had open-book exams or projects – so I just finished those before the deadline. The fourth was a Government course with a traditional exam. The professor was excited about the event, so he was willing to let me take the exam early.

That exception required him to trust me not to share details or to write a second exam just for me – neither are trivial requests. If I had asked to take an incomplete, so I could finish late instead of early, I would have been asking him to do even more work. Often that kind of extra work goes unpaid.

I didn’t have a lot of interruptions, and my exception was for an opportunity, not outside interference. I know not everyone is so lucky, and you may have good cause for asking for exceptions to course rules more often. But if you find yourself asking for those exceptions more than once a year, consider talking with your advisor or the school’s academic success center. Asking for too many favors is either a sign you’re expecting special treatment or need support finding a better overall life balance.

Note: Many schools offer some form of hardship accommodations for health challenges and other major life disruptions. Using those when you need them is not asking for a favor. Those are policies meant to help you succeed, not exceptions to the rules of a course. Check your student handbook when things are easy to understand how that works in case something goes really wrong.

Your classmates lie – a lot – so you have to prove you are different.

That syllabus I told you to read (seriously most important thing here – read it), is probably long and boring. Filled with classroom policies, honor codes, assignments, deadlines, and more. When I was in college they were 2-3 pages and nearly all about the assignments. My wife’s, and her colleagues’, have grown from there into a 10 page tome of policy. They hate it. You can also hate it. You should blame every classmate who goes to a dean arguing over a loophole they think they found. Expect that a new rule is written every time you hear another student say some silly thing to justify obviously bad behavior – particularly if sounds unfair to you and then works for them.

Every one of those rules you see probably has a specific former student to blame. Your professors would love to save time and energy by going back to having a 2 pager of assignments and deadlines. Trust me, they sit on my back porch and lament about it – while sharing suggestions about how to describe how often it’s okay to pee during an exam or whatever thing has come up this time.

Exam Tip: pee before the exam. If you cannot regularly go 90 minutes without a bathroom break, and don’t know why, check with a medical professional. After you do that, read the syllabus and student handbook again to check for policies on medical accommodations.

Yes, you may need to prove your loved one died.

If this happens to you, first and foremost, I’m sorry. Your professors are sorry too – even if they don’t show it in front of you. But students lie about this all the time. It goes in and out of fashion as the lie of choice, but it’s always around. It’s called Dead Grandmother Syndrome. There are actual studies on it (even if entertainingly written, it uses real data). That’s why your college has an actual procedure to report the death of a loved one.

My wife’s colleagues all have stories about assignments that were due just before a break that caused a wave of ill-health and death in student families. I think my wife’s record is 5 grandparents with one paper – her record is not very high. If an assignment is due the Wednesday before Thanksgiving or the day before Spring Break, a single paper might wipe out a dozen grandparents (usually grandmothers – see references above). Those people who wanted to leave for vacation a day early are why, when your life actually sucks, your professor may remind you to complete your school’s process.

That said, if you build up trust with you professors by being a reliable and good student, they will probably try to help you first and worry about the paperwork later.

Learn your college’s grade appeal process.

While we’re one the topic of policy let’s talk about times there are actual problems. Sometimes your professor is a jerk and is unfair. This is genuinely pretty rare, but it does happen and it’s bad when it does. Your college has a process for this. I don’t know what that process is, but it’s there and it’s probably in your student manual. Look it up it. Follow it. I can promise you it does not involve your parents calling anyone at the college – if that’s part of your (or their) plan, start again.

If your professor crosses lines beyond being unfair with grades, at least in the U.S., your college is required to have a policy for that as well. But it will be easier to deal with the process if you have support. Go see a professor you like and trust and ask for help. If you don’t have a professor you are comfortable with check to see if the school has a student advocate, or try calling the counseling center to see if they can point you in the right direction (and consider if their direct services might be useful as well). Those are serious situations, and you deserve more help and support than I can offer here.

Professors make mistakes.

Professors, being humans (this fact seems to surprise students when we see them in public), make mistakes (this fact surprises no one). When you think a professor made an actual mistake, don’t be a jerk about it.

During my first programming course in college I got a notice in my mailbox announcing that because I’d failed the first test I should drop the class and change majors. I was pissed. In no small part because I had been disappointed in the B- I’d earned on that test – not what I wanted but a long way from failing. I could have stormed over to the professor’s office and raised my voice to demand justice. Or I could have gone to the department chair and insisted he intervene on my behalf.

Instead, I waited until scheduled office hours, and went to talk calmly with the professor about the situation. I took the test with me – which had “B-” written in his (not my) handwriting on it. I started the conversation by pulling out the exam and handing it to him. He looked at it, cursed at himself, and noticed the off-by-one error in his grade book. He then apologized and offered me a job.

If I’d gone charging in I fully expect I would have gotten my grade fixed, but I would not have gotten a job (I also became his dog sitter so I got free food and laundry service every time he traveled for the next three years because I wasn’t a jerk). And he would have remembered me being a jerk about a simple mistake in every course I took from him until I graduated (there were several). Instead he liked having me in class, which is never a bad thing.

Your professors are nice people.

Seriously, when there aren’t world-wide pandemics they come to my house all the time. I meet them at parties and conferences. We have a good time together.

I’m not saying this just because I am married to one. Sure sometimes they get a little too into their subjects, or lack some social graces, and yes they hold power over your grades. But in the end they are just people like everyone else.

Take them seriously. Listen to what they have to say. Read their syllabi. But don’t lose track of the fact they are person, with a life off campus, a family, hobbies, struggles, and all the rest of it. Ask them open ended questions before or after class and you might learn a few extra things worth knowing.

Good luck and work hard!

There are plenty of other things you need to do to get through college, and lots of other advice to read. But hopefully these tips will help you along the way.  Good luck this year. Hopefully it goes at least a little better than last year did (for all of us).

Developers need to write more than code

Developers need to be able to in write their primary spoken languages as well as they can writing in their primary programming languages. It takes effort and practice, just like programming does. And you get rusty if you stop for awhile, just like in programming. I started blogging in part to make sure I was writing on a regular basis. When I worked at AFSC I was writing and editing everyday for my work, but the next two jobs I had didn’t expect much writing from me. I’ve written before about the value of my liberal arts education, and the last few weeks have been a testament to effort Hamilton put into making sure I learned the fundamentals of writing.

In my new job we work hard to provide a great deal of information to our clients and to make sure they can understand that information. While each team member brings a different set of strengths and weaknesses to the projects, we are all expected to communicate clearly with each other and our clients. All of us are expected to explain our parts of the project so that our clients can understand our advice and make can informed choices about how the projects should proceed.

In the last month I’ve been responsible for presenting basic overviews of platforms and highly technical reviews of parts of projects. I have contributed to large architectural design documents and focused detailed designs for small subsystems. All these materials were done collaboratively by teams of highly skilled technical people, but our client’s technical skills are much wider ranging. Often they are experts in other areas who need to use the tools we’re building. Others are experts in the technology we work with, and we are serving as added capacity to their in-house teams. We are expected to explain ourselves equally well to all these people, which means we need to both be clear and thorough.

One of the things I try to bring to the project teams is a willingness and ability to edit and be edited.  Because I spent time responsible for all the digital communications of a large organization, I have experience quickly and aggressively editing documents of all sizes. I also know how important it is to have an editor who catches your mistakes, and while I carefully review someone else’s work I am always supportive of anyone who is editing a section I wrote. Not everyone is equally comfortable with these roles, but they are things I believe all developers should try to master.

We have socially come to expect that technical people do not explain their work clearly. We are too often allowed to use a great deal of jargon, skip lightly over hard to understand details, and belittle those who cannot keep up. Complex systems are indeed complex so it does take effort to clearly explain and fully understand them. But the vast majority of developers are perfectly capable of explaining what we do when we take the time. And the vast majority of people are capable of understanding clear descriptions of our work.

Developers who are unwilling to take the time to learn to explain their work well do a disservice to their colleagues, clients, and themselves. Their work will suffer from a lack of good feedback, and so will not be as good as it could have been with more support. Those weaknesses will become bad user experiences, bugs, and other flaws in their final products.

A well done code review (one that’s meant to be supportive and doesn’t include yelling) and a good edit aren’t that different. In both one person is looking over the work of another to try to understand it and check for errors. Done well both give a chance for the reviewer to learn from the material and to help the person whose work is being reviewed do their best work.

When we explain our work well we open ourselves of up for feedback. That feedback gives us chances to validate our designs, improve the experiences of our users, and generally create more awesome products.

Why I think pushing only STEM is a problem

Over the course of this week I needed to be conversant in PHP, MySQL, Linux, Drupal, search tools, herbal remedies, online education tools and strategy, women’s health, men’s health, canine health, dental health, health insurance, public media outlet fundraising, online advertising, email, open source technology, open source movements, cyber security, physical security, national security, state and national politics, disaster response planning, disaster response fundraising, coffee, vegetarian ethics, economics, retirement planning, videography and photography, child rearing, fiber arts, baking, and a few other topics.

Last week I talked a bit about the things I got from my liberal arts education that made me a better developer. There I focused mostly on the positive side of the argument: why non-stem course work is important. Now I want to flip the coin and talk about why our constant push to have more people graduating with STEM degrees is bad for the country and the economy.

No, I didn’t learn about all the topics in the opening in college – in fact much of the information I gathered in college on many of those topics (particularly things related to technology) is now at least partially out of date. But I spent four years learning how to learn and developed a base of skills in several disciplines that makes it easier for me to adapt to change and new areas of interest.

In 2016 the path to most high paying jobs runs through college. And the majority of people who go to college earn more than they would have if they hadn’t gone to college. But if we talk about college as being all about our work and pay we miss the main point of a good education and we ignore the fact that our education system should help mold engaged citizens not just good workers.

The push to graduate students to be “workplace ready” in engineering and technology (people calling for STEM education rarely care about science that can’t be applied to engineering new technologies and pretty much never mention math) is short-term thinking. That kind of educational model frees companies from having to train new employees while weakening their long-term workforce and our democracy. Our education system, high school and college in particular, needs to be helping kids become productive members of a society none of us can fully predict. To thrive in current and – more importantly – future America we all have to adapt to constant technical and social change. You cannot teach kids in school how to actually handle the situations that don’t exist yet, so we need to be teaching them how to learn so they develop skills as they need them.

Companies go looking for the employees of tomorrow, but not of next year, or of five years from now. They complain that younger workers don’t want to put in time at low-level jobs while refusing to provide training to help those new workers advance. What we get all too often are people who are good-enough to do the work of today and tomorrow, but never get better.

When I first wrote code for work, I was terrible. I got better because I was allowed to fail and learn from my mistakes. If you’d judged my college program on that first project, you’d call Hamilton a fraud. If you judge them by my ability to adapt, change, and improve, you’d rank Hamilton a top school as most rankings do.

College should be part of an education meant to prepare people for a life that will be unpredictable and varied. It should part of an education built around showing kids as much diversity of thought as we can:

  • Kids need art courses because art helps us all see the world fully and because developers need artists on our teams to make our projects successful.
  • Kids need to learn history because history matters – when our society repeats mistakes because we don’t understand our own past we all lose.
  • Kids need to learn math and science because we need them to understand how the universe works and that facts are not something that change when it is politically convenient.
  • Kids need to learn to challenge ideas they are taught because even the best teachers will be wrong sometimes.
  • And kids need to play because it’s good for their bodies, minds, and souls.

I work for a company that develops software every day of the week. There are ten of us whose primary job is to write code, so we need great developers. But there are 30 people at the company which leaves twenty of us who do things other than write code – we need great designers, writers, account managers, and more. Yes, they need to understand the internet and the tools we use at some level, but more importantly they need to understand how do their part in helping our clients be successful so that our company can succeed.

And at the end of the day all thirty of us live in a democracy, and in November all of us should be casting informed votes up and down the ballot for people we think will do the best job. The artists will need to understand the tax policies, and the developers will need to understand the impact of social program proposals. We don’t have to agree, but we all need to be prepared.

If you want a deeper argument about the importance to the world of people with a broader understanding of many topics check out Former Bennington College President Liz Coleman’s Ted Talk.

What I learned by getting a degree from a liberals arts college

I have a degree in Computer Science, with a minor in Economics. But I earned that degree at Hamilton College, a traditional liberal arts college. That meant I was forced (now students there are just encouraged) to take classes in a variety of disciplines. I went to Hamilton in part because they offered degrees in Computer Science and History, and I was interested in both fields. In addition to the courses required by my major I took classes in history, religious studies, philosophy, art, and more. And I learned critical skills for work and life because I took those classes.

Two hand made mugs
Making these mugs made me a better developer.

Ceramics and pottery taught me to be a craftsman, accept critical feedback, and admit failure. For all the courses I took in college, the time I spent in Ceramics and Pottery studio taught me more about how to be good at what I do than any other course work (including CS). Basic pottery is a craft that doesn’t allow you to save a piece once you’ve made mistakes. If you are making cylinders the walls aren’t straight throw it away and start again. My professor in those courses set very high standards and pushed us to meet them through brutally honest, but helpful, critiques. He taught me to appreciate honest feedback, and to be skeptical of my work before showing it others. In those courses we had to do good work, recognize our weaknesses, and hit deadlines.

History taught me to care about communicating. Between the courses I took, and dating (and eventually marrying) a history major (now professor) I came to understand how important it is to communicate well in speech and in writing. I started this blog in part because I wanted to make sure I was spending more time writing to help maintain those skills. I frequently find myself in meetings having to explain highly technical issues to non-technical clients and colleagues. Knowing how to adjust to my audience, without insulting their intelligence, is a critical part of my day to day work.

Religious Studies and Philosophy taught me to make a well reasoned argument and express the ethics of my position. Religious Studies and Philosophy both require you to make arguments based primarily on the strengths of your ideas – you can’t research your way out of a bad concept. If you cannot assemble a well reasoned argument you leave yourself open to easy counter attacks. When you work at a nonprofit you often are building your ideas and your explanations from a mix of the facts of the issue, your worldview, and the assumptions you are forced to make because no one has all the information they really need.

Economics taught me how to view the world through the lens of money and trade. While I don’t think it’s the only, or even best, way to view the world it is a very important worldview that dominates the news and political spaces. Understanding the strengths and weaknesses of economics as a field helps me think about plans put forward by various politicians. It also helps me think about how the companies I work for function, and helps make sure internal systems and plans I propose have a strong business case to support them (and because I learned to throw things away in ceramics I also know that when the case is bad to stop and try something different).

The most important skill I have is the ability to learn new skills. Since I graduated from college the technology I work with every day has changed several times. I’ve had to learn tools, techniques, and strategies that didn’t exist when I was in college. And my career has evolved through multiple employers, disciplines, and areas of expertise.