In the thread I started asking why programmers don...
# thinking-together
r
In the thread I started asking why programmers don't program more for themselves (https://futureofcoding.slack.com/archives/C5T9GPWFL/p1599588394135900 thanks for all the interesting responses everyone! I largely came to the conclusion that they do program for themselves, it just takes the form of personal sites and side projects, rather than the type of thing I was looking for), I got a couple of requests for some examples of what I mean, so I decided to start a thread to share customizations. There are three categories I had in mind when I started that thread: 1. Using programming to support software development with things like continuous integration, and automated testing (these are both actually popular, but in my experience programmers tend not to like working on them very much). 2. Solving problems programming problems programmatically, e.g., writing shell scripts or using text editor marcos (https://www.emacswiki.org/emacs/KeyboardMacros) to perform a refactor that isn't supported by refactoring tools. 3. Writing scripts and customizations to help improve your own personal workflow. I think of those three, only the last one that I think only #3, personal customizations, needs examples to understand, so that's what this thread is about. I'm going to try to share a mix of things that I think would be helpful to any programmer, and things that are very specific to my own workflow. I'd love for anyone else to share their own customizations. I'd also love to hear of people think these types of customizations would be helpful (or not helpful) for the way they work. (Or also just if my presentation of them isn't clear.) Cheers!
Fuzzy find is already popular for opening files in text editors, and it's become a popular way to implement search, it's how Spotlight works on macOS for example. But fuzzy find is also adaptable to many more use cases, for example, entering the relative path to another file in a text editor.
Another great use case of fuzzy find is to add file arguments to shell commands, it's faster, and there's less to remember than using tab to complete paths.
Emacs has a culture of being able to easily execute code anywhere. In practice I've found this to be less useful than it sounds, because you normally need to add some additional context. So I've adapted this idea into being able to quickly open a scratch file to execute code in.
👍 1
My favorites customizations are my most personal. I write a lot of notes in Markdown while I work, so I lot of my customizations are for working with Markdown. For example, here's a creating a new relative file and linking to it, and then following that link to open the file.
AppleScript on macOS is a great way to provide customization to GUI applications that aren't otherwise scriptable. One thing I use this for all the time is copying a Markdown link to the current web page to my notes. I can then use the same URL opening link to visit the web page again later.
s
I”ll be damned if you don’t turn all of this conversation into a tidy blog post 😉
r
Heh, yeah definitely. I going to put together a twitter thread next
I've thought about doing some how tos, since I've got a system down for doing this stuff really quickly with minimal maintenance. But I see so few people doing things like this that I wonder how many people would be interested?
s
only one way to find out 😉
👍 3
a
I have a razer mouse with 12 side keys, so I wrote a a script to forward the presses into my window manager, so I can configure actions per-application. My favorites are browser-management: prev/next tab, close/restore tab, forward/backward history. Switch between two last workspaces is also cool. This way I can do browsing effectively with just one hand.
👍 2
I also hacked a spaced repetition package in Emacs to work with my reading list. I just keep adding articles/videos to it and use spaced repetition to remind me about cool stuff I have postponed. I've been using this for a month now and I should say it works pretty great: I've been reading much more and I don't feel overwhelmed by the growing reading list—I never review it manually. Also good for keeping FOMO in bay—just add the article and rely on the system to remind you about it.
😎 2
👌 2
r
The spaced repetition hack sounds awesome, love to hear more about how you did that if you have any links or other resources!
k
I have some old blog posts from back when I used to do more customization: http://akkartik.name/bash.html http://www.google.com/search?q=+site%3Awww.vim.org+kartik+agaram http://akkartik.name/lisp.html http://akkartik.name/desktop.html (endless time spent on colors) http://akkartik.name/firefox.html Here's something more substantial I made: OCR for VNC http://akkartik.name/vnc.html. Still quite proud of this one. Only Windows programming I've ever done. I used it all the time for 5 years, but I haven't used it in 12 years. Other more substantial things: http://akkartik.name/codelog.html was how I got into the habit of using version control. http://akkartik.name/post/2010-09-25-05-29-01-soc (a suite of scripts for slicing and dicing data from shell scripts)
These days I try to minimize my desires, mostly so I can leave my existing computer faster for a Mu computer. I stopped writing Firefox extensions after the RSS feedreader extension I wrote (https://github.com/akkartik/spew) stopped working. I'm still in mourning about this one, the second betrayal around RSS feeds. I still tweak colors: https://lobste.rs/s/yn8drc/context_coloring#c_3do8ct Here's a recent hack to get Vim windows to be first class with tmux windows: https://www.reddit.com/r/vim/comments/22ixkq/navigate_around_vim_and_tmux_panes_painlessly/cgnnnai/?context=3 And then I added a feature to the way my editor shows git diffs in the margins: https://mastodon.social/@akkartik/103994830568601931 I don't know if these examples satisfy your 3 categories..
RSS feeds are a whole separate chapter of my life. Here's a list of feed aggregators I've built, in autobiographical order: 2004: http://akkartik.name/agg/rwir.tgz 2008: http://akkartik.name/newsflash 2009: https://github.com/akkartik/readwarp 2015: https://github.com/akkartik/spew Honorable mention to my old HN reader: 2008, 2011: http://akkartik.name/hackerstream
a
c
1. I probably spend 20->30% of all development time on CI/Deployment/Testing/Cross Platform Builds/CMake. So scripting Travis and AppVeyor typically. This is often a tedious burden, but I do it because I think cross platform code is important. All significant projects should build/work on Linux/Mac/PC as a minimum, and have continuous integration. 2/3 I have a batch file called 'j' which is a single character shortcut mechanism: • j t foo (find foo in all files recursively using RipGrep, with my favourite pattern of file to search) • j j (open the batch file to add more commands) • j merge CL (merge a commit into my P4 working tree - for work stuff) etc. I maintain my vimscripts on a regular basis, but that is usually just adding plugins to the editor. I have several other batch files particularly for things I do on the day job that are tedious. Usually if I can't remember the syntax of a command on a regular basis I make a macro. All my scripts live in my dropbox and are accessible from anywhere. One example of such a script is 'git-squash' which rewrites history and squashes a bunch of commits into a single commit; useful before publishing, since I commit often. Things like that..... Zep is an example of building a tool for programming; but it is not at the point where I can use it for general day to day tasks; mostly because it lacks intellisense for C++.
r
@Alexey Shmalko Great set of links, thanks for sharing! Anyone interested in managing their todo list inbox should take a look at those links, Andy has described some problems I have with inboxes that I've never seen put into words.
org-fc
also looks like an awesome tool.
@Kartik Agaram Wow, that's a lot of stuff! You've been busy. An observation I have is that many of the things you've listed to me would fully qualify as side projects, perhaps even potential businesses (e.g., OCR for VNC). E.g., things that are big enough that I'd want to share them, which definitely has an order of magnitude more cost. One of the things that I find rewarding about smaller personal scripts and customizations (some of yours are in this category too) is that you can go from having an idea to adding it to your workflow in a single sitting. There's almost no other use of programming that has a fast ROI like that, usually you're writing code that will be used in the distant future, often by someone that isn't youself... Just an observation.
@Chris Maughan These examples are very similar to things I do, e.g., creating single-letter commands for common actions. I wonder what the common characteristic for people you compress there workflow into less and less keystrokes like this is. Personally, I'd describe it as "doesn't like doing tedious work", but that feels wrong because that sounds like everyone. I keep coming back to some sort of ever present frustration, like using a computer when it's not customized feels like trying to force Playdough through a straw, I'd be curious if you (or others) have this same feeling and that's what drives you to customize?
k
@robenkleene You're right that many of the things here could be made for others. But they were not. My only goal with them was to serve myself, and I did them incrementally in between other projects (ok, sometimes procrastinating from grad school research) and called them closed when they were good enough. OCR for VNC happened over a long weekend, though I planned for it in advance. That's the outside limit on how far in the future I was planning for. Everything was incremental, even if I accumulated infrastructure over time and built up on things from years ago. In fact, this is one of my frustrations with the world we live in: things that look like they could be for others are assumed to be for others and treated on that footing. It's incredibly frustrating to me that Firefox killed the old extensions even for people who were building for themselves. Before the final cut it was frustrating that there was a period of 2 years where Firefox supported old extensions but only if you went through their app store process and got your extension reviewed. Even if you had no intention of providing it to others! This is all kinds of fucked up. Again and again this world starts out building things to be hackable -- and then throws that capability away. This is why I'm bearish on projects like @Geoffrey Litt's Wildcard. It's just a recipe for losing work on somebody else's schedule. I'll never ever contribute to any sort of plugin or extension economy again. Even if it's open source. You care about programming for yourself. Don't tell me to think of these as side projects! That's like the salesman who starts recommending the competitor's product 🙂
💯 1
I hugely resonate with @Konrad Hinsen's observation that our modern measures of value are blind to this kind of activity. It's the best explanation I've yet found for why we hold on to compatibility in all sorts of places where it makes no sense -- but then give it up in places where it makes no sense. Vim still supports building on Amiga, just because it was a commercial entity long long ago. But scientists using Python 2 for themselves, that never ever showed up on any statement of assets, so it's fair game.
👍 3
r
(Just to be clear, I didn’t mean to suggest you made these for others, or that you should treat them as side projects, just that for me personally, they’re big enough that I’d have to think of them as side projects. Just in my own personal categorization of types of work I do.)
👍 1
This part really resonated with me, I think everyone who gets into customization has been burned by something before:
It's incredibly frustrating to me that Firefox killed the old extensions even for people who were building for themselves. Before the final cut it was frustrating that there was a period of 2 years where Firefox supported old extensions but only if you went through their app store process and got your extension reviewed. Even if you had no intention of providing it to others! This is all kinds of fucked up. Again and again this world starts out building things to be hackable -- and then throws that capability away.
This is why I'm bearish on projects like @Geoffrey Litt's Wildcard. It's just a recipe for losing work on somebody else's schedule. I'll never ever contribute to any sort of plugin or extension economy again. Even if it's open source.
My solution to this has been to do everything in Bash with a thin layer to interface with a larger program or ecosystem. Just because Bash is always there and it never changes.
💯 1
k
Until it does 👹
1
🤞 2
j
My whole computer interface is customized with bits of glue -- elisp, shell scripts, scheme programs, Applescript, &c. I wonder in thinking about this whether we don't see more of this in the younger generation because many have chosen a particular language ecosystem and it's pretty difficult to manage this sort of thing without being a flexible polyglot programmer. 🤔 Also, like @Kartik Agaram, I would not think to productize any of this stuff, despite the aggregate being of a similar scale to a commercial offering. In terms of moment-by-moment interactions, I've attached a video of using
elisp
within the context of search-and-replace to fix some unicode foolishness in an SVG document containing a set of icons. When using emacs this way, one writes code all the time with the intent to use it and then throw it away. This attitude requires trust in one's tools and processes that whatever is being done won't take very long or be very difficult -- that it doesn't involve a "development process" in the methodological sense. Once more I say: do not accept compile-run-debug cycles in your life, make your medium a partner that grants you flow. Lastly, I thought I'd add something quick I livecoded to help me accomplish a specific task, but that is not a script. I needed to edit some video and found the UIs of most systems to be wretched, so I took a few minutes to build the scrubber I wanted (a series of strips representing sufficient difference between frames to give scene navigation). The workflow allowed both direct manipulation and programmatic interaction from within emacs at the same time.
👍 2
💯 2
r
Great examples! The entity replacement regex is lovely, and the scrubber UI is a great example of creating an original UI for a problem. This part rings true to me:
I wonder in thinking about this whether we don't see more of this in the younger generation because many have chosen a particular language ecosystem and it's pretty difficult to manage this sort of thing without being a flexible polyglot programmer.
I think the way jobs are structured has something to do with it. It seems to be you're first programming language you get the most reward (a job), your second a bit more (one complementary language is helpful to your career), your third practically zero. Most programmers I work with focus on one or two languages, but there's a subset who use the most appropriate language for a problem (this is what I try to do). It seems like you first need to be the second type, which is already rare, and then you also need to want to customize. This is probably a big part of why there are so few who do this, two filters like that is a lot.
👍 3
k
@Jack Rusher Nice examples, thanks! My working habits are quite similar, also centered around Emacs. But I wonder which substrate (libraries, ...) you used for the video scrubber. I find myself having to do such work as well now with the Covid-related shift to videos, but none of the video editing tools I found so far are scriptable to the extent that you demonstrate.
c
@Konrad Hinsen I was surprised to find recently that Davinci Resolve is free; and competitive with the Adobe and Apple Offerings. It's not hard to learn, and does all the video editing tasks you are likely to need. Needs a reasonably beefy machine in my experience. Not a coding solution, but off all the editors I've tried, it's the one that works best in my experience.
j
@Konrad Hinsen I used a pile of my own stuff, which is one of the reasons it took so little time and effort to make. That said, I think you could get a great deal of mileage out of `#lang video`: https://docs.racket-lang.org/video@video/index.html
k
Thanks @Chris Maughan and @Jack Rusher for your suggestions! Since I already have a foot in the Racket world, I’ll start with #lang video.
👍 1
r
Recently stumbled into https://withfig.com/ which is trying to make the workflow of building custom tools easier.