Why learn Ruby on Rails [closed] - ruby-on-rails

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
One of my college professors said that ruby on rails is used a lot for web, and I'm wondering how much Ruby on Rails is actually used vs JQuery, Node.js, PHP, etc. Also, what are the benefits?

You are mixing some stuff:
Ruby on Rails is a framework to create server side web applications using the Ruby language
jQuery is a client side JavaScript library that simplifies writing JavaScript web clients
Node.js is a server for the execution of server side JavaScript, thus providing a server version of JavaScript
PHP is a language popular for server side web application development
Thus: Ruby on Rails is a mature framework which offers a template engine, MVC architecture, a mapper between language objects and some relational database and a routing facility between URIs and controller.
Similiar designed frameworks exist for many programming languages / environments, e.g. Django for Python, or see Rails-inspired PHP frameworks in case of PHP.
About its popularity, see e.g. http://hotframeworks.com/
Benefits: IMHO it is a very elegant framework and as the plethora of inspired frameworks shows, has found many developers who like it.
The concepts and techniques learned here might also turn out to be useful when working with other modern frameworks.
And I should note as well, that there are web applications that need less features, e.g. see the Sinatra framework for a lighter alternative.

Also, what are the benefits?
There are a lot of things that websites have in common, e.g. html pages with forms, various javascript features, database interactions, security issues, logging in, etc. If you start from scratch, and try to program all those things yourself, it will be difficult and time consuming, and most likely your code will be full of exploitable security holes.
The other option is to use a web framework. Ruby on Rails is a web framework for the ruby programming language. All the various server side programming languages, such as ruby, python, php, perl, java, etc., have web frameworks(and usually many different frameworks to choose from!). A lot of smart people have come up with the best code for various things that websites need, and you get to use their code for free in your website.
The disadvantage of frameworks is that they are often large and complex, e.g. Ruby on Rails, Java Servlets+JSP, so it can take awhile to learn how to use them. Even then, you will probably not have a good grasp of their inner workings, so you are always sort of feeling around in the dark trying to get them to work the way you want them to. It's sort of like trying to push a large boulder which is at rest to another spot of your choosing: sometimes the boulder rolls cleanly into position, and other times the boulder seems to have a mind of its own and wanders off course.

Related

