HNHacker News
TopNewBestAskShowJobs

binaryfinery

393 karma · joined July 1, 2010

submissionscomments
binaryfinery··on College Grads, Here’s How to Become Millionaires
Translation: I need to exist stocks into cash before you idiots realize we're in for a severe bout of deflation.
binaryfinery··on Is Good Code Impossible?
He made his bed.
binaryfinery··on Everyone Who Tried to Convince Me to Use Vim Was Wrong
Don't suppose you have a link to a decent tutorial on these features for, say, java?
binaryfinery··on Everyone Who Tried to Convince Me to Use Vim Was Wrong
A command line java refactoring tool? That would be cool. Is it possible to extend it to other languages? Do you have a link - even if its to a "coming soon" page?

Let me reduce "good ide" to IntelliJ or Eclipse if that helps.

By "formal grammar" I mean that both Eclipse and IntelliJ have full Java parsers. So they can successfully rename a method on an interface, all its implementations and all its uses. This can be done if and only if the tool can correctly identify which text symbols represent a class, interface, variable declaration and method invocation, and further it can infer the type the variable in a method invocation using information from that variables declaration, even though it may be in another file.

That needs a parser. So you are correct in that you don't have to write a formal grammar to do it. You can hand role your parser. I used "formal grammar" to imply a level of complexity. Does vim have a tool of such complexity?

binaryfinery··on Everyone Who Tried to Convince Me to Use Vim Was Wrong
Not really. But then I'm using eclipse, intellij, bash, gmail etc. Its like linux, but I can sync my iphone :-)
binaryfinery··on Everyone Who Tried to Convince Me to Use Vim Was Wrong
The real point is that almost the entire vi interface sensibly combines that way to operate on words, lines, paragraphs, regexps etc. Whereas a good IDE works on that which the words, lines, etc represent: i.e. a code dom.
binaryfinery··on Amber Waves of Pain (Do Not Buy Commodity ETFs)
I don't think the Fed is trying to generate inflation, simply because if they wanted to they could. If you look at their own reports, however, we clearly don't have inflation and aren't going to for a long time. About 20 trillion dollars have been wiped out of the money supply. The trillion dollars of printing so far is like hoping taking a piss will turn a tsunami. And most of that trillion dollars has been taken by the banks and put right back into the federal reserve system. Check out banks' reserves. Any money the Fed has given out hasn't affected spending in any way.

There is a way they could get inflation going: if the government prints money (i.e. not borrows printed money) and gives it away to people, e.g. by lowering taxes a lot. But they can't. And we all know they cant.

binaryfinery··on Everyone Who Tried to Convince Me to Use Vim Was Wrong
a. Use case? b. Shift-Alt-Arrow Shift-Alt-Arrow Shift-Alt-Arrow Shift-Alt-Arrow Shift-Alt-Arrow Ctrl-X Alt-Arrow Alt-V. So 8 vs 5.

Focusing on what it can do is irrelevant. I've been programming 29 years now. Can't think of a time I've needed to do that.

binaryfinery··on Everyone Who Tried to Convince Me to Use Vim Was Wrong
Refactoring could be handled by perl, awk, in theory. Or you could, in theory, right a parser to do it. But I don't know of anyone who has. A simple search and replace, on a big code base simply isn't going to work. You want to add a parameter to a method on class Foo, when 20 other classes have that same method name? What about when Foo is an interface, and you have to do it for the 10 classes with that method name that implement Foo, but not the 50 that dont?

  m.foo( bar baz);
Does this foo need to be changed? You can't know without knowing what type 'm' is. Good luck writing an awk script for that. This isn't a debate about whether or not it could be done. Its about whether or not you can do it faster than I type Ctrl-F6.

If such a tool exists that I can run from bash, please let me know. Otherwise you guys have advanced from type-writer to the early dedicated word-processors that existed in the 80s, but no further.

Jetbrains have refactoring tools for C#, Java, Javascript, Python, Ruby, PHP, Adobe Flex, as well as "basic" language support for most others (but no Erlang I'm afraid).

