println("this is pretty");
October 31, 2017 2:15 PM   Subscribe

What aspects of programming/software development/computer science theory fill you with a sense of wonder? And if you've had luck maximizing this sense of wonder within your day-to-day working life, what path did you take?

Since I last asked about coding here, I've gone a lot deeper down the rabbit hole and discovered that there are lots of things I find fascinating and even beautiful in "writing code" broadly defined.

A few weeks back, a professor was talking about hashing in PHP and explained how Python uses hashes to retrieve values in dictionaries from memory. Before this point, I had mostly just used whatever data structures made sense to implement the patterns I needed to solve a problem. But his explanation ignited something in me where I started noticing the kind of playful creativity and problem solving inherent in features of programming languages. Similarly, I've been working my way through Code Complete (on a suggestion in the linked Ask) and am unexpectedly totally enchanted by it. Specifically, I very much enjoyed the notion of secrets and withholding information in OOP practices. I'm not sure how to describe it other than it felt, like, funny and delightful to me. The common thread in these and many other experiences is that while I am not necessarily intrinsically motivated by the pursuit of efficiency for its own sake, which I recognize is important, I am definitely interested in the way logic functions unexpectedly and beautifully. When I am actually sitting at the computer working on a project (like a group web app project for which I helped with the Model and Controller parts of the MVC pattern) I enjoy being absorbed in the nitty-gritty of writing classes and debugging when I can also I guess feel an appreciation for the beautiful aspects of what's going on (like how the different aspects of the MVC communicate with one another). I know this must sound super woo and overly emotive, but it's how I experience this stuff I guess!

I have been vaguely working towards two possibilities for future careers -- technology in libraries (more digital scholarship/data librarianship than systems programming) and data science/analysis. The former is still definitely a strong possibility, but I've found that statistics and modeling doesn't engage me in nearly the same way as more of the development/CS theory side of things seems to. This is making me think that maybe there are some niches I really haven't considered within the world of programming that might give me a context to challenge myself a ton and also experience more of this intrinsic delight stuff, which also helps me hyper-focus and get things done on my web dev projects.

Any ideas of how to pursue more of these moments would be wonderful -- both in terms of concepts and techniques to learn and career directions to pursue. I know that it's unrealistic to think a job will be entirely about like intrinsic delight, but I suspect that I might be really happy following this feeling.

(FWIW, when it comes to other aspects of imagining working in tech, I feel ambivalent. I am actually quite comfortable with repetitive tasks and what others likely think of the tedium of working on the same project/debugging for a long time -- this combined with that wonder feeling puts me at ease. My main worry when I think about tech careers is more how I'll work together with folks who have an engineering mindset at the exclusion of like, emotional awareness. I feel like I can connect with folks in this mindset if I have a baseline mutual respect and I can tap into what makes them excited about what they're doing --it doesn't need to be all woo feeling expression all of the time or anything! The other issue is just that I know I'll have to continuously battle my demons in staying organized and catching the very small details.)

Thank you!
posted by elephantsvanish to Computers & Internet (21 answers total) 41 users marked this as a favorite
 
I'm taking a theory of computation course that basically sparks that feeling in me every class, when I'm not banging my head against the wall trying to figure out some particularly difficult proof that is. The textbook we're using, which I like, is Michael Sipser's Introduction to the Theory of Computation. Admittedly, as it's theory, most of what you'll learn isn't necessarily directly applicable to day-to-day programming.

On a completely different note, I'd also recommend the book Elements of Programming Interviews, in whatever language you're most comfortable with. While it's meant to prepare people for software engineering interviews, at its heart it's a bunch of coding puzzles and their solutions, and I've often been astonished at the cleverness of those solutions.
posted by perplexion at 2:38 PM on October 31, 2017 [4 favorites]


honestly, that it works at all, at the hardware level
posted by thelonius at 2:40 PM on October 31, 2017 [5 favorites]


This really isn't helpful for maximizing anything day to day, but still -

The day that recursion "clicked" for me - the moment I realized how just a few elegant statements would cause this glorious self-controlled spiralling apparatus to create itself, and instantly retract itself, and leave me with an answer to my question - is one of the best moments of my adult life.
posted by Tomorrowful at 2:41 PM on October 31, 2017 [11 favorites]


