brain.rbinstance_missing
Being a “better” rails programmer, involves mainly around your basic way of work, self discipline and how and where you get your valuable updates from.
Now, as i see more and more people getting into Rails recently, following a dangerous hype tidal wave (Thank you twitter), i see people that don’t really understand what are they doing:
What i mean is, that is that Rails is a pretty fast-forwarding framework, and that updates are coming pretty fast and huge changes are made. So if you ruled the earth while 1.2.6 was out,
you are way back when dealing with 2.3, and if this is your first web application development experience (and even if not), you need to know some basics before you dive into rails.
It’s true for every language yeah, but rails is a framework that helps the programmer overcome some issues and unnecessary hard work when building web applications (scaffolding and Javascript Helpers for example), and most people i know
that turned into rails on it’s early stages, just got sick and tired of the PHP, Java and ASP.NET mess and wanted something like that to help them make things simpler. The difference between those people and the people boarding
the rails train these days is huge, The people joined rails on the beginning, know the basics, and why they hate them or want something to make their life easier, some people today don’t even understand the meanings of OOP programming, Semantic HTML, structure/design separation an basic ORM functionality.
There is nothing need to be done about it, but to try and help these people (and me and other do invest much of our time on the #rubyonrails IRC Channel), so i decided to group a list of best practices and MOST KNOW before going into Rails:
Note that note everything that works is the best way to get something done. There are many ways to solve every problem, ask around if you don’t know and even if you think you know, somethings that may seem to be working fine may cause a real pain in the future.
respond_to do |format|
page.html {.. what ever}
page.json {}
page.xml {...}
end
When you are building a web application, you’ll basically build something to answer a browser (user) request. Sometimes the user will require an HTML response, and some other time JSON, XML or whatever you may support.
You’ll need to learn how to use all these languages/standards in order to make a proper good use of them in your application, head first on HTML.
When you know what your are doing, and what is the best way to serve data to your user, your application will be better to use.
“If all you know how to use is a hammer, all your problems look like nails.”
The more methods, practices and conventions you know, it’s easier for you to know how to solve your problems in a better way.
For example, ActiveRecord’s eager loading is a strong tool when you being your application database queries optimization
Convention over Configuration, Remember?. Follow that in your code, don’t try to do something stupid like “build a controller that serves dynamic models between dynamic databases and …”,
keep it simple, clean and separated, nobody died from having 90 models in his application.
KISS means “keep it simple, Stupid”, and although being a bit offensive, it’s for your own good. Read the manuals, guides and tutorials, and your life would be a lot more easier.
JQuery is awesome, Mootools is great, rails plugins are life savers. but you know what is behind them? study the code of what you use, you will learn a lot from looking at other people’s code.
Don’t over use plugins and extension, if your application will depend too much on a 3rd party product, it might blow up in your face. (e.g: “oh yeah, we no longer continue to work on this plugin”).
Although sometimes is see people on the forums and the IRC channels that act really nasty to people asking questions, most of the people are more than happy to help, as long as you are ready to list.
on irc.freenode.net
Forums
Web development has a huge hype, people think it’s easy and simple, but it’s not.
books like “YOUR OWN WEBSITE IN 9 HOURS” are stupid, and misleading, there are so many things to know in order to create a good application/website, even before thinking about how to implement it on the server side.
If you don’t know the basics, the chances of you making a good application are extremely low.
Rails does supply you with some “magical” tools to get it done lightening fast, but you SHOULD ALWAYS KNOW THE BASICS.
| Variable | Value |
|---|---|
| GITHUB | |
| WWR | { :working_with_rails => 'http://www.workingwithrails.com/person/5844-elad-meidar' } |
| IRC | { 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#mootools' ]} |
| SKYPE | eladmeidar |
You're seeing this error because I think it is funny.