As you say, vi is about editing text. But the author is a member of the Ruby on Rails core team and a core contributor to Ruby projects, and I put it to you that most people using vim dont use it to edit just text: they edit text that happens to be a language with a formal grammar, and structure both with the file, and outside it: i.e. contextual. Hence, a good IDE will always be better than vim.

I also dispute the idea that, given a new language, vim will be better at editing it. My IDE will likely be able to do exactly the same things vim can do, using the keyboard only, and with (on average) the same number of clicks. However, the IDE will most likely be intuitive, obvious, and easy to learn (e.g. by giving visual feedback), meaning that in reality, even though vim could do as much as my IDE for an expert user, for the average user it wont and never will.

binaryfinery··on Everyone Who Tried to Convince Me to Use Vim Was Wrong
Ctrl-W is "select word" but it expands each time you press it. So if I'm in the middle of a string, and that string is part of a method call:

( "some string" )

And I press Ctrl-W, then at first "some" will be selected, then "some string", then ""some string"" (with the quotes).

So assuming that moving my thumb to Ctrl is free, I did it in the same number of key presses as you. Or its 4 vs 3 if you count the ctrl key. Or its 4 vs 4 if you are in insert mode and have to esc first. [Edit: ok, you have to press delete too, so its 5 vs 3 or 5 vs 4.]

The difference, however, is that Ctrl-W is all you have to know. Its just as fast as all your different combinations even for the worst case, but:

a) its often faster - i.e. just two Ctrl-W's for selecting the text inside the string.

b) it provides visual feedback.

Its just as fast for the expert, but yet its obvious, intuitive, and lends itself to discovery based learning. Once you know Ctrl-W selects a word, there's a good chance a user will learn its advanced features by accident, even if they aren't told.

Goto line: Ctrl-G 10.

Goto first line: Ctrl-Home (standard in most GUI editors)

Goto last line: Ctrl-End (also)

The '=' auto indent feature: Ctrl-Alt-L Enter is "format entire file". Its fast, so why would you ever want to format just a little bit? Ctrl-Alt-L Alt-A Enter is format the entire project. I dont have a binding for indent, because why would I ever want to? Just write code, then let editor make it look pretty in one go with Ctrl-Alt-L Enter.

I assume the "." command is used to say repeat a replace or a find: in which case there are keys for that. I'd like to see some use cases for that other than find and replace.

Editors like IntelliJ, SlickEdit, Resharper, all have powerful keybinding support. SlickEdit has a built in scripting language if you want to go crazy. All have far more commands than are actually bound. SlickEdit has a vi mode even.

So you haven't convinced me that vim offers any advantage over a good IDE.

binaryfinery··on Everyone Who Tried to Convince Me to Use Vim Was Wrong
I know people who use vim, and are hardcore. Yet anything my hardcore friends can do on vim, I can do in IntelliJ or Resharper. However there are things I use regularly in these tools that vim cannot do.

These questions are asked honestly and sincerely and I'm genuinely interested in reading responses:

At the end of the day, what is the big deal about a modal editor? How does not-having-to-press-ctrl (or alt, meta, cmd, whatever) for the first key give a programmer any advantage? Is it just the number of these commands that are available - and if so, has someone done a count of commands available in products like IntelliJ and Slick-Edit vs vim? What about the stuff that seems to be missing, like contextual refactoring - or are there plugins / scripts for that?

Without any such evidence, it does seem to me that programmers want to use vim because of a reputation that hardcore hackers use it, not because it actually improves productivity.

binaryfinery··on -2000 lines of code
"Je n'ai fait celle-ci plus longue que parce que je n'ai pas eu le loisir de la faire plus courte." - Blaise Pascal = "I would have written a shorter letter, but I did not have the time."
binaryfinery··on Sharp IP decision on why copyright law shouldn't be used to stifle competition
Thats what I thought too, but then I watched some of their movies with my daughters. Not completely horrible. Were very good at demonstrating consequences of actions and cleaning up mistakes. Sonny with a Chance on the other hand is mind poison.
binaryfinery··on Amber Waves of Pain (Do Not Buy Commodity ETFs)
It does not seem like a perfect investment. The only way it can seem like a perfect investment is if you do not investigate what it is. How many other of your investments are "perfect" do you think? And why would you be worried about inflation?
binaryfinery··on Quit Job, Learning to Code
"Learn to Code, Quit Job" might be wiser?
binaryfinery··on Apple's brewing shitstorm
And a really good way to syphon US dollars to help pay down the Japanese national debt. Not like we need profits to stay here.
binaryfinery··on Writing Rails code makes me miss writing in Objective-C. Or C. Or Java. Or...
Might work for classes. Good luck with "count" or "item".

