Things that separate the men from the boys and/or major concepts in software
Here are a handful of things I've had a really tough time with in programming which seems be something you either get or don't, and there's a big difference between those who master it and those who don't. These are in no particular order.
* Recursion and thinking in higher-order functions
* Continuations
* Monads
* mod_rewrite
* Pointers and the process of building a low-level mental model of machine execution in assembler/C
Also there was a huge weedout in my abstract algebra class in college, separating those who could do rigorous proofs from those who couldn't.
"Turtles all the way down" in Smalltalk was a significant moment for me as well.
What other major things like this have you come across?
(
40 comments
| 19 points
| on HN
)
Once you've gained knowledge, it takes a certain type of empathy to explain it effectively. I think this skill occurs less commonly in left dominant math/engineering oriented brains. This is why some programming books read like poorly translated stereo instructions and developer positions requiring customer-service skills tend to pay very well.
This doesn't negate the intelligence or persistence needed to pick these programming skills up in any way--they remain difficult for these reasons.
It doesn't feel like continuations match the way the mind works. Ditto for nested backquotes, though I've never been able to think of a better way to do what they do.
Our minds aren't impressive short term memory-wise. That might be part of the nested backquotes problem. Memory prodigies usually don't have greater short term memories--they're just better at "chunking" which is really a compression strategy.
Cambridge roads are Escheresque. I've been to Manhattan a few times, but my mental map of Manhattan is better than of Boston, where I live. You gave a talk about compression and beauty, if I remember correctly. Maybe it's all related--beautiful things are more memorable.
Monads seem more fundamental to me, in that they capture a broader class of ideas, and seem less machine-oriented. But the overwhelming number of awful monad tutorial blog posts suggests that they aren't any more convenient to think about than continuations.
I think maybe we're lacking a good framework for thinking about concurrency in general. Threads seem simple at first, but make it easy for even very skilled hackers to get tangled up in race conditions and deadlocks. Coroutines are perhaps easier to grasp than continuations, and easier to reason about than threads, but seem less fundamental.
As for a more general suggestion: databases. Seriously. It is embarrassing how many aren't, but just about every programmer these days has to be very comfortable with understanding database querying and optimization, because that's one of those few lines of code which can make or break an entire application.
But definitely, robust database design is among the hardest things I've had to do. I mean, it's one thing to just set up a couple of tables and write queries to get your desired data. It's a whole different ball game to ensure that it'll be scalable, and designing with consideration that you'll eventually have to split your database into shards as it grows.
In a way, it's a subcategory of what I think is the hardest thing, which is designing for scalability. Just because something works with a handful of users doesn't mean it'll work when you have millions of users and hundreds of simultaneous connections, which most of us are striving for.
In all seriousness, I agree with your list with the exception of mod_rewrite. I'd also add mastery of algorithms and complexity theory to the list.
I must admit spending a fair bit of time as a boy though :)
You can't really know how useful they are before you know how they work, but you won't be bothered to learn how they work if you don't know how useful they are. It's a bootstrapping problem the solution of which is to accept that there's a percentage of new things you learn that will turn out not to be useful to you. So, there's a lot of value in using unfamiliar techniques just for the sake of it.
Preferably you can do the majority of your 'technique aquisition' on someone else's time so when you are coding in your own startup (or mine) you can focus on the problem at hand. I know I've implemented things before in ways that I now realize were pointlessly clever.
On the other hand I have serious trouble understanding faith and the thought of a god - this is one of the things that just doesn't seem to fit into my mental model of the world. So understanding certain abstract concepts seems to have some kind of correlation to how you view the world, and what you find to be easy and what you find to be hard.
I'm not quite sure I brought the point across in a coherent manner - but one can hope...
http://news.ycombinator.com/item?id=87348
(Other than the stuff about casting between pointers and ints though.. )
"That was the lightening bolt moment. The problem with pointers in C is that the [star][varname] syntax means two different things, and they are actually contradictory from a certain perspective. In one context it means "declare a variable that is a pointer" and in the other it means "deference". Whenever my languages-brain bit looked at this it couldn't deal with it, recognised it as a contradictory positions and basically shut me down, but not in a way that let me work out what was going on. Have a look at it yourself from that perspective - hopefully you'll see what I always did. Now whenever I look at C code I instead just think "everything is an int and pointers are all about casting ints, and a star when you declare something is your way of telling the compiler that the type of this thing is int-pointer instead of just int". Thus I now have no difficulties at all."
To me, science and philosophy, the 2 things normally used to refute the idea of God actually prove it better than anything else. Science and philosophy are searches for universal laws and principles. What makes these principles universal, i.e., applicable in all instances? If there were no intelligent design, these laws and principles would perhaps be better described as leaky abstractions, as opposed to concepts which always apply. Think of things like pi, the golden ratio etc, which are so oft-repeated in nature, science and engineering. Seems far-fetched that all this 'just happened.' Supreme intelligence was at work.
BTW, although I am not a Christian, I am the son of a Minister and a Christian woman, so I am biased.
Greetings from Jamaica!
2. Holding a program in one's head. I'm not sure really whether to attribute this to PG or Peter Norvig, or somebody else. The best way to understand this is really to experience it in practice. Everyone finds it difficult to keep a mental image of a project once it starts to grow, but it seems like some programmers have an especially hard time with this.
Although I wouldn't recommend implementing them yourself, unless you have a very good reason for it, as Linus once said "Given sufficient eyeballs all bugs are shallow", in Cryptography that is doubly important.
FWIW I've never read a clear and simple definition of a monad (that more than one person agreed upon). The word "monad" appears to be very nearly replaceable by the word "opinion" with all ensuing ramifications. Perhaps someone can provide a clear definition of "monad" here!-))
But seriously, I can't help but think that monads occupy a position similiar to Tait's quaternions: useful to some but not popular enough to achieve a critical level of adoption.
Elegance - my definition is Elegance = Functionality / Lines of Code. Sometimes maximizing elegance takes everything you've got. (And dramatically reduces long term maintenance cost.)
Variable naming - (not a joke, although it seems like one). This shows that you really understand what you're doing and makes life easier for those who have to maintain your work. Real programmers never have to protect their jobs.
Structuring of data - both internally and on disk. Streamlining data structures often reduces the need for complex processing. Eliminating the need to be elegant is often more elegant than being elegant.
Benjamin Pierce's "Basic Category Theory for Computer Scientists" (not online) is terse and complete [1].
Wikipedia is good for definitions and there's also a Wikibook on category theory: http://en.wikibooks.org/wiki/Category_theory
There are some brief, informative, and fun lectures on YouTube by the Catsters: http://www.youtube.com/profile_play_list?user=TheCatsters
The natural transformations playlist is where to start, just be ready to use the aforementioned references.
__
[1] Natural transformations are the original point of category theory. A text that doesn't cover them is incomplete.
Are there any data structures based on category theory, like sets & graphs which are inspired by mathematical theories?
As for the Catsters' videos, I'm unsure about the best order. The recommendation to start with the natural transformations playlist came from someone in #haskell (Cale, maybe?). I'd suggest diving in to whatever sounds interesting and backing up to review other videos that contain any new terms.
> Quoting Asperti and Longo [1]: “The basic premise of category theory is that every kind of mathematically structured object comes equipped with a notion of [ . . . ] transformation, called ‘morphism’, that preserves the structure of the object.” By means of the categorical language one cannot express properties of the internal structure of objects. The internal structure of objects is accessible only externally through the morphisms between the objects.
What is described here sounds a lot like information hiding/encapsulation. Is category theory similar to OOP in this way?