6 ms·
So I have a question and I'd like to understand if possible. To me programming isn't text editing. Granted, we use text to write most code outside of say Pike
by Guid_NewGuid 5y ago
So I have a question and I'd like to understand if possible.
To me programming isn't text editing. Granted, we use text to write most code outside of say Pike but effectively most programming is working with symbols right? Like .subst is meaningless as an operation on a string but .substring(0, 1) is meaningful.
So I don't really get the advantage of such, to my mind, rudimentary text editors. At a minimum surely being given contextual information about the symbols you are working with (type, fields, methods, etc) is helpful? Perhaps there are languages or domains that are better suited? 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?
- haolez 5y agoIt's not about the editor: it's about the combination of other tools. Simple text editors invite you to use specific tools for specific tasks that an IDE aggregates and configures for you. An IDE is usually good enough, but for some environments, having total control of your tooling can give you big productivity boosts. And not every software depends upon lines and lines of code. Sometimes, you will write useful software that's only a couple hundred lines, but required you hundreds of hours thinking about the problem :)
- kevin_thibedeau 5y agoThe advantage is you don't become dependent on an IDE. Ever seen someone who can't write anything without all the IDE aids to fill in code for them?
- crispyalmond 5y agoI fully agree to an extent. Some APIs (e.g. Android) are huge and a pain to type in Java without some sort of completion. Maybe I'm just lazy or used to C, but Java makes having an IDE almost essential.
- jenscow 5y agoAh, I don't know... I don't depend on an IDE, they just make things much quicker and easier for me. And let's say I do depend on one.. it's not like I'm going to be dropped at a computer where I'm not allowed to use an IDE... but it would just take a day to adjust. For me, anyway.
- foolfoolz 5y agowhen do you ever not have one? work isn’t like camping or something. you always have your computer
- kevin_thibedeau 5y agoWhen using a language without an IDE. In a shell. At home.
- Guid_NewGuid 5y agoHaha you're pretty much describing me. I think autocomplete overlaps with spellcheck in a text editor. You won't improve your spelling by relying heavily on a spell checker but it won't really affect your vocabulary either and enables everyone to write syntactically correct text. Programming is more about telling the story or writing the speech than the spelling of the text. Treating code as manipulating plain text just freaks my brain out as the wrong abstraction level. But as I try and remind myself 'different people like different things and that's ok'.
- tored 5y agoYou should learn how to code in an simple editor and understand how everything is connected, e.g edit -> build -> run. When you understand that you can start using an IDE. Same as with a calculator or any other advanced tool, i.e learn the basics first. After that you should of course use the tools available, like an IDE, if it helps you.
- Zababa 5y agoI'm not sure I agree on the inherent value of being able to work without an IDE. If that's what you value more power to you, but that's mostly personal preference.
- chii 5y agoIts not personal preference, because using an IDE should improve your productivity. It's like saying that digging a hole with your hands vs using a shovel is personal preference.
- arghwhat 5y agoTo me, programming is a mental task that requires overview and easy text manipulation. Most IDEs get in the way of me effectively navigating the code as it was originally organized, while still maintaing my overview. "Big" IDEs that clearly sacrifice text area for widgets, or shift text around to pop up distracting inline "help" are the worst offenders. I'm looking at you, Visual Studio. Common IDE tools like ho-to-definition usually leads to poor understanding of the code structure (and in turn doesn't train for good structures). My best anology being navigating by gut vs. being told where to go by an app - you never learn the route and scenery if you're always busy following the route instructions. And if you never start navigating by gut, you never learn to find your way in general. I always get frustrated by how slow go-to-definition users are compared to those that just... Open the file in the tree that would logically contain that part. This is just one example of course - another is that IDE are usually not very versatile when writing in many languages. Also, a good text editor can have IDE-like features in a non-intrusive way, but the difference between "IDE" and "enhanced text editor" would to me be the intrusiveness.
- Guid_NewGuid 5y agoThanks for your answer, out of interest what languages are you primarily working with and what sort of team and codebase size? It sounds like being forced to consider navigability would offset the tendency for codebase 'melt' in larger IDE assisted projects. Also one area I lean heavily on an IDE is I can switch codebases up to 4 times in a day between JS and Java, so I'm not going to remember structure most of the time and being able to have all kinds of crutches helps me maintain velocity. Do you find your sense of navigation when swapping is enhanced because you have a deeper understanding of the structure from memory? I'd say VS Code kind of straddles that middle ground, like an enhanced text editor++. But then full IntelliJ is where I feel most at home so obviously we have different preferences and that's fine. I just worry I'm missing out and heavily dependent on IDEs.
- arghwhat 5y agoThrough a standard work week I code in Go, C, C++, JS (React), Java and Groovy. Odd jobs add Rust, C#, Kotlin (Android) and Swift (iOS). There are several backend-heavy Go services, React web applications, kernel and user-space driver work, browser work, Jenkins plugins and pipelines, Gradle plugins. It's very varied based on the specific customer we develop for. Privately I mostly code C and Rust for open source stuff. Not that I mind Go, but I only find it to be the proper tool for network services, not local code. When you swap around this much, bad code structure goes from something you write on a tech debt ticket and brute force your way around to being absolute top priority, blocking any review immediately. Of course, memory enhances navigation speed, but the thing is that a painfully obvious structure requires no real memory of it to understand. Likewise, maybe one can cope with switching between 2 IDEs, but it doesn't scale. VSCode is decent, but it's still slow and clunky in my opinion. I'm more of a neovim and sublime text type for speed. An open sourced sublime text thing would be awesome in my opinion. (The sheer number of projects I work with is an outlier due to our company structure, but I believe the experience is universal)
- Barrin92 5y agofor me personally I noticed that using an IDE started to replace my memory in a way and I didn't like it. I noticed that when I program in languages with an IDE environment (Java in my case) I only really slowly picked up what functions were available in a libraries and I started to really dislike this reliance on constantly looking up things. When I just program without autocomplete or for that matter constantly googling I actually paid way more attention to 'where things are'. In python I pretty much know what every string method is. In some languages I used IDEs for I was still scrolling through the completions because I somehow never picked anything up.
- Guid_NewGuid 5y agoTo be fair my memory has always been terrible. I loathed times tables at school. I still don't really know them. I just feel like if I need to know I'll use a calculator and if there isn't one available I'll have other problems like clean water and food! Having a general sense of 'size of' numbers was enough and I'm pretty good at maths. I get that it impedes memorization but how does that scale to using new libraries which may lack documentation? I'm jealous of your memorization of those string methods, every time I switch to JavaScript I feel lost because I don't recall substr Vs subString Vs substring etc!
- doctor_eval 5y agoI know vi very well - but for programming, these days I use JetBrains, which for me is like having an assistant to do all the rote work that doesn’t actually contribute to the task I’m concentrating on. Manually adding imports is not virtuous. Renaming a function is not virtuous. Searching across files in a project is not virtuous. They are just chores. That’s what we have computers for. There are plenty of reasons people choose their editors and I fully respect those choices. But after using IDEs like JetBrains and VSCode for the last few years, vi feels like editing a video file using a hex editor.
- Barrin92 5y ago>but how does that scale to using new libraries which may lack documentation? it doesn't really that well which I guess is a drawback. I'm not dogmatic about it so what I usually do with a new larger codebase is I just open it in vscode, read around somewhat, look at the symbols and use that for a while and then when I'm kind of familiar with it I go back to emacs. >I'm jealous of your memorization it's was actually very difficult in the beginning and one of the reasons I started doing is because I noticed just how bad my memory and attention had gotten without tools. Even with other things, as a kid I could read for five hours straight and a few years ago I noticed I couldn't read for 30 minutes without distraction.
- nonameiguess 5y agoThere are many parts to answering this. First, "plain" text editors have caught up with IDEs in many ways that you're talking about here. With a good LSP plugin, you can hop to definition and autocomplete perfectly fine. For a strong statically typed language, the editor can even tell you why it won't build and how to fix it before you even try. Many things you used to need an IDE for just no longer require it. Second, even without those tools, people hacking away at a keyboard are often doing a lot more than just writing executable code. You're editing config files, READMEs, comments, documentation templates, test data, API request examples. None of these things are amenable to any of the niceties an IDE can help with. Third, in a microservices world or even just working on a plain library that calls into lots of other libraries, unless you download the source code for every dependency, hop to definition and autocomplete isn't guaranteed to work anyway. It's often easier to pull up the API documentation in a browser on a second monitor and refer to it while working. Screen real estate is cheap these days and the more mature projects you're better off using as dependencies anyway tend to be pretty well documented. Fourth, an increase in the use of dynamic languages has brought with it an increase in dynamically-generated code. There's a lot of convenience here in reducing the amount of boilerplate you need to type out and being able to change behavior without even having to rewrite the core code, but it also makes IDEs less useful. It pushes the mental burden of understanding how code gets generated and runtime objects get decorated and changed by understanding the underlying data model of the language and its runtime, but hey, that's what we're paid for. Fifth, what does it even matter in the grand scheme to have definitions and names more readily available inside the actual window you're typing into? It's a convenience, sure, but if you type subst when it should have been substring, you try to build or run a test or just a static analyzer or whatever and you get an error message and remember "oh yeah, that's Language X and I'm writing Language Y," you lost what? A minute at most to go do a global find and replace? Compared to the time studying a problem domain, designing and vetting a solution, coming up with adequate test cases and a suitable type representation that models the domain, the time spent literally typing out function names is minuscule. I'm not going to say saving seconds there is worthless, but it's not a huge gain.
- Guid_NewGuid 5y agoI'll try and respond to your points but hopefully without omnislashing. On 1) I think that's why this post in particular triggered the question. I don't even conceptually understand what vim and emacs are. Like there are terminal buffers, there's an editing mode, you can't quit it without knowing some arcane ritual and org-mode is, like, wikipedia for to-do lists or something. These are very powerful pieces of software with programmability and plugins supporting e.g. autocomplete that bring them most of the way to an IDE. Nano on the other hand I have used when I need to edit some configs or files on a server and I am just absolutely bewildered at the idea anyone would do more than light text editing in it. Which kind of leads in to the second point but not really. I prefer a specialised tool for each of those, where applicable. Like README or documentation I might use VS Code with Markdown preview or MarkdownPad2. For config files/hand crafted requests I might just use Notepad++ but increasingly VS Code fulfils this role too and will let you know if you've made a syntax whoopsie in a lot of file formats. For the third I've actually found I prefer a single 13" monitor with a single window for programming. I feel like looking at API docs in a browser is just enough of a context switch that it will break my focus versus auto-completing to victory. I can actually remember the last time I looked at an API doc in the browser because it was today and I wanted to make a nerdy joke but didn't have the IDE open and couldn't remember if the method was WaitAsync or Enter. But otherwise I will use API documentation once in a blue moon. Most API documentation I just don't find helpful and since we rely on a lot of open source libraries in my job a lot of it is porbably either bad or non-existent. Perhaps this is a difference between people who learned programming when one did it by consulting the BASIC manual and then figuring out and typing the code versus a more IDE based way of learning? I'd guess the BASIC generaiton learned programming more methodically and more deeply. On 4 my brain falls into this same trap of incomprehension with dynamic languages, though I'm interpreting this as dynamically typed which might be a misinterpretation. Re-reading I don't think that was the distinction you were making so I won't expand here. Lastly, I've personally found the overhead to be a lot higher. Since this is a throwaway account I can't link to the PR but I recently did some JavaScript work in a big codebase in a text editor and even writing a fairly simple 50 line method felt like swimming through treacle. Not knowing what I had defined, what I could do with what was defined, where I'd used something that was just defaulting to global since it was undefined, where I'd made an obvious syntactic error etc. I'd say (for me on that codebase) the slowdown to my personal productivity was between 3-10x. Granted that was a codebase without tests, a linter set up, etc. and with low personal familiarity with JavaScript and working efficiently in raw text-editors but it's not an experience I ever want to repeat. Even with tests the time to run the tests, parse the test output, translate the error message and then apply the corresponding fix (and write the test in the first place) versus just fix what the red squiggly told you just seems intentionally less productive. An additional 'finally' as a mea-culpa. I once tried to learn Pony since the language seemed interesting but every time I tried I just bounced off it because I felt so lost and unproductive having to use the API docs and tests/compiler workflow. People who are more used to that workflow probably have an easier time picking up new languages and codebases so while in my experience I'm in the top 20% of people in my language I have a poor generalist ability and low efficiency outside my specialization.
- bachmeier 5y ago> 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? That's not why I use a text editor (Geany most often). I find the IDE to be complex and to bring on complexity. If I'm using a text editor the project has to remain simple. The best analogy I have was when I used Slackware. Ubuntu users would laugh because Slackware didn't have a package manager that resolved dependencies. Slackware users would laugh because Ubuntu had a packaging system so complex that it needed dependency resolution. Simply put, using a text editor imposes discipline that makes programming more fun for me. I'm sure I would use an IDE if I were a Dilbert-style enterprise Java developer. The enterprise thing took all the fun out of programming so I took my career in a different direction.
- Guid_NewGuid 5y ago> I'm sure I would use an IDE if I were a Dilbert-style enterprise Java developer. The enterprise thing took all the fun out of programming so I took my career in a different direction. I think this is the crux of my fear here. Like I don't really enjoy the jobs I've had because they tend to be that kind of environment. I'd compare it to being a logger whose sole job is to saw lots of logs quickly. Using a handsaw just seems barmy but you would probably use one when building a jewellery box. I guess Unix type architecture and design encourages jewellery boxes over lots of planks quickly.
- stjohnswarts 5y agoThat's fine if you're the one architecting the code, but when you move to a legacy other project with 100s of thousands of lines of codes and many, many files that doesn't work out so well because you're usually only deciding on a small part of the code.
- Guid_NewGuid 5y agoToo late to edit but I meant Piet not Pike for a non-text based programming language.
- 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.
- edanm 5y agoI can only speak for myself. For background, I was a very long time vim user, only lately switching to mostly VSCode with vim mode. That said, I largely agree with most of what you are saying. I spent most of my time trying to get vim to be more like an IDE, and others do something similar to varying degrees (fuzzy open file, file trees, etc are among the most popular plugins for vim). The reason I used vim all these years, and the reason I insist on using vim mode, is actually kind of related to something you said. Programming isn't text editing. Rather, doing anything on your computer is text editing! Me typing text into this comment box is text editing. It's true that programming is a lot more about reading code and thinking than about writing code. That said, you're still writing code! And documentation, and many other things. And vim, purely viewed as an alternative way of working with any text, is simply just superior. In the sense that the amount of time that passes between me thinking "I want to change this text here" to me being able to do it, is almost zero. I can instantly jump to a specific part of the code and make "surgical" edits to exactly what I want to change. This is common with all text editing, but especially programming - how often have you wanted to change the inside of certain parentheses combination nested inside a bigger paren (e.g. for an if statement or a function call?). Instead of spending any mental effort or time on executing this, this just flows automatically. It's kind of like learning to use the shortcuts for copy and paste. Does this change something fundamentally about programming? No. Does it improve a little on taking an action you take many times a day? Yes. It "adds up" in terms of less things to think about.