Learn. Functional. Programming. I first got a whiff of it due to some features of Python that I felt was very elegant and expressive. I have been dabbling in F# lately and some of it is blowing my mind. Imagine a language in which you barely need "if" statements because function definitions are inherently conditional... and mostly resolved at compile-time so they have no overhead.

People say "learn LISP," and that's fine advice, but newer languages like Haskell and F# seem to have more traction these days. F# in particular is part of the Microsoft .NET ecosystem, so you can actually use it in real-world programs, or just for parts, or whatever.

I've been programming in some capacity or another since I was 13 years old (I just turned 49). First in BASIC on Apple IIs, then 6502 assembly language, then Pascal, then COBOL, then IBM mainframe assembly, then C, then AppleScript, then Java, then C#, then JavaScript, then Python, with many minor dabblings in other languages (FORTH, F#, too many others to count) and I have to tell you, pretty much every programming language has something that makes you lean back and go, "hm, now that's an elegant solution I've never seen before to a problem I'd never considered."

You might enjoy the book Beautiful Code.
posted by kindall at 2:58 PM on October 31, 2017 [6 favorites]


"The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures....
Yet the program construct, unlike the poet's words, is real in the sense that it moves and works, producing visible outputs separate from the construct itself. […] The magic of myth and legend has come true in our time. One types the correct incantation on a keyboard, and a display screen comes to life, showing things that never were nor could be."
-Fred Brooks in The Mythical Man Month

That sums up quite well how I feel about development, and it seems like you're on the same wavelength. That feeling never really goes away for me, it's something that makes itself evident at both higher and lower layers of abstraction, wherever you work -- from orchestrating bigger systems to tweaking small units of single-task code.

I'm very much a pragmatic professional -- pure CS theory has a bit of that magic, but to me it wears off quickly when you start reasoning about algorithms. That's all fine and good, but it's not magical, it's drudgery.

So, really, my advice is: keep doing what you're doing. If programming strokes your brain like you describe, it will continue to do so, wherever you go with it. If you like academia and papers, do that. If you like building stuff, do that. If you like both, well... do both!

FWIW, when it comes to other aspects of imagining working in tech, I feel ambivalent. I am actually quite comfortable with repetitive tasks and what others likely think of the tedium of working on the same project/debugging for a long time -- this combined with that wonder feeling puts me at ease.

IME none of the jobs I've ever had have been particularly repetitive or tedious, probably because I've largely sought out and worked in smaller companies (5-50 people).

My main worry when I think about tech careers is more how I'll work together with folks who have an engineering mindset at the exclusion of like, emotional awareness.

Don't believe a damn thing you read about 'tech' in general. As with any sweeping generalization, of course you can find plenty of things that fit it -- but that doesn't mean that it's a reasonable or rational way to approach the subject, or particularly true in a relevant sense. Tech is such an incredibly broad arena. For every FaceUberGoogAzon there are 2000 other companies that are nothing alike.
posted by so fucking future at 3:02 PM on October 31, 2017 [2 favorites]


When I was a little kid, and I first saw my turtle make ridiculous-looking polygons in some random LOGO program I wrote for fun during class, and then I understood why it did what it did by focusing on each step. I still remember that memory from that dingy computer lab in India; it triggers so many emotions.

And then later, the first time I learned about the implications of the halting problem, Turing completeness, and P vs. NP, in my theory of computation class. I knew I chose the right field for my life. :)

I'm now a software engineer that works on mesh-based computer networks, and day-to-day, I still find it fascinating how little behaviors you program here and there emerge into patterns you can never really predict.
posted by mysticreferee at 3:07 PM on October 31, 2017 [3 favorites]


Open a shell, the simplest environment and type ls, on on windows dir. It lists the files in the current directory. Now try to follow what occurs down to binary. What happens between that two or three character invocation and the immediate display of filenames is incredible and would fill weeks of class time. The shell searches through lists of directories, searches all the dirs for candidate programs, builds a data structure for and exec() call, the exec() requests virtual memory to load machine code instructions, the /bin/ls file is found on disk (how does that happen at the machine level, on a spinning disk, an ssd, a network share?) depending on the way the "ls" program is linked shared libraries are attached, the first block of the code is loaded into virtual memory, but that is mapped to real memory somehow, then control is finally passed to the first instruction of the 'ls" code, the first byte is moved to a machine register and executed. (and that's just barely the first step).

What thelonius said, that it works, is utterly mind boggling. The simplest thing on a modern computer boggles. The previous paragraph barely scratches the surface and that is happening at an incomprehensible rate not micro, not milli, but in nano seconds all around us constantly.

