3 ms·
The language is Ruby. "Ruby on Rails" could be considered a domain-specific language, but most think of it as a web application framework built on Ruby. Learni
by DocSavage 19y ago
The language is Ruby. "Ruby on Rails" could be considered a domain-specific language, but most think of it as a web application framework built on Ruby. Learning a language that exposes you to new ways of programming is a good thing (tm). Learning a language that broadens your mind AND makes you more productive is even better. Is it a good investment for you? Depends on what you already know. If you already have good knowledge of a reasonable language + framework (e.g., Python/Django), then you might just want to go off and build your business. If all you know is PHP and you've been hand-coding spaghetti web apps, then learning RoR is a good investment, if at least to expose you to some reasonable programming patterns.
- gscott 19y agoThat is it, I had not heard of Ruby until I started seeing a lot of postings about Ruby on Rails. I never got past the part where you have to make a configuration file or something to generate the code for your page. That just seems to me a bad idea. I realize now that is just the RoR part to make getting into Ruby easier.
- palish 19y agoYou probably know this already, but I'd like to clarify for future readers: The one configuration file you have to set up when you first start a Rails project is database.yml. It tells Rails how to talk to your database. There are two fields for you to fill in, "database" and "password". The rest of the fields are filled in automatically. Here's an example database.yml file. Notice that it has three environments (development, production, and test), and that different databases are used for each. If you're developing your application, you're using yourapp_dev. Rails uses yourapp_test during unit testing: common: &common adapter: mysql host: localhost username: root password: somepassword development: database: yourapp_dev <<: *common production: database: yourapp_prod <<: *common test: database: yourapp_test <<: *common
- hello_moto 19y agoCorrect me if I'm wrong, but isn't Ruby still an OOP language? so in a way, there is no "new ways" of programming so to speak. Just that Ruby is dynamic whereas C-based family languages aren't.
- palish 19y agoRuby's main advantage is that they've nailed the syntax sugar in all the right places. For example, given function foo: foo() is equivilant to foo Also, code blocks are specified outside the function argument list. Something that looks like this in javascript: foo(a,b,c,d,function() { console.log("some callback") }) would look like this in Ruby: foo(a,b,c,d) do puts "some callback" end or even just: foo(a,b,c,d) { puts "some callback" } That last one isn't a function definition.. it's a function call equivalent to the example before it. It's mostly the fact that it -looks- cleaner in all the right places that makes it appealing. That and the massively powerful web framework built on top of it.
- hello_moto 19y agoBut Ruby is still OOP right? And these syntatic sugars don't really change the way people program in a hardcore way no? Basically this is another way to make your loop looks nicer but nothing more. You could argue this case if the language in the topic is something like LISP or Haskell compare to the C-based languages.
- palish 19y agoBut.. Erm.. making a program nicer is the sole purpose of all high level programming languages. Programmers read a lot more than they code. The nicer it makes your program, the more powerful it is.
- gscott 19y agoAs pretty as it may be, picking a language is an important choice, the oldest web application I have designed has already been online for 7 years and I expect it to last more or less forever. So making a choice of language is important, jumping on the bandwagon of the latest and greatest (and it does sound pretty good) might be a problem later on. My point was more about making a long term decision.