5 ms·
>>To me programming isn't text editing. >>I can see that there's not much difference between an ide and editor for new languages but why do people prefer text
by kamaal 5y ago
>>To me programming isn't text editing.
>>I can see that there's not much difference between an ide and editor for new languages but why do people prefer text editing and prioritize typing speed where IDEs exist? Does an editor create a sort of flow or deeper state since lack of tooling requires deeper mental context?
Simple. Programs should themselves be programmed(Generated). Anything that has a structure should be generated, never written. This is the idea behind compilers/assemblers. And if you extend that idea, that's true for some thing like Python too.
Python or any higher level language should not be written, you should tell your editor what you want and it should generate it for you. And I don't just mean it at a syntactical level. Modern programming is really assembling recipes. And you should be able to extend your editor to spout recipes when you command it.
This ideally should be handled by the programming language itself like Lisp Macros. But most languages don't have macros, so ideally the editor must now act like one. Like take a command and expand code in place at compile/code time.
The reason why people use vim/emacs is its easy to extend these editors. Emacs even more so. Emacs is basically a programming environment which uses cursor movements and text as the output of a elisp program, the text buffer itself is attached to a live REPL(IELM). The result is a very rich library to make the cursor and text do all kinds of stuff. You can now tailor emacs to your precise development workflow. There are videos on YouTube on Clojure programmers making Clojure code from Elisp code. Its quite literally feels like magic at that point in time. And needless to there are other great features like 'Keyboard Macros'.
This can be done in vim too, and these days you can use something like fennel and extend vim in Lisp.
Once you start going this lane, you will discover, you've been typing simply too much, and working too hard to navigate around code which you shouldn't have.
- hzhou321 5y ago> Simple. Programs should themselves be programmed(Generated). Anything that has a structure should be generated, never written. This is the idea behind compilers/assemblers. And if you extend that idea, that's true for some thing like Python too. If the code -- I assume that's what you mean by program -- is generated, the code is not the true source of the program. The true code should be the code that describe or instruct (I prefer describe) how the program is generated. If you do think your code is being generated, yet you are still reading and editing that generated stuff, that's just inefficient or wrong, right? Treating the code as being generated results in a attitude of not caring about the quality of the code and yet not seeking better alternatives.
- kamaal 5y agoWe write a lot of recipe'ish code all the time. That should really be templated. Nobody should write fileopen-read-close repeatedly over and over again. The editor should write this kind of code for you.
- hzhou321 5y agoNo, the compiler or preprocessor should process a higher level instruction that you write using the editor. The editor can run the preprocessor or compiler or a chain of them with single click and load or view any intermediate code with convenience of course, but none of the generated intermediate form should be written or saved in a repository.
- kamaal 5y ago>>No, the compiler or preprocessor should process a higher level instruction that you write using the editor. Yes. Macros. Only Lisp has it. No body really uses Lisp. And languages like Python don't have it. So we have to use these hacks for the mean while.