But I take it from your third paragraph that you agree with the OP and myself that IDEs with good refactoring tools are a good thing.

binaryfinery··on Ask HN: What's your most interesting life goal currently?
Never said it was going to be easy. My question, in fact, was whether I should have it take longer by doing it myself, or open it up to the community to get it done faster.
binaryfinery··on Writing Rails code makes me miss writing in Objective-C. Or C. Or Java. Or...
Once you've changed that one word, how do you change all the places that reference it?
binaryfinery··on Apple's brewing shitstorm
a) Buy a case. b) Don't hold it like that. c) Take it back.

How is it my totally technically illiterate wife can use this device to make calls, but internet bloggers cannot?

binaryfinery··on Mistakes in programming language design
I like to get shit working first, and then downcode if the PG does a horrible job. Nothing better than a hand-written anything, but I like the options of tools. Stange hacks for python supports your original argument I believe.
binaryfinery··on Ask HN: What's your most interesting life goal currently?
MedicalBill
binaryfinery··on Ask HN: What's your most interesting life goal currently?
Well either I'm stupid and/or completely inexperienced, or I have a really good system. I take it you assumed the former. :-) Thank you for answering. I initially thought you were saying that the "go for money vs go for open source" question was a joke.
binaryfinery··on Mistakes in programming language design
I think you hit the nail on the head there. "Context-free" is more of a requirement than LALR or LL. The author clearly isn't a parser writer. I am, but I've yet to try a PEG grammar because ANTLR does such a great job.

But this doesn't change his point (or mine): languages should be created that are easy to write parsers for, so that its easier to write good tools.

And I think this applies to the grammar too: ANTLR's .g files are a good grammar language because its easy to write tools for - hence AntlrWorks.

binaryfinery··on Mistakes in programming language design
" Programming languages should be designed for people to use"

Exactly. Which means that it must be tool friendly, hence LALR/LL(k). Unless you want to do all your refactoring yourself.

binaryfinery··on Told to remove blog posts describing patented algorithm
And how has regulation changed this? What extra laws do we need in place to make sure companies don't kill people other than "dont kill people"?
binaryfinery··on Ask HN: What's your most interesting life goal currently?
No. What part do you find funny/absurd?
binaryfinery··on Mistakes in programming language design
Yeah, Ok. http://www.youtube.com/watch#!v=v9kTVZiJ3Uc

"A keyboard? How quaint!"

Sure, it would be great if you could just describe what it is you are after, except for two problems:

1. Programmers out of a job. 2. How good are you at describing what you want? In English? You think an AI will be able to do it better than a lawyer?

What has this got to do with your point? Well, until that time, your productivity is going to be determined by the quality of your tools. You are going to need to iterate, test and refactor. To do that you need good tools, and good tools are hard to write for non-easily parsed languages. Compare the refactoring tools for C++ (limited) and Objective-C (ha ha) vs C# or Java. My productivity is double, tripple in Java and C# because I'm not spending my time moving characters around files - I'm programming.

http://blog.binaryfinery.com/?p=250

binaryfinery··on Actually KIN Sold More Than 503 Devices
"The KIN Facebook app is only available on KIN devices and can only be used by people who have KIN devices."

Or by the people who wrote it. Microsoft.

binaryfinery··on Ask HN: What's your most interesting life goal currently?
My goal is to create a new programming language (sort of - in so far as I can talk about it). If monetized properly it would be worth billions. Questions is, should I incubate it myself, which will take longer, but be very financially rewarding, or work on it openly so that better minds than mine can make it better - but then no money for me... (except perhaps on the conference circuit!)
← PreviousPage 5 of 6Next →