13 ms·
Unix as IDE
- geophile 15y agogrepping for "foobar" is very different from finding invocations of the function named "foobar". Cross-file search and replace, which is doable from emacs, is different from refactoring. I love emacs and unix, but sorry, it's not an IDE. Intellij, now that's an IDE.
- udp 15y agoYes, you're right. But a whole bunch of people don't need or use things like automatic refactoring, and more often than not write better code than the people who do.
- kleiba 15y agoI don't use IDE's and I love Emacs, but sorry, for "more often than not write better code than the people who do" I feel like I have to invoke "citation needed"...
- robfig 15y agoJeff Dean uses emacs
- beothorn 15y agoThe automatic refactoring on IDEs are error proof (I'm thinking about eclipse and java here). Saying that you can do a line without a ruler is one thing, but saying your line will be straighter, I really doubt it. IDEs are important for people that do refactorings. If you don't, fancy IDEs will slow you down. I don't do refactorings that I'm not sure if they will break my code. It's the same reason I don't code with dinamically typed languages and avoid using reflection.
- philbo 15y agoHow do you know that the automatic refactorings in your IDE are "error-proof"? I've no experience to suggest otherwise, but it strikes me as a bold claim. Presumably, you've got a suite of unit tests etc that you are using to verify your code still works post-refactoring. The same test suite would of course work outside of an IDE environment, so I don't think correctness is a valid argument here (but I agree that speed of refactoring is).
- beothorn 15y agoI work with smalltalk and java/eclipse so what I say come from this background. With statically typed languages and a IDE to aid, refactorings like rename, pull up, pull down, extract interface and such can be done without changing the code behaviour (if your code don't use reflection).This is a characteristic of statically typed languages, not IDEs, but IDEs can do it automatically. You could do this refactorings without a IDE, but not with text replace. For example, if you need to change the name of a method, category(), and two unrelated classes implements it, your refactor using text replace will change the method signature for both classes. You need to check every place where the code will be changed, and if your codebase is too big with too many calls, this is nearly impossible. The IDE rename the method calls based on the varible type, without risks of errors, if the refactoring is not possible eclipse warns you.
- philwelch 15y agoPresumably you still have someone review the automated refactor, right? Plus, smalltalk isn't a statically typed language.
- Arelius 15y agoYes or no. Static code transformation with well defined equilivency is many orders of magnitude more reliable than the error finding rate of a code reviewer. You still review to make sure it was an improvement, and to make sure that the person making the changes didn't make the mistake. But you don't review the correctness of the transformation itself, at least not any more than you need to review the original code.
- geophile 15y agoThere are people who write bad code, with and without IDEs. There are people who write great code, with and without IDEs. I suspect that everyone who writes great code does refactoring. Some prefer to do it manually, and some prefer the automation.
- truncate 15y agoProblem with IDE is that they are often bloated and take lot of space. Also I think I don't use more than half the features they provide. You infact get slower there when you get used to something like Vim/Emacs.
- skrebbel 15y agoIf UNIX gets language-aware tools that allow me to search-replace methods of a particular name (and not other identifiers with the same name), and if Vim gets autocomplete* that understands which packages/libraries/headers/assemblies I'm importing, then I'll seriously consider moving to UNIX as an IDE. Until then, I fully agree with you. * To be ahead of the haters: autocomplete isn't a trick for avoiding having to type some extra characters. It's a way for exploring an API you're only vaguely familiar with. I guess you need to be at least somewhat familiar with statically typed languages in a decent IDE to really appreciate what this can do to your productivity. I seldom need to refer to the API docs of libraries I use.
- vog 15y agoAutocomplete is not tied to statically types languages. For instance, in the Python command line prompt you have autocomplete directly on the live objects.
- skrebbel 15y agoSmart! But will it work without actually running the code? Will you be sure that the method which is available on the object now is available on each object passed to the method you're writing?
- WayneDB 15y agoVisual Studio autocompletes Javascript by executing the Javascript and using stub objects for anything that they don't actually want to run (e.g. window, XmlHttpRequest, etc).
- ori_b 15y agoThat sounds incredibly baroque, complicated, and fragile.
- aaronblohowiak 15y ago
- muks 15y agoTry cscope and xrefactory for emacs. cscope is very good for searching through C codebases. You can use this with vim too. It has emacs integration using xcscope, and you can use sequences like C-c s g to quickly jump to a symbol. xrefactory (though non-free) is very good with C++ navigation and can do refactoring. I have used IntelliSense with VAX and xrefactory is much better. This less known program is something incredible for C++.
- rhizome31 15y agoAlso worth mentioning Rope for Python refactoring. Rope's extract method works rather well in Vim.
- agumonkey 15y agogrammar/language oriented libs/functions are missing, nothing more. People still process language with regexps over bytestreams, while they shouldn't. Eventually, and not too long from now, this idea will sink in.
- deleted 15y ago[deleted]
- wink 15y agoA great series of articles, well-written and informative, while not being zealous in any regard. There wasn't much new to me in the shell-focused parts, but there's some great VIM advice hidden in there. Despite the great VIM part it covers a lot of topics that should be common knowledge for people developping on unix-like operating systems (or at least they should've heard about them).
- agumonkey 15y agoHe landed a sweet spot here. Most blogs are either noob level introduction or fairly advanced, he wrote short/middle level. Very unixy style too.
- scott_s 15y agoI agree with his sentiment - it's something I have said here on HN several times - but I disagree with his word choice. Unix is not an integrated development environment. To me, an IDE implies a monolithic program. Unix is not that. To differentiate it, I'm tempted to say that Unix is a distributed development environment to get across that the tools you use for development do not exist in one monolithic program. But I don't like that phrasing, either. Rather, I prefer this: Unix is a development environment.
- rsanheim 15y agoHow about "DDE" -- decentralized development environment ?
- malkia 15y agoA old windows hacker might get confused with Dynamic Data Exchange :) Naah... the name is just good, call it what you want - IDE, PE,
- mhd 15y agoYes, one might say that the "I" part of IDE is there to differentiate it from the typical Unix style. Kernighan and Pike called their book "The Unix Programming Environment" (sooo highly recommended), so I' go with "PE" instead of the high-falutin' "DE".
- ajross 15y agoTo be fair: the "I" differentiated it from the typical Unix style as implemented on MSDOS, which for obvious reasons sucked rocks. No editing while building, no pipes at all (and thus no log analysis in the traditional sense), etc...
- mhd 15y agoGot any sources for the term originating on DOS?
- olalonde 15y ago`tree` is also a nice utility to make recursive directory listings.
- kayoone 15y agoId really love to do this, but there are a few things that would slow me down * no autocomplete... On huge projects that are not based on some predefined framework structure (think rails) this results in a lot of "what was the parameter order of that function again or how was it even called ?" * no easy refactoring. In VS i love how i can just hit F2 on a method name, rename it, VS shows me all the places where it will rename it and pressing OK. This works flawless everytime and makes refactoring so much more painless than working with a scripting language and a text-editor only + numerous other things like looking up where certain methods get called, where they are defined etc.
- mjdwitt 15y ago"* no easy refactoring. In VS i love how i can just hit F2 on a method name, rename it, VS shows me all the places where it will rename it and pressing OK. This works flawless everytime and makes refactoring so much more painless than working with a scripting language and a text-editor only" Using vim (or sed for whole directories of files) you can do the same thing using a search and replace regex. in vim: :%s/<find>/<replace>/gc
- gnaritas 15y agoThat's not at all equivalent.
- mjdwitt 15y agoHow so? I haven't used VS since a couple of versions ago and never got to know it very well, so I based my above comment on the OPs description; if there's more to the feature than I could easily be wrong.
- arethuza 15y agoThe vim command is doing a search and replace over all text - Rename in Visual Studio will restrict the change to class/method/.... name definitions and calls to them.
- ianpurton 15y agoUnix also makes a great web based IDE. http://servermonitoringhq.com/blog/the_ultimate_web_based_ide http://servermonitoringhq.com/blog/the_ultimate_web_based_id...
- un1xl0ser 15y agoSo I work in C, and navigating the code can be a problem from a terminal. I use cscope, but it wasn't really useful until I started using a cool set of scripts that this consultant had which opened new screen (or tmux, if you modify the scripts) windows for each file I am editing. I'll nag him to post this on github. I used to find/xargs/grep to find code snippets.
- un1xl0ser 15y agoSo I work in C, and navigating the code can be a problem from a terminal. I use cscope, but it wasn't really useful until I started using a cool set of scripts that this consultant had which opened new screen (or tmux, if you modify the scripts) windows for each file I am editing. I'll nag him to post this on github. I previously would use find/xargs/grep to find code snippets.
- danieldk 15y agoIf you’re using version control for your project, this often includes metadata in the .svn, .git, or .hg directories. This is dealt with easily enough by excluding (grep -v) Actually, some version control systems allow you to grep managed files specifically. E.g. in Git using git grep, including specific commits, branches, etc. Tim Pope's Fugitive git plugin for vim also does this (:Ggrep), and puts results on the quickfix list.
- tyrmored 15y agoOp here. That part is mostly to use a familiar tool first and then talk people into trying Ack out. I don't use grep anymore for code work either.
- tutysara 15y agoI use Eclipse for my day job, working on a enterprise java project. Here are some things I got used to working with Eclipse, 1. Most of the coding are done to interfaces and concrete classes are wired using factories or using spring dependency injection like, InterfaceName obj=ObjFactory.getImpl(args) I have to look at Class hierarchy often to go to the method that is being invoked, this is very easy in Eclipse (C+T) 2. Code completion for all methods (methods in different source files and from jars). 3. Highlight errors while editing. 4. Tracing call hierarchy I tried Emacs some time back for shell scripting on a remote machine and I found that to be very useful and a right fit. I would love to use Emacs for my java development if there are tools out there which can help me do things that I do with Eclipse. I already feel sluggish with Eclipse some times moving the mouse ;-)
- irahul 15y agoIf you predominantly code in Java, you are better off working in Eclipse, and using some plugin for whatever happens to be your favorite editor. I used to do a lot of Java in the past, and I have used eclipse and vim. Java in plain Vim is a huge PITA - auto complete, generating dummy getter setter, refactoring, fixing imports, checking errors without leaving the ide etc etc. I haphazardly fixed a couple of them using vim plugins and custom keybindings; and then I found eclim, which uses eclipse as a server and provides the functionality in Vim.
- tutysara 15y agoeclim would be a better fit if i am going to use emacs as my do-everything IDE. I found that eclim has even a connector for emacs as it has for vim.
- tikhonj 15y agoYeah, I've used Emacs for Java in the past and the support is not good even if you use JDEE (which is outdated and slow anyhow). I'm an Emacs fanatic, but even so think you would be better off with an IDE in nontrivial Java programs. I solved the problem by not using Java, but this is obviously not an easy option for you :). Emacs does support Scala fairly well (from what I've heard) with Ensime, for it's worth.
- mhd 15y agoDon't forget that at one time, Apple packaged a whole Unix environment explicitly for that purpose (MPW).
- drhowarddrfine 15y agoOSX is certified Unix.
- mhd 15y agoWhich is why you don't need MPW anymore, but in the days of System 7…
- chj 15y agoyes, it is an IDE, but sorry it is a very bad IDE.
- telent 15y ago"I think that trying to shoehorn Vim or Emacs into becoming something that it’s not [an IDE] isn’t quite thinking about the problem in the right way." This may or may not be true for Vim, I don't know. But I think the majority of GNU Emacs users would view it as, to a large extent, supplanting the unix shell environment. Stallman notably didn't even use unix until he had written enough of emacs to be able to avoid ed and vi: he edited on another system and transferred the files across the network
- slowpoke 15y agoThat's something I've been saying since a while, and a very nice reference for various tools. Also, there's another strong argument I like to use: the UNIX philosophy of "Write programs to do one thing, and do it well". An IDE tries to do way too much (ie, everything) at the same time, from start to finish. That's highly inflexible and - in my opinion - terrible design.
- brnstz 15y agoI work like this usually. Most I do Python, PHP, Javascript, and database work. I spend the vast majority of my day in iTerm or a web browser. Sometimes I wish I set up something more "integrated" but grep ends up being good enough. When I worked in Java, I used Eclipse and hated it. Programming felt like filling out a contract. When I worked in Common Lisp, I used Emacs and in combination with either Slime or Allegro environments. These were ideal to me. It got out of your way, but it had enough power and introspection into the code so that it could find almost anything (function/class defs, etc.) The debugger was also really good.
- nagnatron 15y agoI use Unix as an IDE but refactoring is much, much harder without dedicated IDE support.
- enneff 15y agoNothing explains this philosophy better than Pike and Kernighan's Unix Programming Environment. Worth reading even if you consider yourself fluent in the Unix environment.
- jfb 15y agosort? grep? find? ls? Maybe I'm just jaundiced but those tools are far too primitive to be even compared to e.g. a Symbolics machine, let alone a modern IDE. And POSIX is laughably far from treating everything as a file, or having a small set of orthogonal tools, or indeed having anything like a coherent worldview.
- gchpaco 15y agoYes, this is true, modern Unix isn't remotely pure. When I think of where it could be for these discussions, I think of Plan 9. But even on Unix, syntax aware tools like cscope and ctags are fairly well integrated. The real weakness is the debugging story; modern Unix simply isn't as good at introspection as it could be, or arguably should be. Some of this is the ahead of time C compilation model making hot fixes hard or impossible, some of it is limitations in debugging tools and tracing tools, some of it is that the Unix stream model doesn't do a very good job of communicating structured data; it's a hard problem. But, then, even Eclipse compares poorly to Genera, and it evolved from VisualAge for Java which was a near port of the Smalltalk product. So it isn't as though the competition is distinguishing itself through its excellence; look at how much effort in terms of code it is to integrate FindBugs with Eclipse—and all it does is some trivial static analysis!
- malkia 15y agoEven on Windows, I do work mostly from the command-line, but with batteries - that is I use Far Manager (think about midnight commander). Then I have few shortcuts, to cmd.exe, and some to cmd.exe + visual studio's cl.exe in the path (32-bit one, and 64-bit another). I used to had even set-up to run Far Manager under other shells. And then I have cygwin, sometimes it's pain, for the symlinked files, as they don't run directly from cmd.exe, but a simple 'sh -c "gitk --all"' works. And now with the latest cygwin, that moved totally to X11 for tcl/tk, I need startxwin.cmd started somewhere (startup). For places where cygwin overrides some of the CMD shell commands (and I'm quite fluent .bat file writer, and still use them a lot), I just do "call dir *.c /s/b", call, because cygwin has overriden my dir with their application, and I got tired of deleting it, rather I do "call dir" if I need the CMD shell. grep, sed, bash, find, etc. are really awesome tools. Lately I've been making a portable luajit distribution, and found out that BUSYBOX, being almost linux exclusive, can be compiled for Windows (mingw) and OSX. It packs a lot of the commands + shell + few other things in one executable. And most of the time these commands would work the same way on each system. So "sed" would be the same sed on OSX, Linux and Windows... I'm thinking of moving to it, as right now my reliance on cygwin, while being good to me, makes me isolated if I want to share some of the scripts with coworkers (I can't make them install cygwin, but they won't have problems with 600kb busybox.exe) The best IDE so far for me has been the command-line.
- nitrogen 15y agoThe primary rationale for using an IDE is that it gathers all your tools in the same place, and you can use them in concert with roughly the same user interface paradigm, and without having to exert too much effort to make separate applications cooperate. The reason this becomes especially desirable with GUI applications is because it’s very difficult to make windowed applications speak a common language or work well with each other; aside from cutting and pasting text, they don’t share a common interface. This makes me wonder -- could one create something like the GUI equivalent of UNIX's modular philosophy? Desktop systems like OLE and KDE's kparts don't seem to have accomplished that goal. What about Web Intents?
- dfc 15y agoWhat does this mean: /[a-z]{3,4}/i
- eapen 15y agoThis is a case-insensitive regex search for strings with 3-4 letters in them.
- dfc 15y agoYikes, I'm sorry I pasted incorrectly. I meant to post: What does this mean: Just another /[a-z]{3,4}/i hacker I understand the re but I am curious about the context.
- JadeNB 15y agoI guess it is meant to match 'leet'? I'm not sure why there's the option for 3 letters, though …. EDIT: Ah, got it (I think). It's referring to being a polymath hacker: "Just another vim hacker", "Just another perl hacker", "Just another Unix hacker", etc.
- dfc 15y agoOkay. That's what I was thinking too but I couldn't stop wondering if there was anything more to it. But he is not a hacker of any of the following? OS X Linux Emacs C++ C Python Sh Haskell Go Network Computer Prolog Scheme The 3,4 seems so limiting that it kind of vitiates the witty/cute aspect of the tagline...
- JadeNB 15y agoMany of these can be shoehorned in: Mac, -, -, cpp, gcc, -, -, ghc, ogle, -, -, -, Lisp. (I know that Scheme is not the same as Lisp, and that a language is not the same as its compiler; but would you have "Just another .* hacker"? :-) ) (Also, I can't remember if 'ogle' is actually a tool in the Go language toolkit, although I seem to remember someone saying that it should be. Googling 'go ogle' doesn't have much luck, since Google thinks it knows what I really meant.)
- luriel 15y ago"The Unix Programming Environment" by Brian W. Kernighan and Rob Pike, published in 1984. Still by far the best thing written about programming with Unix, and perhaps even the best programming book ever written (up there with K&R).
- maw 15y agoGrey text on a black background. Won't read it. Who thinks it's acceptable to do this?
- chernevik 15y agoI've done my learning in the Unix programming environment. It has forced me to learn the Unix toolset: grep, find, piping, little bash scripts for common tasks. Getting closer to the operating environment has helped make sense of the interactions among distinct components, ie how Python talks to Apache and the database. I sort of trusted that lots of smart people have used this environment and that I'd learn a lot trying to emulate them. So far the only major disappointment has been the vi scripting tool, vimscript just feels like a dead end. I do imagine that there is a lot of received wisdom embedded in something like Eclipse -- just browsing the menus would probably suggest all sorts of helpful tools and practices. I keep meaning to check it out, but just haven't made the time.