Tuesday, April 21, 2015

Long term programming goal.

I think I need to have at least one longer term goal. In particular, I think I tend to get overwhelmed when I start seeking to accomplish something sizable in the relatively near future.

There is one particular programming exercise that I have wished I'd been working on for the past five years, and keep thinking would be fun and interesting. I've got distracted away from doing it many times by trying to come up with something I could accomplish in the next six months (for bragging rights, resume purposes, whatever). That's never been a good policy for two reasons. Firstly, I lose interest in those projects fairly rapidly... they aren't things that naturally interest me enough to maintain my enthusiasm for more than a week or two at a time. Secondly, six months is an incredibly short time horizon for programming, and it's unrealistic to think I can do much of anything in six months.

The project I want to do is difficult to describe, but basically, I want to write something that is a cross between vim and a REPL, that is specifically optimized for dealing with Python, javascript, and HTML. I want to write an interactive tool for making it a little more easy and fun to write the kinds I've programs I tend to write.

I think I want to start working on this project with a long horizon until completion, picking one feature per week to commit to. This week, I just want to write something that prints what I type on the screen and preserves enough keypress data that I can use it to write my eventual keyboard shortcut tool. (One of the things, in particular, that I have wanted for quite some time is a program that lets me easily create mappings where pressing a and b at the same time then releasing them at the same time (to within human-precision of measurements of the same time) is different from pressing a then pressing b then releasing a then releasing b, which is different yet again from pressing and releasing a then pressing and releasing b. This is not that hideously complicated to do in javascript, except insofar as everything having to do with keypress data is hideously complicated in javascript relative to how hard it should be. I've looked at a few libraries, including mousetrap that don't really do what I'm trying to do. Most of them also fail to distinguish between ä and å, or even ñ which is a problem. (As far as I am aware, keypress data doesn't allow you to distinguish between these types of characters in javascript, but you can get it from the text input field --- as long as you keep one of those active (and invisible)). So it's a little bit yucky to do in javascript, but not nearly as yucky as it is to put text on a screen in tkinter, so you gotta pick your poison, and I pick javascript/html as my toxin of choice for UI. (Why do I want this? Because hitting jk at the same time to exit insert mode, for example. True, you never need to hit j then k in vim, but vim waiting for your next key to determine whether it should act on just j is really annoying. (Yes, I've also remapped escape to my capslock key on my computer, but that messes me up when I'm using somebody else's computer.))

Anyways, step 1 is fairly obvious, and I should do that. This week. Then next week, come up with step 2. Then, maybe, 260 weeks from now, I'll have something done. That's a long time to accomplish something.


No comments:

Post a Comment