Lisp, data structures, linked lists, hashes , trees (grok how red black trees remain balanced, that many be your spoon moment), yes yes yes, but for me just the awareness of the depth of the infrastructure constantly and deeply leaves me in awe.
posted by sammyo at 4:24 PM on October 31, 2017 [5 favorites]


I recommend taking a look at "shaders" i.e., small programs that are run in parallel by the GPU to (typically) produce images. It's a wonderful world to explore.

I've thoroughly enjoyed The Book of Shaders, which is a great introduction to the subject (and also a great example of how to present/teach/build intuition around a new subject -- something that Bret Victor is also very interested in).

Many examples of amazing shaders are available on Shadertoy.
posted by vert canard at 4:29 PM on October 31, 2017


Using lookup tables to trade space for speed and/or simplicity. For instance, if you use a lookup table to convert lower case to capital letters, you don't have to examine the character to decide if it's a lower case letter and then apply the conversion. You just use the character to index into the array of replacements. (Of course the tradeoffs are different when you start getting into multibyte characters.)

I found the notion of state machines quite wonderful.

Regular expressions are magical, but you run the risk of living the old joke: I had nine problems to solve and decided to use regular expressions. Now I have ten problems.
posted by Bruce H. at 4:52 PM on October 31, 2017


Have you checked out the Computerphile youtube channel yet? Sounds like it'd be right up your alley; it's pretty broad in the topics it covers, but it is a great starting point for going deeper on CS rabbit holes that you do find interesting. I'll leave the career advice to others, but I definitely share the wonder when it comes to elegant and beautiful CS concepts and algorithms.
posted by Aleyn at 5:53 PM on October 31, 2017 [1 favorite]


I will absolutely second theoretical computer science. I took a sophomore-level math foundations of CS course to warm up for going back to grad school and it blew my mind. Towards the end we did fundamentals and proofs of public-key cryptography (building on everything else) and when that clicked, I was pretty well bowled over.
posted by supercres at 7:05 PM on October 31, 2017


I will second functional programming. Understanding how small building blocks in functional programming can build up into really useful programs (via first class functions, higher order functions, partial application, currying, etc) opens up a lot of possibilities for really beautifully concise code. Even if you don't work in a totally functional language, a lot of modern languages have some functional programming support which is well worth understanding.

If you want to try a new language that's pure functional (or close to it), OCaml is nice (though the runtime/tools are a bear to set up, last time I did it). F# is pretty much OCaml that someone convinced Microsoft to pay to port to the .NET runtime with some nice quality of life improvements (mostly syntactic sugar, you can literally copy/paste OCaml code with little to no changes and it will run as F# code). You can also do a lot with functional programming in JavaScript if that's easier for you to work with.
posted by tocts at 7:22 PM on October 31, 2017


Thirding functional programming. I've always enjoyed programming, but it was when I learnt functional programming (specifically ML) that things really clicked into place. You get to see the direct connection between what you're coding and the foundations of mathematics and logic itself ('a gift from God' is how my professor described it). It takes a while to get the hang of thinking in a functional way though, especially if you've been doing a lot of imperative programming. For most people, it is a struggle until some sudden paradigm shift happens in your brain and then everything makes perfect sense.

I'd recommend starting with OCaml. This book (available online for free) is a great introduction.
posted by destrius at 7:31 PM on October 31, 2017 [1 favorite]


Writing API's that get used by customers, and the amazing things the do with them.
posted by nickggully at 8:20 PM on October 31, 2017


Consider applying for the Recurse Center: it's a friendly "writers' retreat for programmers" that is free, and grants are available for underrepresented minorities. They offer lots of job support too. You sound like a great fit—happy to talk about it via MeMail.

The Strange Loop conference and the !!con ("bang bang con") conference are all about the delight, joy, and strangeness of programming!(!) Many of their talk videos are available online.

If you like thinking about computation and abstraction, and how humans mold computation and abstraction to understand and make wonderful things, try designing and implementing your own programming language! See this syllabus for "radical computer science" from the School of Poetic Computation. You might like esolangs (esoteric programming languages).

I've heard that the delight inherent in the Elm language is hard to beat: a beautiful Haskell-like language with a friendly compiler that also gives you the instant gratification of web development and JavaScript interoperability.

