Convert Ruby 1.8 to 1.9 hash syntax
In vim, for an entire file:
:%s/:\([^ ]*\)\(\s*\)=>/\1:/gIn the shell, for an entire project:
perl -pi -e 's/:([\w\d_]+)(\s*)=>/\1:/g' **/*.rbNow, instead of those old-school hashes like this:
get '/', :agent => MOBILE_BROWSERS doYou’ll have new-school hashes like this:
get '/', agent: MOBILE_BROWSERS do
Don’t make objects that end with ‘er’.
Some er’s that I’ve learned to avoid over the years:
- Managers - Every time I see one of these, I cringe. People will usually tell me what it does, long before they can tell me what it is. Is it a registry? Fine call it a registry. Is it a history or a log? Call it that. Is it a factory? Call it that.
- Controllers - Only good controller object I’ve made in the last 20 years was an interface to a BallastVoltageController that represented a real world object. The fact that every single MVC implementation in the world has had a different role for Controller ought to tell us something about how well that idea fit.
- Organizer (and many like them) - Focus is on what it does. This is a great example of how easy it is to turn many of these ‘ers’ into nouns. Call it an Organization. Now we’re focusing on what it is.
Analyzer/Renderer/etc - Definitely examples of “worker” objects. What if they had been Analysis/Rendering/etc.- Builder/Loader/Reader/Writer/etc - Remove the focus from the objects being manipulated, and tend assume to much responsibility themselves.
Some non mainstream yet pretty hardcore languages. Check it out.
If you want to learn to code and build stuff and you’re starting by asking someone else what you should do, you’re already thinking about it the wrong way. Immediately, right now, with no preparation, in the blink of an eye, you can take a huge step toward your goal by realizing that you don’t…
I’m more than happy with Emacs but this is handy.
How to charge your clients?
If you’re a web developer, content writer, graphic designer or anything related to freelancing this question always pops out.
You could:
- Charge per hour basis
- Charge flat fee
There’s no way to say which is right or which is wrong. A little bit experimentation is the way to test demands in your market. What is right in US might not work in Asia or vice versa.
Here are some resources I find helpful.
- Flat Fee Versus Hourly Rates – How to Charge for Your Web Design or Graphic Design Services - A great article on hourly rates vs flat fee. His heavily inclined towards flat fees. Read this before you decide to charge hourly rates for your next work or projects.
- How to Price Your Web Design Work - The knol provides some calculations for web designers in pricing their job. Worth reading.
- Don’t just roll the dice - A free book on pricing your service (geared towards SAAS). Highly recommended.
- Pricing Strategy - Marketing pricing strategy, not really related to design work per se.
Update (Sep 5th):
Another good article regarding software price:
Nice advice on leveling yourself :D
Nice tip
50 lessons, observations, & unadulterated opinions on web developer life through the eyes of one of them.
