Anonymous asked: how did you learn to program?
By observing programmers in their natural habitat.
Okay, not really, observing programmers in their natural habitat was simply the thing that made me intensely invested in learning it because the natural habitat was extremely appealing to my sensibilities.
I had tried it a couple of times in uni, but it was always something ridiculous like java or C#, with the semicolons, curlybrackets and public static cargocult copypastes before anything could be done. When I visited SF I had the opportunity to interact with people who do it for a living and got two recommendations for actually getting stuff done: python or ruby. I chose ruby because it was completely new to me and seemed a bit less common and I tend to optimize for the unlikely (a strategy which has brought brilliant success so far).
I got started with codecademy, just running the elementary things in the browser for quick familiarity (and because I didn’t have a machine to do it properly on anyway), then after exhausting the elementary stuff began opportunistically exploiting other sources, mostly rubymonk and learnrubythehardway; if one didn’t explain something in a satisfactory way, some other place did. In codeanywhere, because I was still intimidated by the prospect of installing Arch on my chromebook and wanted to gather confidence before trying it.
Then I discovered that I had been scared of it for absolutely no reason because stuff worked very well (or at least stuff that isn’t xorg-related) and fell in love with not only the language, but also the command line. In a certain kind of way I’d like not having a window manager at all because screw desktops, code is where the interesting stuff happens, but not having to reboot to chromeos for accessing websites is kind of relevant so I’m now just trying to figure out a minimalistic i3 that can get out of the way and be basically cli with tabs, tiling and a browser. And zsh now that fish has given me a hunger for shell awesomeness because zsh can actually satisfy it.
But anyway, back to programming; while going through hardway (some people un-recommended it because it was just a port of the original book for python, but for me the “monkey.see.do.extrapolate” approach was very compatible) I was also running through ideas of stuff I wanted to use it for, and took detours to build those things whenever I learned something that could be used in one of them. Now I’m doing the odin project/preparatory work for the viking code school to learn the rest of the infrastructure for building more impressive and bigger things that would feel worth spending time on.
My brain approaches this stuff like a mathematician and loses interest in trivial but burdensome tasks once it has proven that they are provable and can be like “okay I can certainly see how it would be done, just can’t be bothered to implement it because I could spend the time learning new stuff instead”. For example, I built a universal input validator that can also handle dictionaries of synonyms and even optimize and prioritize if the same word has two different meanings, so that it can take in anything and convert it to terms the program itself understands, and handle all the possible cases as gracefully as possible. It emerged as a method for replacing successive prompts in my budgeting program (“to”, “from”, “date”, “amount” etc.) with a simple string input of natural language that wouldn’t be so constrained.
Then it just grew more and more capable because I didn’t want to be bound to a specific formatting of the input, so if one were to be like “anon paid promethea 50 yesterday” it would be just as understood as “$50 from anon to promethea on nn.nn.nn”.
Then I realized the applicability and because I’m extremely DRY (if I have to do even the tiniest thing repeatedly I tend to write it into a method, and thus my code looks like half a million “def something"s with other custom somethings nested inside them like recursive lego, and the final product is just something trivial like "thing = CustomClass.new; thing.run” because the methods do everything. Not sure if it’s smart programming, but it feels really natural to do it that way; I don’t know what exactly I end up doing so I just implement a lot of building blocks that can be re-used and re-configured as easily as possible.) I made it universal so instead of taking a hash with strings as keys and arrays of strings as values, I made it validate strings against anything with even a bit of stringiness in it and return the matches in an easily-digestible form.
Then I realized that I had built basically half of a pretty neat parser for a text adventure game (the other half being the code that tests the relationships of the words to each other, and the dictionary containing the valid words), but the rest would be drudgery because I’d have to come up with content instead of just tools; implementing the validator was interesting because it was a constant puzzle, but the rest shall be left as an exercise for the reader because I’m not getting paid for it. (However, if someone were to want me to code a tool that can generate a text adventure game for whatever content they want to have in it, it would feel like worth doing, because I’d just need to figure out the metaprogramming, and let someone else do the boring repetitive work. And this probably generalizes pretty well; I gladly welcome any ideas for building something interesting.)
And back to the original level from all the meta; now I’m setting up my modded chromebook (my Troll side finds tablet mode with only a CLI interface absolutely hilarious) for proper fullstack dev work and enviosly eyeing the terms of bootcamps that are like “four months of madness, no need to give cash just pay us a fraction of what you earn in your first year, green card holders or citizens only”.
2 months ago · 5 notes · .permalink
maddeningscientist liked this
anthropicprincipal liked this
argumate liked this