by sramsay · 12y ago · 0 comments
http://www.joelonsoftware.com/articles/fog0000000069.html
I realize Neovim is being characterized as an "aggressive refactor," but I'm sure that's the way Netscape thought of it as well.
tl;dr Things you should never do: rewrite the code from scratch.
Considering vim itself is a from-scratch 'vi' clone, that's interesting advice. :)
But in any case, I see this as more of a fork than a rewrite. It's more akin to the XEmacs/GNU Emacs situation, where someone submits significant patches upstream which aren't accepted, and then forks their own version to continue that line of development.
The main difference is that a clone is often written by developers who had no involvement with the development of the original system. But that's not always true, especially for any old or sizable software system, where the original developers may no longer be involved.
A rewrite may start with a clone, but the code is no longer a clone when you start the rewrite.
A refactor is a subset of a rewrite.
Now we can have meaningful discussions about them.
I can clearly see the benefit of this old wisdom under context of limited resource and limited time, esp. in a commercial company.
However, as an experimental, personal(?), non-profit, free/open-source project, I do think neovim has value in its own right:
1. It won't affect any existing plan of vim, and won't change any existing code in vim. We can still happily use vim as usually. 2. If it succeeded, then we would have another powerful free/open source editor in our community. 3. If it failed, then we as a community have nothing to lose. The author might be unhappy then, but he would at least gain lots of experience.
There are so many rewritings happen in this community, and they are definitely good things:
- svn is a rewriting of cvs, and git is a totally new one (with more features?) written from scratch. - nginx was written even if there's apache httpd - There's zookeeper, but people wrote etcd - etc.
In an OSS context, money is not always the biggest mover, and doing this might actually succeed, or at least not fail because the company fails. It certainly may be that the people lose interest before it gets anywhere, but who cares! The only reason that I could see is that someone wants to fold all their code changes back into vim's original codebase, and they both seem to have different end goals, so eventually they will drift away from each other.
Code evolution.
Rewriting is a significant risk, and rewrites often fail because people don't appreciate that fact. But there are ways to rewrite successfully, and often doing so is the correct course of action.
A big problem with rewrites is that it puts a strain on development resources, and it's not possible to maintain both old and new code at the same time. Another big problem is prematurely committing to the rewrite, before it has proven itself. When the inevitable happens and schedules slip, defects arise, and features need to be cut this can prove disastrous for a rewrite that you've foolishly committed to in advance. Also, people often ignore the value of years of productive use which provides testing and validation of immense value.
If you have the resources often the best choice is to spin off a new project for a rewrite and have them compete in the open. With luck the rewrite could become mature enough to overtake the original (as has happened with many projects). Alternately, work in phases doing refactoring in steps, perhaps with new features behind feature flags.
Many people think that rewriting code is easier than green field development, in reality it's often more difficult. It takes a great deal of skill, and often luck, to manage a good rewrite.
This trend is particularly bad with those who've gotten involved with software development since 2005 or so.
I chalk it up to a lack of experience with massive, multi-decade software projects. If all a developer has worked with are small, recently-written Ruby on Rails apps, for example, then I don't think they can appreciate situations where rewrites of some degree are the only viable option.
Hopefully this attitude regarding Spolsky's writing will change with time, as these people encounter the real-world situations where significant or total rewrites are basically the only possible option.
For me there's a useful sort of arrogance, the "I could code that in two weeks even if I don't know the language" kind of arrogance. I say useful, because that had gotten me to jump into projects that I never would have dared touch.
But the dangerous side of that arrogance is, "I know enough to say what what these other people are doing is stupid". Every time I learn a new sort of software or a new domain, I am reminded that it's much easier to make bold pronouncements from ignorance than from knowledge.
If it gets subsumed into Vim I'll use it without having to choose.
If it gets traction as a second thing, I'll try it.
If it's better than Vim I'll keep it.
Let them write, good luck, have fun, I'll try it if I hear from HN that it's good enough to use.
I don't think it violates "don't rewrite" because these aren't the Vim people. Vim itself won't "suffer" from the ill effects of a rewrite.
Neovim is being sold as a VIM refactor, but apparently with no new functionality
Very different from Linux (had an aim of being a playground for new features), tmux is different from screen as Clang is different from GCC, Subversion is a totally different beast from CVS
Where did you get that idea? When I read the project page (https://github.com/neovim/neovim), two of the explicit goals are:
"Enable the implementation of new/modern user interfaces without any modifications to the core source.
"Improve the extensibility power with a new plugin architecture based on coprocesses. Plugins will be written in any programming language without any explicit support from the editor. "
It is exactly designed to be a playground for new features, but with the goal of them not having to be in the core.
"There's a new project that is called Neovim that seeks to refactor and modernize the codebase"
"There's a new project that is called Neovim that seeks to refactor and modernize the codebase."
I believe tmux / screen is a beautiful example, given Screen has a lot of black magic and has a very challenging codebase to work with. A lot of the philosophy built into tmux are cumulative learnings deduced from what was done correctly or incorrectly within screen. This materializes as features missing (or implemented with different intent) from tmux that exist in screen -- the philosophy behind sessions is one such big underlying principle change.
I like to think of this as similar to using a genetic algorithm to evolve an overly complex/convoluted solution over a period of time (based on some assumptions which may no longer even be applicable), and then explicitly defining/reconstructing a comparable solution using more deterministic and intentional approaches. The focus of these two development cycles are fundamentally different and perhaps neither wrong (the former attempts to discover novel ways of addressing a problem whose solution is unknown, the latter prunes this known search space).
It's basically trying to improve over vim, still using command/insertion modes, inverting the commands (by using movement/action instead of action/movement)… It's pretty configurable and the codebase is new.
definitely worth a try!
Fantastic game though, thanks :)
Sentiment like this is not valuable. The experience that it comes from is often informative, but as a conclusion, this explicitly ignores circumstances that sometimes do make rewriting a good, compelling course of action.
Truly bad, unmaintainable code exists. It exists on projects that have long intended futures. It exists in all sorts of environments on all sorts of projects for all sorts of reasons. To discount the idea of a rewrite out of hand is a failure to objectively review the specific circumstances around whatever it is you're working on.
Often there are better ways, and yes, often a rewrite is a bad idea. But absolutes are so rarely valid, and this one is most certainly not universally true.
Of course you can rewrite from scratch. You just should not expect to reach the same feature coverage instantly, and should approach the work methodically. Most of all, you should have a good reason. "This code is spaghetti" is usually not one. "I want to implement feature X and the current codebase does not really support is" could be a good reason.
Also, a rewrite is pointless from the point of view of code quality unless you are familiar with similar codebases operating in a similar domain.
Main advantages or rewrite are, that when you are a domain expert and implementing and designing core routines, you get constant flashes of intuition "Aha, I should add this interface here because that will enable me to implement Foo and Bar using this instead of writing a FooSubsystem and BarSubsystem" and so on.
If you have no experience from the domain, you get those insights only after you've written the code and are actually new proud owner of new heap of semi-maintainable code.
And who knows--37Signals might well have reused some of the innards.
Rewrites fall into two categories: essential to business and doomed to fail. If it's essential that the business execute on a rewrite, it will happen or the business will fail. If it's not essential, it very well might be the reason the business fails (siphoning away talent and squandering time when a refactor or benign maintenance would suffice). Precisely because massive rewrites are so risky, they are undertaken by the foolish (myself firmly in this camp). The heuristic under which they might succeed is bare necessity.
That first commit also shows it is not a rewrite, though, since it has a comment starting with "Import vim from changeset v5628:c9cad40b4181"
Don't really think so. At least as far Netscape 6 went, they came up with an entirely different framework and moved over to Java (as far as I remember). I have rarely seen that sort of thing characterized as a refactor (even on their mailing lists).
Some of us have been using Gecko as their renderer for almost sixteen years now. Seems KHTML(w), the base of both Webkit and Blink[5], is the same age. Seems we've gotten a good run out of the existing codebases. In fact, this means that Gecko (and khtml) have been in use twice as long as NCSA Mosaic, which the first Netscape was based on[6]. Imagine how Spolsky must feel about the Servo rewrite.
1. http://www.seamonkey-project.org/
2. https://en.wikipedia.orgwiki/Mozilla_Application_Suite#Marke...
3. https://en.wikipedia.org/wiki/Netscape_6
4. https://en.wikipedia.org/wiki/Netscape_7
These guys don't have these pressures, nor did (as per haberman's comment) Linux, tmux, Clang, WebKit, etc as far as I'm aware.
So, the engine that Spolsky was saying was a mistake has now been in use for twice as long as the engine it was replacing.
So it's more like taking the old netscape code and making gecko.