Learning to program (at least, learning the right way) teaches important skills independent from the actual ability to program. Most importantly, it teaches the ability to abstract and see patterns. Take a look at https://rwxweb.wordpress.com/2012/01/31/teaching-algorithmic... for an example.
Not just the ability to abstract, but the ability to think at a very granular level of detail and multiple levels of abstraction simultaneously. Not many fields do that to the extent programming does. And the instant feedback loop reduces the need for expert outside guidance and instruction.
There's also the idea of CS + X, for all X[1] (or for most X, as batista points out).
Not just the ability to abstract, but the ability to think at a very granular level of detail and multiple levels of abstraction simultaneously. Not many fields do that to the extent programming does.
Thank you for suggesting a generalized benefit of learning programming. My oldest son (grown up now) is a programmer, and maybe there is something to what you say. I'm glad he had early opportunities to learn Logo, C, and Scheme as part of thoughtful computer science curricula before he finished his high school education. Anyway, I'll encourage all of my children to go beyond the programming I reached decades ago with a time-sharing terminal running BASIC back in the 1970s.
But if I think about this issue of the educational benefits of learning this or that subject on multiple levels of abstraction, I wonder if the unique benefits of learning programming are really all that unique, and really all that generalizable to domains other than programming. I raise this question as someone whose last formal higher education was in law, a domain in which I practiced for a time, before turning my attention to specific issues of policy that are not all issues that raise legal questions. As I look at public policy discussions here on Hacker News, and especially at threads in which legal issues are discussed, I don't often have the pleasant experience of seeing multiple-level abstract thinking going on in those domains. Usually the comments here on HN about public policy or law look as elementary as my comments about programming must look to any experienced programmer. Many of the best comments about law on Hacker News, perhaps to no one's surprise, come from lawyers. Maybe the ability to think really abstractly (and correctly) on multiple levels is much more domain-specific than people who have been trained and practiced in one domain but not another usually acknowledge. Maybe part of domain-specific expertise is an "ability to think at a very granular level of detail and multiple levels of abstraction simultaneously," without much transfer of that ability to other domains.
Knowing I am among learned people here who like to think, I'd be happy to hear the comments of any onlooker to this idea that learning is often stubbornly domain-specific.
My dad and sister are lawyers, and I seriously considered it at one point (took an LSAT course), so I have some familiarity with it. My impression of the field is that it's similar to programming - very detail and abstraction oriented. To think correctly at higher levels of abstraction over any domain, you have to know the details and fundamentals of it, be it law or programming.
As far as the differences, I'd like to say that there is less room for error in programming, since you're working with a perfectly literal machine. However, you can create incorrect abstractions that fail to run and immediately throw errors, but you can also create incorrect abstractions that do run, but return either obviously or subtly incorrect results. Not so different from the legal system.
So I suppose the big difference is the relative accessibility of the two. As soon as you buy a $200 netbook and start programming basic, c, or whatever, you're immediately subjected to the instant feedback loop. With law, you can take a few courses in undergrad, or go to law school. But attempting to learn law on your own, without guidance, is probably easier to go off on tangents, than attempting to learn programming on your own.
In either case, transitioning the skills from one domain to another will require some study of the core body of knowledge, hence the state of legal discussion on programmer sites (and state of tech discussion in Congress, for that matter).
First, I'd suggest that HN comments about legal issues sound so "amateurish" (on the scale where "professional" means "lawyer") because they have a heavy bias towards how we believe the law ought to work rather than how it does work. Abstraction, generalization, logic, and other CS problem-solving skills don't automatically provide an understanding of a field whose details often seem utterly contrary to rationality, without the addition of a pile of domain-specific training to understand the idiosyncrasies of that field. :)
Law sometimes seems to have the most in common with machine learning techniques like neural networks: start with something simple, evolve it in small steps based on potentially-flawed fitness functions, hope you don't get stuck in a local maximum, and in the end end you have a tangled mess that more or less gets the job done but which nobody can fully understand or explain. :)
More seriously, I think abstract thinking and similar methods do help in law and many other fields, but they complement knowledge of those fields, rather than replacing it. You still have to understand the details of any field you want to work in. However, abstract thinking helps greatly when attempting to apply that knowledge.
The article I originally linked to, https://rwxweb.wordpress.com/2012/01/31/teaching-algorithmic... , mentioned an applicant for a CS job who didn't know how to sort words because they'd only memorized an algorithm to sort numbers. The same issue would apply to a lawyer who doesn't know how to deal with a stolen meal because the examples they'd worked with only dealt with stolen cars, and (hypothetically/rhetorically/probably-untrue-in-reality) because the law doesn't specifically talk about stolen meals. (Feel free to provide a more relevant example; I don't have the expertise to supply a higher-quality analogy.) And on the flip side of that, just as a programmer ought to know some of the quirks that apply to strings but not numbers (such as dealing with locale-specific sorting), a lawyer also needs to know the specific quirks that apply to stolen meals versus stolen cars (such as "theft of services"); otherwise, in both cases, they'd wind up with faulty generalizations. So, experts in a field need both the abstract-thinking skills that apply to any field and the knowledge of the specific details of their chosen field.
This is an interesting point. Like tokenadult, my last graduate education was in law, which I currently practice, although I also know how to code, but don't have a particularly "formal" education in it. Law school (debatably) doesn't prepare you to actually practice law, but it does attempt to teach you to "think like a lawyer." The presumption is that, once you have this thought process down, and know some fundamentals of law (almost exclusively taught in the first year of law school), any "details" of the law that may be necessary to actually practice law are easily acquired, because you know where to look, what to look for, and how to use that knowledge. From my experience with CS, I don't think this is particularly different than how many coders are trained to think and apply knowledge. For example, someone that didn't know how to sort words because they'd only memorized an algorithm to sort numbers would seemingly have received a failed education in CS, as a lawyer who doesn't know how to deal with situation X because they only have dealt with situation Y would have received a failed education in law.
However, I take tokenadult's point to be that the lack of analytical reasoning as applied to law by some commenters on this site is very unfortunate given that presumably the same thought processes go into coding, which many people on HN are very skilled at. I agree that some fundamental details of law are important, but I think these details are far fewer than non-legally educated people believe. The whole idea of "the common law" as applied in the United States (in contrast to, say, doctrinal "civil law") is that it should be accessible: this is exactly why judges give reasoned opinions, as opposed to decrees, and much of the ideological underpinnings of the common law rest on the presumption that law simply "exists" in the ether, and one only had to meditate on it to discover it (for example, we used to have non-codified crimes, we still don't accept "mistake of law" or "ignorance of the law" as a valid defense, even if it practically would be impossible for someone to know of a law's existence and so on). We've obviously moved away from that presumption, but, from my perspective, law is intended to be accessible, not arcane.
It's therefore highly unfortunate, and possibly the fault of the legal profession, that law, today, is seen as inaccessible. Reading a legal opinion is not an exercise in futility--it's intended to be read, and often intended to be read by people with little knowledge of the underlying subject matter. I would challenge people, particularly coders skilled in analytical reasoning on HN, to take the time to read judicial opinions in their entirety on legal topics of interest, because I strongly believe that the analytical reasoning one uses in coding does have excellent applicability to understanding legal decisions. Law is NOT as convoluted as many presume, and judges try every day to harmonize conflicting legal concepts--in fact this is largely the entire job of appellate judges whose opinions one might read.
No one here would discourage non-coders from getting their teeth wet by doing something--anything--related to learning how to code, even if that person didn’t go to school to learn it. But, commenters on HN would be perplexed if someone didn't bother do that at all, but then tried to express an opinion on some programming technique they never bothered to learn about. This is the same sort of perplexity I get when people comment on legal topics without reading or knowing the much about the (accessible) underlying topic.
Sounds like maths taught properly. Why not just do that instead?
As an aside, it is a watershed moment in any profession when the practitioners find themselves believing that their profession is so fundamental it should be taught to all children. Bravo, coders of the world :)