Hacker Newsnew | past | comments | ask | show | jobs | submit | briancarper's commentslogin

Interesting. A similar feature built into Vim is `cursorcolumn`, which will highlight the background of whatever column the cursor is in. If you set `cursorline` as well, you get a kind of cross-hairs around the cursor. See e.g. http://briancarper.net/vim/cursorcol.png

I find that feature useful enough that I've never needed indent guides. If you jump the cursor to the beginning of a line, you can easily see which other lines are indented equally with that line.


Having read the betas, I can't recommend this book strongly enough to people wanting to master Clojure. The authors really know their stuff.


There are some similar horrors in the source code for Clojure. https://github.com/clojure/clojure/blob/master/src/jvm/cloju...

Java is a harsh mistress. This is why dynamic languages on the JVM are nice, so I never have to write code like this myself.


I can't be sure, but in the Clojure case it appears to be done for performance reasons. The final definition of invoke uses varargs for everything after 20, so it's not an issue of compatibility.


As long as nobody is maintaining that type of code by hand, I don't care what makes the JVM happy.


A new version of oyako is coming soon-ish (within a week or two) with possible mysql support, but it will always focus primarily on postgresql. The next version will also feature an SQL DSL similar to ClojureQL but less fancy / magical. (ClojureQL looks pretty cool itself though.)

In my brief experience, the idea of a cross-database SQL DSL is a lost cause unless you want to limit yourself to a very small subset of SQL. Funny, for a language that supposedly has a standard.


> I often have to navigate the project folder structure to look for stuff, I need to compare files, work with the source control and so on.. all of this I feel I can do pretty efficiently from within Eclipse.

For Vim, there are a lot of plugins to deal with source trees, but I get along fine with Vim's built-in wildmenu and tab completion. Both options are nicely configurable. For emacs, I like ido-mode. I find it much faster to browse a directory and open a file with the keyboard and tab-completed filenames than to use a mouse.

There are also commands to jump to other files to find the definitions of functions and such. It depends which programming language you're using. Vim has `gd` and friends to do the same. And then there's ctags, which integrates with Vim wonderfully. Editing Lisp code in Emacs with SLIME (for example), `M-.` will jump you to a function definition in another file.

For comparing files, it'd be hard to beat vimdiff, which provides built-in, cross-platform colored diffs of buffers. Emacs has a diff mode as well.

For source control, Vim and Emacs both integrate well with Git and others. You can stage and commit files and such via a keystroke or two. But personally I use the command line for git. (Of course you can embed a shell right in Emacs too.)

Vim and Emacs let you use "windows" (panes) instead of tabs for editing multiple files; don't overlook how awesome this is. You can view files side-by-side without having to close or hide one to open another. It frees short-term memory for other things. Once you set up keybindings for opening, closing, resizing and moving between windows, you're set. I haven't found anything faster or easier to use. Finding and viewing a buffer that isn't currently visible again uses tab-completion and is very fast.

So yes, a lot of typing. But typing is more efficient than mousing, I find. That's part of the point of Vim and Emacs to begin with.

I often work on Ruby on Rails projects in Vim with 2 dozen files open, or more, and have a very easy time.


One quick, small tip about Vim's panes(/windows) that most people don't notice right away: not only can you view two parts of the same file at the same time, but you can fold/unfold the code in them independently.


Thank you thank you thank you for linking to this. I also use both editors (daily), and Emacs' undo system is easily among its worst and most annoying features, while Vim's undo system is among its best. The documentation at the top of undo-tree.el spells out exactly why this is the case. This library makes it all better.


Many huge Java frameworks are painfully over-complex, but personally I make good use of a lot of "tiny" Java libraries. e.g. if I want to calculate an MD5 checksum or pluralize a word, there's usually a bit of Java out there for that already. Joda-Time is a good example of a clean Java library that's fairly painless to use from Clojure.

And then sometimes people have written Clojure wrappers around Java frameworks. Ring/Compojure as a thin layer over Java servlets is a good example. clojure.contrib.sql is a thin wrapper around JDBC, so that Clojure can already talk to a wide variety of databases.

In that case you get the benefit of a solid codebase as well as the benefit of a clean Lispy interface. Not sure how much more you could ask for. It would likely take years to reproduce all of that work in pure Clojure.


You can always exit via (System/exit 0), 0 being the return code.

`java -cp clojure.jar clojure.main` is the preferred method of starting Clojure rather than using -jar, I think.


> You can always exit via (System/exit 0), 0 being the return code.

That's how I implement the exit function in the article.


People cheat because they're immoral when no one's looking. I don't see that we need to try to justify it any further than that. Someone can get something valuable without working for it by lying/stealing, and they can probably get away with it, so they do it.

Sure, academic institutions reward cheating. What institution doesn't? Shoplifting has lots of rewards too. There are rewards to cheating at almost everything. The only things keeping people from doing it are conscience and integrity, and it's not news that many people (intelligent or not) have small supplies of both.

Cheating was rampant in my "honors" classes in high school and all through college as well, and more novel forms of cheating appear to be no less rampant in the business world. It bothers me, but I don't think we need to hunt for justifications for it. It seems easy to understand from where I'm sitting. Just be thankful we don't all have Rings of Gyges.


"If you feel that parenthesis stacking actually improves the readability of your code, by all means, feel free to do so! However, "everyone else is doing it" is not a good reason to sacrifice the readability of your code."

I think it is a good reason. The community benefits when everyone uses a consistent style. Readability isn't just about being able to read your own code, it's about helping other people read your code.

The accepted style of the community will make sense up to a point; no one wants to make things really hard on themselves, and people gravitate toward things that are comfortable. But it'll also be partly arbitrary and probably not optimal in every way. Part of learning a programming language is learning the idioms and dialects of other programmers.

Using a style no one else in the community uses is like making up your own words in spoken language. People will be able to understand you given some effort, but are they going to bother? If they do bother, they're probably going to be annoyed. Even if your new words are "better".

If you're the only one reading your code, knock yourself out. Otherwise you should probably suck it up and adapt, in my opinion.

"No other language that I'm aware of stacks scope delimiters or has a community where the standard indentation width is two spaces wide, and where sometimes even a single space is considered acceptable."

Idiomatic Ruby uses two space indentation. Maybe because Ruby is often so deeply nested, like Lisp.


Scala also, has a standard two-space indentation.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: