Hacker News new | ask | show | jobs
by Kequc 4800 days ago
It seems like these trivial inconveniences could largely be avoided in non trivial broader ways. For example what is the need for having so many javascript and css assets when in Rails we are meant to use the asset pipeline by default? In this case it seems like it would make the most sense to utilize the asset pipeline, more so than most applications. Merge all those together, serving up 80 separate assets is insane. Isn't it?

I don't understand mapping the keyboard shortcut in Vim to reloading all browsers. Does that reload all tabs in all open browsers? What if I have a paused youtube video, or am saving my place in a large article that I am scrolled most of the way down the page. Doesn't that all take longer to fix than just going to the browser and hitting the keyboard shortcut in the browser? Since you're going to the browser anyway or else the reloading would have been meaningless?

The most obvious time sink that I can see from this article is that the tests are poorly optimised. But that isn't a trivial inconvenience. Having to wait 3 minutes, twice, every time you make a change in the code is a significant inconvenience. That should give plenty of time to do things such as reload a page. Designed properly tests are not meant to depend on one another just to run. Use minitest, use fixtures and fabricators. Test individual classes, test controllers, avoid full stack tests unless there is something that can't be tested about it at a lower level.

As others have said also Vim is a powerful tool but there isn't really very much it can do that a modern graphical text editor like Sublime Text 2 cannot... I'm sorry I am just having trouble making this article resonate with me. Is it something wrong with me or am I right?

2 comments

> Merge all those together, serving up 80 separate assets is insane. Isn't it?

That's what happens by default when using the asset pipeline when in the "development" environment, it's supposed to ease debugging and works well when only including a few JS files. In "production" all the files would be merged into 1.

There is a flag "config.assets.debug = true" in the "development.rb" file, switching that to "false" will output just one file.

Which, sadly, we've had to do in development as something has been introduced into Rails or sprockets that makes our development environment so slow it's unbearable with asset debugging enabled.

It really hurts not having the ability to dive into the separate files.

"serving up 80 separate assets is insane." in production it certainly is, we minify, concatenate and use a CDN. In dev if you concatenate and do not use source maps you compromise your debugging experience.

The "refresh all browsers" is only refreshing browsers pointed at my local dev Discourse instance, youtube is safe. I run a multiple monitor setup, I press a key and see right away the effect of my change.

We use fixtures and fabricators, we test individual classes, we mock and all that jazz. I am totally open to PRs that simplify and streamline our test suite, the point though is that now I am never blocked on my test suite in dev despite a full run taking 3 minutes.