4 ms·
I kind of feel the hacker spirit in what you did but… what about fixing your JavaScript instead? Sublime Text: http://imgur.com/p27i5L7 http://imgur.com/p27i5L
by johncoltrane 13y ago
I kind of feel the hacker spirit in what you did but… what about fixing your JavaScript instead?
Sublime Text: http://imgur.com/p27i5L7 http://imgur.com/p27i5L7
Vim: http://imgur.com/OlVbSdO http://imgur.com/OlVbSdO
- imissmyjuno 13y agoWhich Vim plugin uses `Btag` ?
- johncoltrane 13y agoNone that I know of, it's a quick and dirty custom command/function: https://github.com/romainl/dotvim/blob/master/vimrc#L302 https://github.com/romainl/dotvim/blob/master/vimrc#L302 https://github.com/romainl/dotvim/blob/master/autoload/functions.vim#L118-L154 https://github.com/romainl/dotvim/blob/master/autoload/funct...
- klibertp 13y agoNo. The tool should support even the most hideous constructs; saying that "but what you wrote could be written better" is completely orthogonal to "the tool couldn't handle it".
- coldtea 13y ago>The tool should support even the most hideous constructs Nope, the tool should choke on hideous constructs, and make you write them properly. See how I provided just as many arguments as you?
- wodenokoto 13y agoYes, but yours had a shitty point.
- DrJokepu 13y agoHave you ever worked with legacy code?
- reverius42 13y agoLegacy code, at some point in the past, was somebody's new and beautiful code (or so they thought -- little did they know it was hideous). If the tools that existed then didn't allow them to do the hideous things they did, you wouldn't be calling their code "legacy" today.
- coldtea 13y agoPlenty of times. That's why I wouldn't want an editor to enable programmers to write shitty code. If that's a huge problem to you, use said editor only for greenfield projects...
- aaronem 13y agoRegex-based or no, most Emacs major modes I've used actually will do this, more or less; if, having configured the mode's indentation and highlighting behavior to your taste, you find that one or the other stops working properly, it is invariably because you just wrote something that'll choke the language parser. It won't stop you writing lousy code, but it'll stop you writing broken code, which is in itself a great time saver. The only reliable exceptions I've found are Perl, which is unsurprising if you know anything about how that language parses, and the PHP modes, all of which bear stigmata of having been written by PHP developers, and each of which is broken in its own special way. Yegge's js2-mode is a notable exception of the opposite, and highly laudable, sort; when you screw something up using that mode, it knows what you did wrong, and uses the echo area to tell you about it.
- prodigal_erik 13y agoIf every tool supports a different subset of the language, all of them become less usable. An editor that can refactor bad code is more useful than one that only works on code you write from scratch within it. This is part of why a good IDE is so hard; it has to cope with the code temporarily being in an invalid state because how else can you finish it?