Front-end + Back-end development [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I've been really getting into Ruby on Rails. I want make great apps that don't just function well but look really nice as well, and I'm worried I might not pick the right front-end language to compliment RoR development. My question is how do you simultaneously prepare for both back-end and front-end? Summer is coming up and I'm already enrolled in a few RoR classes, but am trying to choose some great front-end courses as well. Appreciate any guidance
Sam --
TLDR; Know HTML and CSS like the back of your hand. Spend time learning intermediate and advanced javascript. Its libraries are powerful, its frameworks provide a rich client experience, and its not going away anytime soon.
I've been a RoR developer for two years. When I was first learning Ruby, and coding principles in general, its common to want to learn and learn all kinds of different stuff. While it's tempting, I would suggest the opposite -> Hyperfocus.
Rails is a robust framework, spend some time with it. I will agree that Rails views are very bare bones and I do not like the way they organize javascript and stylesheet logic. It is very loose. But, unless you're building a huge app, organizing .js and .css files isn't super important.
As far as looks go, html and css are the backbone. There's literally a javascript library for everything you could want to do from a UI/UX perspective, so focus on intermediate/advanced js. That will make opening doors to robust client side js frameworks like angular, ember, and backbone much easier down the road using Rails as simply an API.
Lastly, one of the hardest things to find in the industry is a great designer who can also code, or a great software engineer who can also design. If you really care about UI/UX get some books on fundamental web design principles; they go a long way.
Well, I encourage you to first code a few apps with the default rails stack and after that start to poke other front end options with rails as back end api.
Stay comfortable with rails first, has a lot of good tools and is enough for most of the apps you may want to build, mainly on the first stage of your learning path.

Should I learn Rails, Joomla or DHTML as a beginner? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
This is not a core programming problem as most posts on this website are, forgive me for that but I didn't know where else to ask this.
I am a beginner in web languages and want to build a small website for our family business, mostly a bunch of galleries that would display our different product lines with prices and some basic specs for customers to get an idea..currently I'm pursuing comp science at the undergrad level
So here is the problem, I can't decide between platforms
I started out with HTML and making a basic mock up but that didn't quite work out as i needed to have dynamic galleries that was quite hard to code by hand and since we need to update often it would be a pain even if I did manage to get it going
then I thought of Joomla as it would be easy to update but soon realized that its not that easy to customize templates
Then I started reading about Ruby on Rails and what it offers and it sounded really interesting might be useful in developing applications that we possibly would need in some time.
so I wanted to know from the community which course should one pursue: DHTML, Joomla, RoR
Please keep in mind that I want this to be a learning experience that will be useful possibly in the future in my professional career and at the same time get the job done.
I would also greatly appreciate any resources or suggestions that the community might have.
You are actually comparing apples to oranges here as DHTML, RoR, and Joomla are not the same thing. You are comparing a mark up language, to a programing framework, to a content management system. You could feasibly learn a CMS (Joomla, Drupal, Wordpress, etc) and never learn to code a single line of HTML or PHP.
For the purpose of getting a site that you can manage and edit yourself, then what you are asking is which CMS should you use. There are dozens of CMSes and opinions on which one is the best. In general are the big 3 - Wordpress, Joomla, and Drupal. Wordpress is by far the easiest to learn. It has a very simple admin that shouldn't take more than a few minutes to figure out. There are tons of themes and extensions that go along with it. The downside is that it's coded to be a blogging platform, not an extensible CMS. That means that doing things other than blogging are harder to accomplish (relative to Joomla and Drupal). It can still be done, but the more complex the site, the harder it is to do in Wordpress.
Joomla is the next step in ease of use. The admin is significantly more complex than WordPress, but a tech savvy user will get the basics down in the first couple of hours or so. Extendding Joomla is much easier for both the developer since the framework is specifically designed to be extended, and the user since installing is very quick and easy for most extensions. It's a pretty good balance between ease of use for the admin and ease of extension for the developer.
Drupal is probably the most powerful of the 3, but the trade off is in the user admin. Most non-developers will struggle to understand how the admin works or what taxonomy is and how it works. Again, the trade off is that it allows developers much more power in extending Drupal. Drupal makes it easier for the developer to accomplish much more complex tasks than Joomla or Wordpress.
At the end of the day, all 3 can accomplish the exact same thing on a website. You need to determine which one will accomplish your particular needs the best.
That said, you should still learn HTML and a programming language. My recommendation would be to learn PHP and mySQL. That will give you a solid foundation on which to build on once you are well versed. Other languages and flavors of SQL will come easier, plus many of the large open source projects are done in PHP/mySQL.
Since what you are trying to do is a pure learning exercise, I suggest you look around into a lot of things(rails/css/javascript/php etc) until you finally find the one that you will have fun playing-with. You learn faster when you can tinker with it.
Ruby on Rails may 'seem' easy to an advanced web developer. Its an advanced framework and needs considerable amount of investment in terms of time and interest and most importantly you need to have an aptitude for it. If you REALLY want to do this, and you have a general aptitude for Web programming, I suggest you start with Wordpress. Its search-engine friendly and will get you running in no time.
Learning we development and design is not a small task. It'll take you years to get even moderately good, so if you need to get something up and running now, I'd not recommend you to build it yourself.
There are a lot of nice Joomla templates and plugins available if you are ready to pay a small price for it. Search around a bit more, and you might find something that works for you.
I would start with a CMS such as Joomla or perhaps even Wordpress. Grab a template and tweak it - this will be a good introduction to coding websites as the really hard parts are already taken care of.
Once you have finished the site that you are working on then you can think about moving on to a framework such as Rails or even a PHP based once like Code Igniter. The frameworks will take a lot longer to figure out but at the end of the day they will give you a better learning experience then just tweaking a CMS template.
I would say it depends on your goal. As mentioned they have different purposes. That said I would say Joomla or Rails.
If you are interested in CMS (or design), and don't want/care about getting down and dirty into coding then I would use Joomla and learn what you need to acccomplish your goal.
If your goal is to be able to develop custom web APPLICATIONS, I would probably learn Rails. There is much more of a learning curve but you will get experience with things like html5, javascript (or coffeescript), css3 (or sass), exposure to the MVC model (model view controller) and exposure to Ruby.
But with Rails there is a lot more to learn, but you will have a lot of knowledge.
If you want to go down the rails path, maybe start with a Rails CMS (like locomotive or refinery) b/c they are written in Rails, you could look at the code or have some insight into the CMS. Disclaimer I have not used a Rails CMS (just did some research)
I would choose Joomla. They have a vast array of components and modules that should meet your needs. As far as customization, if you are a beginner this will be difficult no matter the platform. DHTML is not a platform. DHTML is mainly javascript, css and php. I suggest you get some books on doing dynamic stuff with javascript and jquery, styling with css and creating MVC sites with PHP. When you learn all this first your job customizing an whatever platform will be much much easier.

Ruby framework to write a API in? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Hi I'm looking to write a multiplatorm tasks application for technical people. I want to handle as many platforms as I can (web, shell, desktop) and therefore I have decided to begin with a server/API.
I want to write it in Ruby, however i think that Rails is a bit too heavy for this, even though it would do the job. Sinatra also doesn't seem quite suited for the task.
All the server/API would do would be to translate simple requests to Database queries, and at a later stage some authentication and authorization.
So basically I want to know:
1) Should I use a REST api or a SOAP api?
2) Is there a framework for this? Or what is the closest framework avalable?
For the adventurous, there is also a less known project called grape. It is a rack based application, similar to Sinatra, but is only purposed to write API. I don't think it is mature enough to be used in serious projects yet, but it is still interesting to know.
1) REST, SOAP is a terrible system and its support in Ruby is quite lacking. REST, on the other hand, is basically the ruby default and takes very little effort to use, especially if you are using REST/JSON.
2) Sinatra and Rails are basically your options. It comes down to how complex this application will be. Sinatra can probably handle the task just fine, but Rails does much of the work for you at the expense of bloat. You will already be taking on some of the rails bloat if you use ActiveRecord for the database. When authentication and/or roles come into play, Rails has mature solutions for both. Without any additional information, I'd lean towards Rails as it does much of the work for you and, when written properly, can still be fairly fast.
Actually SOAP is very VERY easy to implement with AWS.
At the same time, REST API is also very easy to implement.
I have written a couple of different and parallel (JSON, XML and custom format) APIs with rails. Im sure the framework stack performance will not be your bottleneck, so don't bother with worrying about performance just yet. Your first bottleneck will anyhow be database and then perhaps requests per second.
All in all i would suggest going with Rails, it has a lot of work cut out for you.
Since this old thread still comes up high on related Google searches, I should chip in my highly biased (as co-author and user) recommendation for Hoodoo. Unlike other offerings, Hoodoo includes an API specification that says how API calls must be made and how they must respond; it enforces a consistency across your design that calling clients will appreciate. If you can call one API, you can call them all. Hoodoo implements a lot of the boilerplate so you can focus on meaningful service code.
We've been using Hoodoo services for over two years very successfully at Loyalty New Zealand, who run the country's largest loyalty programme. Our Hoodoo-based microservice platform handles 100% of our client transactions.
http://hoodoo.cloud/
https://github.com/LoyaltyNZ/hoodoo
https://github.com/LoyaltyNZ/hoodoo/tree/master/docs/api_specification
https://github.com/LoyaltyNZ/service_shell
Hoodoo has 100% non-trivial rspec test coverage and 100% rdoc documentation coverage. As you'll see from the above links, there's quite a lot there!
Hoodoo is a Rack application, so works with any Rack compatible web server. Our preferred deployment mechanism though is an indefinitely horizontally scalable arrangement based on an HTTP-over-AMQP bridge and an AMQP cluster of nodes each running the same collection of services, managed inside Docker containers and deployed with Fleet. The system self-load balances across the service nodes via the queue and the decoupling of front end HTTP->AMQP processor versus the AMQP->HTTP input into the Rack stack dramatically reduces the system's attack surface. We wrote the front-end component in Node and for more about this along with Node implementations of other parts of the framework concept, see the Alchemy Framework. Alchemy Node services and Hoodoo Ruby services can coexist on the same grid happily.

