
Unix as IDE - dchest
http://blog.sanctum.geek.nz/series/unix-as-ide/
======
scott_s
I 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.

~~~
mhd
Yes, 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
To 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
Got any sources for the term originating on DOS?

~~~
ajross
Sources? No. But the first IDEs were products like Turbo Pascal, and the term
originated to distinguish them from the official Microsoft C Compiler
environment (and others: Mark William's C, etc...) which was unix-like.

~~~
mhd
So you wouldn't consider Smalltalk, Mesa or a lisp machine to be an IDE?

~~~
ajross
Sure they are, but they were't marketed using the _term_ "IDE". That acronym
appeared AFAIK in the late 1980's in the IBM PC world, and it was used to
distinguish those software products from the unix-like MS tools.

~~~
lispm
1983

> Symbolics 36000 Technical Summary

> Overview

> ...

> The Symbolics 3600 is a 36-bit single-user computer designed for high-
> productivity software development and for the execution of large symbolic
> programs. ...

> The system software constitutes a large-scale programming environment ...
> Object-oriented programming techniques are used throughout the 3600 system
> to provide a reliable and extensible integrated environment without the
> usual division between an operating system and programming languages ...

\---

There you have 'development' and ' extensible integrated environment'.

------
geophile
grepping 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.

~~~
skrebbel
If 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
Autocomplete is not tied to statically types languages. For instance, in the
Python command line prompt you have autocomplete directly on the live objects.

~~~
skrebbel
Smart! 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
Visual 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
That sounds incredibly baroque, complicated, and fragile.

~~~
windsurfer
Sure it is, but so what? Would statically analyzing the code really get you
any further?

~~~
ori_b
Type inference would get you quite a way. Using a language that allows
effective tooling would get you even farther.

~~~
WayneDB
Replacing Javascript with a better language has not been possible thus far.
There have been many attempts, but getting every browser maker to agree on
something is like herding cats.

So, when life gives you lemons, you make lemonade. We're stuck with
Javascript. Personally, I think running the code while you're developing it is
a brilliant way of dealing with the problem of how to do proper autocomplete
on a dynamic language.

------
kayoone
Id 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
"* 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

~~~
bermanoid
...which works great until you have to rename a field with the name 'value' in
one particular highly-used class in a system with ten-thousand classes, many
of which will also have fields named 'value'. That's where actual IDE
knowledge of the language semantics is more or less required, to be able to
track the actual object being referenced based on the particular imports,
inheritance hierarchy, etc.

~~~
Roboprog
Well, one way to do it would simply be to rename the field, then
make/ant/maven, and then visit the error lines, especially if you can feed the
compiler error messages back into your editor to auto-navigate. Not instant,
but not intolerable.

------
slowpoke
That'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.

------
wink
A 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
He landed a sweet spot here. Most blogs are either noob level introduction or
fairly advanced, he wrote short/middle level. Very unixy style too.

------
malkia
Even 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.

------
tutysara
I 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
If 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
eclim 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.

------
enneff
Nothing explains this philosophy better than Pike and Kernighan's Unix
Programming Environment. Worth reading even if you consider yourself fluent in
the Unix environment.

------
mhd
Don't forget that at one time, Apple packaged a whole Unix environment
explicitly for that purpose (MPW).

~~~
drhowarddrfine
OSX is certified Unix.

~~~
mhd
Which is why you don't need MPW anymore, but in the days of System 7…

------
danieldk
_If 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
Op 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.

------
chernevik
I'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.

------
nitrogen
_The 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?

------
brnstz
I 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.

------
luriel
_"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).

------
telent
"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

------
olalonde
`tree` is also a nice utility to make recursive directory listings.

------
un1xl0ser
So 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.

------
jfb
sort? 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
Yes, 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!

------
nagnatron
I use Unix as an IDE but refactoring is much, much harder without dedicated
IDE support.

------
ianpurton
Unix also makes a great web based IDE.

[http://servermonitoringhq.com/blog/the_ultimate_web_based_id...](http://servermonitoringhq.com/blog/the_ultimate_web_based_ide)

------
maw
Grey text on a black background. Won't read it.

Who thinks it's acceptable to do this?

------
dfc
What does this mean:

    
    
        /[a-z]{3,4}/i

~~~
eapen
This is a case-insensitive regex search for strings with 3-4 letters in them.

~~~
dfc
Yikes, 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
I 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
Okay. 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
Many 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.)

------
chj
yes, it is an IDE, but sorry it is a very bad IDE.