> And if you've had luck maximizing this sense of wonder within your day-to-day working life, what path did you take?

Almost every day of my life as a PhD student in CS has contained at least one moment of wonder, if not several :-) but then I may be an anomaly....
posted by icosahedron at 9:42 PM on October 31, 2017 [2 favorites]


you should definitely play with functional programming languages, of either the LISP-y or Haskell-y variety. The LISP-y ones (Lisp, Clojure, Racket/Scheme, etc.) are, roughly, dynamic, with the "magic" coming from self-rewriting code. The Haskell-y ones (Haskell, ML/OCaml, F#, Scala) are strongly typed, compiled, with the magic coming from a very powerful type system that allows you to express logical statements about your program -- to some extent even mathematical proofs -- in your signatures and data types.

from what you say I think you really might dig learning Haskell or F# or something. Their powerful type systems enable some really elegant and exciting design patterns.

As far as academic things to pursue, the theory of computation is definitely interesting. In the US, programming language theory is not taught as widely (to the extent that it's sometimes called "Eurotheory") but that's something to look at as well. Look for professors and classes specializing in "programming languages" or "PL". Also maybe consider a class on compilers?
posted by vogon_poet at 11:17 AM on November 1, 2017


Oh, if you do want to learn Haskell, this book is one of the best and most comprehensive technical books I've ever seen on any topic. It costs $59 but is worth about 3 times that much in my opinion. I can't stress enough how good it is.
posted by vogon_poet at 11:22 AM on November 1, 2017


Type inference, because when the compiler starts working out and reasoning about the types of your data and functions, it suddenly feels like you're having a conversation with the computer on a whole other level. It tells you when what you've said isn't internally consistent ; you can say something you don't entirely understand or leave out some detail, and ask it what it thinks about that and learn more about it; and you start to trust it and rely on it and learn more ways to let it help you more, around and around.

So that's made my day-to-day programming magical in a way that hearkens right back to childhood experimentation with programming. I maximised that by switching almost entirely to developing in Haskell.
posted by joeyh at 3:10 PM on November 1, 2017 [1 favorite]


These are such phenomenal answers! So far, I started watching Computerphile (into it!) and am going to dive into the Book of Shaders and Haskell Programming: From First Principles over Thanksgiving break. Also, very much enjoying learning more about the Recurse Center (wow I kind of can't believe this exists). In general, lots of good research and experimentation and daydreaming fodder here, thank you all :)
posted by elephantsvanish at 9:45 AM on November 3, 2017 [2 favorites]


The Smalltalk-style, "everything (and I mean everything) is an object" breed of OOP is full of mind-bending stuff. Dan Ingalls:
I have to relate an anecdote from the early days. We were using Smalltalk-76, the first Smalltalk that performed well enough to support serious software (it had the same engine as Smalltalk-80, and a simpler body ;-).

There was a student (I can't remember who this was) on one of the Alto's in the corridor who was having fun implementing a Fraction class (there wasn't one built in). He came over and asked me to give him some help because he had gotten things in such a shape that something was preventing the screen from redisplaying successfully when he proceeded from the debugger.

I went over and started to paw around, and discovered fairly soon that the bottom-level call on BitBlt was recieving Fractions as parameters, and was therefore failing. As I looked around to see how that happened, I was astounded to find that the entire browser in question had fractions in practically every point and rectangle in all its views and subviews. I asked him about this, and he said, "I just reframed it, but maybe it was because I made divide return a fraction." I said, "Hmm, maybe so. What do you send to a Fraction to get the integer part?" He told me. I added the coercion to BitBlt's fail code, and the whole thing proceeded to run just fine when I restarted the method. I remember feeling almost dizzy on the way back to my office.
posted by panic at 5:32 PM on November 3, 2017 [1 favorite]


Also if you want to get like, the space-age flying saucer of languages, you should check out Idris. Syntactically it is a lot like Haskell, but its type system is even more elaborate -- it has what are known as "dependent types", as well as something even more mysterious called "cumulative universes". I have some sense of what this means but not enough to explain it sensibly, but in practice it means you can often like, write half a function and the compiler will be able to write the other half for you. It's really magic.

The creator of the language has written the book Type-Driven Development With Idris.
posted by vogon_poet at 2:53 AM on November 4, 2017


« Older I need an app to scan my grocery receipts to help...   |   Minimalist, Dark, Arpeggio-Based Electronica... Newer »
This thread is closed to new comments.