Which modern web frameworks are popular in a corporate setting? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 months ago.
Improve this question
My company is looking to move their software to an open source framework. Their first thought was J2EE. I know that Django and Rails are popular for recreational development, but not sure about them in a corporate setting.
I was looking to compile a list of possible web frameworks to consider. Unfortunately I am not able to release our requirements to the public. Also I would like to know if you have seen/used different frameworks in a corporate environment.
Thanks
I believe the more important question is what talents you got. If you have a primarily Java team, and you want to completely move to Ruby or Python, it's gonna be hard, if not impossible.
When deciding if X language/framework is good for a business, you have to consider opinions from your internal technical staff first. That normally sets you in a place with limited choices. Unless you are with a very small but highly talented/motivated team or planning to build a team with new hires.
Not sure what you mean by a corporate use, but we're using Django at a large media company for the websites of nearly 40 radio stations.
Another vote for Django. I'm not sure if the Washington Post or LA Times count as "corporate" but they have a lot more demands (both daily hits and time-to-new-feature) than your average "corporate" environment.
Struts, Stripes, Wicket, Spring MVC. I use Grails and love it.
You can go to Rails too. We use Rails successfully in a number of serious applications.
If you are just looking to save money from software, you can go to any J2EE frameworks out there. If you looking for some fun and rapid development, try Rails.
It all depends on the type of the project and the talent you have.
I use django in a real-time professional environment.
it's solid, and blazing fast (django on nginx/fastcgi, and soon couchdb too!)
We're using sinatra (ruby) for frontend to our main internal application. Simple, stable and flexible.
Struts2, Spring MVC, Stripes, Wicket, Grails, JSF, Seam, GWT, Flex, etc (Stripes and Grails being my favorite).
Matt Raible did interesting comparisons of (most of) them in this presentation which is an updated version of this old one.
Another interesting reading might be the What is the most commonly used Java web framework? question here on SO.
IMO, whatever you choose doesn't matter that much, the presentation layer will still be throw away code.
Any framework that keeps you away from the imperative languages (e.g. Java, C#, JSP with Java etc.) is better. Declarative/Functional/Data Flow languages (e.g. Ruby, XSLT, Python, etc.) result in solid implementations that save you support/enhancement $$$.
It sounds like the powers that be are comfortable with Java, but do yourself a favor and avoid J2EE. Go grab Restlet and Groovy, write a nice Rest back-end that not only serves as a programmatic API for your project, but will work nicely with any Ajax/Javascript library you choose to implement a UI in.
We are currently using Django and the web site is driving a lot of business to the company as well as growing by double digits since last year. It doesn't matter what kind of technology the corporation is using but what their business model is. What are you currently using in-house? It will make more sense to use a web framework related to your in-house code, knowledge and man power.
If nobody knows Rails or Django, you have to factor in the learning curve during the migration. It should only be a couple of weeks depending on the savviness of your developers. Then again if everyone hates or do not enjoy working with the in-house technology, trying a new one might be worth it.
"I know that Django and Rails are popular for recreational development (...)"
Rails:
http://basecamphq.com
http://highrisehq.com
Django:
http://www.lawrence.com/
http://www.everyblock.com/
They have high traffic and content-heavy services. I wouldn't call those guys business as "recreational development".

Web development for a Computer Scientist [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have BS in Computer Science, and thus have experience developing software that runs at the command line or with a basic GUI. However, I have no experience making real, functional, websites. It has become apparent to me that I need to expand my skills to encompass web development. I have been using Ruby to develop applications, but I am aware that it is quite popular for web development. I want to use my skills as a programmer to assist me in developing a personal website for a band.
I have experience with HTML, but very little with CSS. I want to leverage my skills with programming languages to create a website containing pictures, audio clips, a dynamic calendar, a scheduling request tool, and other features common to band websites.
What kind of resources are available for a competent desktop programmer to learn the entire process for developing a website? Is it best to use free CSS templates and WordPress as a foundation for my site or make it from scratch? Should I use GUI tools or write it all in Vim/Emacs? Is Ruby on Rails sufficient for my personal website, or should I consider a more mature development platform?
My main goal for this project is to come up to speed on current web design technology, and actually understand the entire process for building a website.
I think one really important thing to understand in web development is HTTP. HTML and CSS are important, but I think it's more critical to understand the stateless nature of the web, and how each of the HTTP verbs work, and what they can/can't do.
http://www.freeprogrammingresources.com/http.html
A good tool for seeing how HTTP works is Fiddler.
If it's as much a learning exercise as anything then take an iterative approach. Build revise. Build revise. My (very) rough guideline below:
Client
Start with the structure of a website and concentrate on the client.
Use notepad and build a bunch of static pages for your band. i.e. Hand code initially. Try to build all your pages with CSS. No table markup. Then play around with some Javascript to bring things to life. (Navigational menu\ Calendar selections\etc). Learn about how to import and link to Javascript and CSS files.... and how these files are treated re:caching etc.
Try to learn up to the limits of what you can do on the client (generally). Factor in the nuances of 3-4 browsers (Firefox/IE6/IE8/Chrome) re:DOM and client side eventing.
Server
Then start looking for what you might want to change across pages/sessions. i.e. what needs to be manipulated server side. And pick a server side technology.
Start with basic post-back processing. Forget databases at this point. Learn how your framework of choice maintains state..... not just the name of the technology but the real nuts and bolts of it. One of your single greatest assets as a web developer is understanding the state model(s) of the technology you're using.
Then go for a deep dive on the web server technology of choice (and in general). Understand the full request pipeline from client to server and back. This will teach you forms, http and its verbs, web server, filters and modules, server to framework hand off, page and control life cycles, back to the client.
Now start working on dynamic content injection and the like. How to make and use reusable components in your web pages.
Databases, caching, performance and diagnostics.
Then get into into all the fun stuff like ajax, etc. Replace your javascript with jQuery, etc.
Then you got the whole Webservices\XML\JSON\etc side of things to discover.
Resources
Well the web obviously. For client side stuff, going to the sites of companies who make third party web controls can be quite interesting. Asking how the hell they did that? Viewsource is your friend. Look at how they structure and build their pages. Pick a couple of good web designer sites, and you find a plethora of rants about browser wars etc that will give you good (under the hood) info.
Once you hit server side, I'd go for white paper type learning from your vendor of choice for your technologies.i.e. webservers/frameworks/etc. Again find a 3rd party howto/evangelist site (I used to use a lot of "4 guys from Rolla" for example) that will demonstrate how to do various things. Language learning is ongoing. Basically just do the best you can till you find a better way.... and always be on the lookout for a better way.
You really need to understand html, forms and css to get anywhere. I say forms as this will give you the round trip needed to understanding the stateless nature of web dev.
To further labour the point, I have interviewed many people who think you can only have one form on a page and can only have one submit button per form. This is all down to a lack of foundation knowledge.
So for that I'd recommend starting with htmldog.com.
After that, a lot of web development is done with frameworks. Gone are the days where you do it yourself (well mostly) but my above point still stands. You do need to be able to peep under the hood with some confidence.
I've been doing web development for 12 years and started out with Perl on Solaris and Linux. Since then I've also done Java and more recently ASP.NET. However, I'm slowly falling for Django in my private projects.
What I've found over the years is that the inherent problems - cookies, javascript, presentation, state, authentication are all the same but just handled differently. So ultimately its down to you and your language preference. Plus a little of enlightened self interest when it comes to potential employment.
Programming aside, you should also become familiar with web servers (Apache and IIS spring to mind), Http codes and headers, Mime types and encoding and FTP. As well as Javascript (mentioned already), plugins, browser platforms and good development practises such as using Firebug, Fiddler and so on. It also wouldn't hurt to have a good idea of the image formats available, image optimisation, CSS sprites, content compression, caching and the like.
All depends on where you want to start!
For a newbie, I'd pick Django and (obviously) Python. Good, clean language with cheap startup options, low cost IDEs (ie free) and hosting your sites is very affordable.
But that's just a subjective opinion.
If your goal is to
My main goal for this project is to
come up to speed on current web design
technology, and actually understand
the entire process for building a
website.
Then start from scratch in Ruby, PHP, Java, ASP.NET, etc...
When you run into a design problem or just want to know how others have approached something, then look at the frameworks.
Once your up to speed, and your website is starting to grow, then segway into a framework, to get up to speed on the frameworks.
I agree with John on this one.
As you know from your own experience in pursuing your BSc, understanding the basics of any language is what makes you even more capable in expanding that knowledge or specializing.
With that in mind, it would be best to understand the basics of HTML and CSS.
Understanding the syntax and overall language will help in the future when you want to pursue large projects using frameworks like Django and Rails. The basics will also especially help with tweaking CMS' like Wordpress to be more customizable to your needs.
One thing in particular that I'd like to mention is that web programming, like many other forms of programming has its own special structure and "proper" way of doing things.http://www.w3.org is a great way to ensure that your work is passing general web design standards, most sites don't follow this because it is tedious, but from a learning perspective it ensures that you get a nice strong foundation.
www.w3schools.com is also a great resource for detailed help on web programming. Lastly, I like colourful code, so I like using basic text editors such as notepad++ or notepad2 or gedit to do my web coding. GUIs like dreamweaver may tend to fill up your code with extra junk and spaces, so I don't recommend them, but they are still great tools.
Don't bother with Rails yet -- write CGI scripts in Ruby. It will be very similar to what you have done for class.
After you have about thirty of those under your belt, you'll know what you want out of a web framework.
I'm a Computer Scientist and a web programmer and I would suggest you learn both HTTP and CGI:
CGI Made Really Easy
HTTP Made Really Easy
As the titles of the above tutorials claim, they made the concepts "really easy" for me.
Once you've got CGI and HTTP down pat, I'd suggest checking out following sites that provide a wealth of articles and references for web programming:
webmonkey
w3schools
Mozilla Developer Center
Assuming you want to concentrate on writing web apps, then Perl, PHP, Python and Ruby are all fine choices (I myself use Perl predominantly) and I'd suggest doing some research into the popular web frameworks available for each language.
Most importantly, pick something simple as your first web app, e.g. a form and a page that shows the results of submitting that form. Some good examples (using Perl's CGI module) can be found here:
CGI.pm - a Perl5 CGI Library -- see the first set of links on this page.
When you want to start writing web apps that use a database, read up on SQL and popular libraries/modules in your chosen language for database manipulation, especially ORM (Object-Relational-Mapping) interfaces that allow you to deal with records in an Object-Oriented fashion.
Good luck with it! Being a web programmer is fun because your audience is teh intarwebz! :)
If you are starting from scratch as per John MacIntyre's suggestion, you may lean towards PHP. With all of its shortcomings, it does have one really good user manual. It is also easy to get started with and is installed on pretty much every host and goes well with Apache.
Also, w3 schools is good to begin learning about CSS and XHTML but don't forget to check out the specs at W3C.
Also, please read this Stack Overflow question & answers.
For what you're describing, Rails or Django might be slight overkill but it wouldn't hurt to learn them. Django, in particular, might be good because of the notion of a project containing multiple apps (e.g. calendar).
Whether you use a framework or write everything yourself, though, you'll need to know HTML and CSS. CSS is extremely simple if you have a BS in CS...you could read a tutorial and know it in five minutes.

Resources