Rails vs JavaScript: Which one should you use for your SaaS?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so should you use ruby on rails or should you use javascript for your next sas application let's find out [Music] hey what's up everybody my name is don i am a software developer and independent consultant and freelancer based in the united states of america and on this channel i teach people how to start survive and thrive in the world of freelancing and software development so today's topic i'm going to be talking to you about why i feel that you should use ruby on rails over javascript for creating a new sas based application so let's go ahead and hop into it let's go through the pros and cons of both and so i'm going to preface this by saying that i have built applications in both ruby on rails as well as node.js and react and view and all these other ones so ultimately i have experience in both number one let's just start with javascript now javascript is you know one of the pros of javascript is it's everywhere if you have a chromebook you can learn directly on your chromebook there's tons of online tutorials which you can learn from it's a dynamically typed language which allows you to just easily kind of start coding right there in your browser or online through any of the online platforms you can code and it's just kind of easy to get going it just works you can see it work in real time that gives you a lot of confidence at the end of the day furthermore there's a package for everything in javascript world so you can use npm if you've installed node and at that point in time you can install image recognition file manipulation image manipulation ml all different kinds of stuff is all done in javascript and it's everywhere you can run javascript on the backend with node.js you can run javascript on the front end with react or vue or etc you can build full stack applications simply through javascript alone so it's everywhere and javascript is a big blank canvas so if you only want to write scripts you can write scripts if you want to write applications that are top to bottom you can do that too and furthermore if you want to benefit also from static typing you can use something like typescript which compiles down to javascript and will give you static typing inside of your javascript or typescript files which then compile the javascript so there's tons of options out there again if you need a library for anything you're wanting to do most likely that library's already been developed but what about the cons of javascript javascript is javascript and if you've ever worked with javascript long enough you eventually grow to have a disdain for it because there's just these weird things about the language that sometimes don't make any sense how are you going to work with numbers can you parse this number can you do this you know is that a one is a string is that considered truthy not truthy there's a whole mess of things is this a number not a number what you can get in the whole wild situation it's just a very particularly weird language at times that some of the things that it does don't make sense and that can be very confusing for someone who's new to it especially if you're not using newer versions of it and you're not used to the scoping and you don't know how to properly write good javascript and that kind of leads it to the fact that javascript's not really an object-oriented language now yes of course you can have objects but it wasn't built to be an object-oriented language initially it does support these things as it's matured but if you think about it it's mainly a functional style language now i'm not going to call it a full functional language but the definition of a functional language is would say concrete but it does have a lot of functional concepts you can write everything as a function you can pass functions you can just do a whole bunch of stuff so it's a very functional style language again if you're not used to the functional language it's gonna be a little bit confusing like i said earlier as a benefit javascript's a blank canvas now the problem with it being a blank canvas is there's nothing stating this is how you should do websockets this is how you should connect to file systems this is how you should ride out to s3 anything that you might be able to do in a web application there is a number of options and javascript because of that blank canvases do what you want that can be very frustrating because you can run into a humongous thing of this like analysis paralysis where like i don't even know what to use you'll do that a lot it's just how these things kind of end up working out for you because it's confusing when you don't have any type of you know guidance and if you're new to this can be very confusing typescript i mentioned is a benefit but it's also kind of a real pain in the butt if you've not used it before you'll run into weird situations and i still do to this day of how typescript works in one situation doesn't work in the next and overall i can find myself finding typescript as much as i'm benefiting from it so that can also be seen as a major downfall as well and lastly of course because there's no guidance inside of building the applications there's 10 different ways to do 10 different things or 10 different ways to do the same exact thing so finding that right balance is really difficult and can put you in a tremendous amount of pain through analysis paralysis so now let's kind of juxtapose talk about ruby on rails so what are the benefits of ruby on rails number one is just gonna be the speed of development once you have ruby on rails installed ruby is very convention over configuration if you follow everything that rails has to do say if you do the rails way you're gonna connect to a database this way you're gonna write your database migrations this way you're gonna query the database this way using the models you're going to do all of your hd you know response handling and controllers you're going to do your relationships and your models validation and your models all this stuff is built into the framework this seems that the developers of rails have thought about almost everything that speeds up your development significantly you can simply say i have a database here's what the schema looks like or i have this new table it will generate the controllers the models which then allow you to just directly connect to the database and say hey i need all my person records or all my user records user.all i have all my user records user.where firstname equals done boom i have all the users whose first name equals don that's just built right in maybe i want to do websockets okay cool now i'm using action cable maybe you want to store files in s3 or google cloud or digitalocean i'm using action storage maybe i want to use you know text with a nice wysiwyg editor i'm using action text now maybe i want to use something else and build a chat application so i'm going to go back to using action cable this stuff's built in maybe you want to send email that's easy there's mailers built in i want to log bloggers loggers are built in i want to use it with sendgrid okay cool just configure it with the send grid api key maybe use a smtp or you can use the gem for that so it also has a bunch of other gems you can use to connect to other things the underlying connection there's basically if you think about it it's a bunch of adapter patterns say are you want to send email all right follow this adapter pattern and you can send a postmark or send grid or amazon ses or anything like that and overall when you want to build a web application would be on rails as long as you follow the rails way your speed of development is insane you want to add a new application that has user login use the device gem and in minutes you have full user authentication with sign up lost password functionality emailing new user signups and authentication all within your controllers in a couple of minutes that in itself can take days to write in something like javascript if you're not familiar even with the best javascript packages you can't be that fast to set everything up now additionally on top of that ruby on rails just allows you to be productive and when you're able to be productive not focus on the plumbing becomes much more enjoyable so that's ultimately the thing in my opinion here that's really great is i get to enjoy building my software business because i'm not fighting the technology to do what i wanted to do now it's not all roses and puppy dogs and ice cream there are some cons to ruby on rails as well ruby can be considered kind of slow it's not going to be as fast as like go or no js or anything like that that's in the javascript framework you know javascript being node.js it's going to be a little bit slower at times because it is doing a little bit more underneath the hood it can consume a lot of ram and a lot of memory and so depends on what you're doing you might need to be careful and tune your queries tune your application so it doesn't consume so much memory if you're using something like action cable and you're using live chat and live web sockets and there's a ton of connections and it's driving up your memory usage a lot you might need to take some time and replace that with any cable which uses a go based version of action cable or you know that's called any cable through go or whatever you might want to use that's much more faster and much more memory efficient so you can handle that so there are options out there though it can be considered a little bit slow at first a lot of people will look down on that but you have to realize what you're building your application for is your application only going to be used by 100 to 500 people a day to log in and check their billing okay do you really need the throughput of a million users every 10 minutes probably not so that really doesn't matter so you have to know your use case and for most use cases rails is going to perform just fine and if you think that rails can't handle a load look at something like shopify shopify is a rails app so is github there's a ton of them out there that get a ton of traffic so it can handle it you just have to know how to tune it and next is it rails is not seen as a hot new thing anymore it's not the brand new language it's not the brand new you know web framework that's out there that's been just recently developed it's been something that was built to be productive and joyful to use since its inception and continues to be that way but it's not the new hot thing that everybody wants to use and lastly your queries and rails can be a little bit hairy if you're not used to kind of doing these nested queries through your models or using you know things arl a-r-e-l queries inside of rails can be very challenging if you're not used to them so it does take a little bit of a learning curve all right so that's kind of the pros and cons now what i want to do is tell you the story of what really set this whole thing in stone for me like i said i've built applications with ruby on rails and node i've built in multiple node applications with front ends i've built million applications which is express angular and node those have shipped but my most recent experience has been with node.js with express as an api and the front end being react with javascript and typescript i've done this twice actually and both times what i have found is every time i'm developing the application and it has an api and it has a client application i'm actually building two applications i'm building the client application and i'm building an api which is its own application they communicate over http through the api so i'm actually building two applications one for the client one for the back end anytime i need to make a change in the back end what i'm finding is then i gotta go make the change in the front end and make sure the integration still works that works that's fine and that works a lot of time in how most companies work through integrations and so forth however when you're a small company and you're a startup or you're just a single person and you're starting your sas application you don't want anything to slow you down you want to be as nimble and as quick as you can be because if you're not making any money or barely any money the last thing you need is something else to slow you down and having two applications is going to slow you down and i had this example from a couple of years ago i built an application had the api i had the client and about eight weeks in i felt that i was moving too slowly and every time i had to build something took forever i time boxed myself i'm gonna give myself three days i'm gonna try to rewrite this in ruby on rails and within three days i rewrote 80 of the application in ruby on rails took about two or three more days and i finished up the rest of the application in ruby on rails so about five to six days overall total days of work i replaced eight weeks of work that i had done in node.js and react and i moved it all over to ruby on rails now of course that went from two applications which was a node api and a react application into one big monolith rails application however this was a sas application that was going to be used by hundreds of people at the time at the most and i was then able to make changes adapt quickly to my market and then respond to anything that needed to happen inside the application much quicker than having to update two different things in the application while that might work when you have a larger team you have funding etc when you're small and you're starting off you need to think about what's going to work for you how can it be more nimble what's going to be more effective in my opinion rails is going to give you that flexibility that speed of development so you can change make updates and just give you a lot more bang for your buck at the end when you're building a sas application and furthermore there's so many things that are just built into it that you can just build features faster and validate it out there because when you're building your sas application you need to be quick you need to get it out there and the last thing you need to do is be building more stuff and taking more time to develop and finding any additional frameworks or any idiosyncrasies of that if you follow just the rails way of doing things you're just going to be able to develop applications quicker and that's ultimately what this comes down to how can you develop your sas quicker use a tool that's going to allow you to develop your application as fast as you can as effectively as you can now you might say hey i am really fast at node and react and i've built my own framework for it okay that's fine then use that but for me what i have found based on my experience of shipping multiple sas apps in ruby and multiple sas apps with javascript with node and react is by far hands down ruby on rails is much faster and much more reliable to build sas applications from the ground up and that's what i'll be using going forward so hope that helps you make your decision of which way you would like to go i'm going to use ruby on rails let me know in the comments below which one you've decided to go with or if you have any questions and i'll do my best to help thanks for watching and i'll catch you in the next video [Music] you
Info
Channel: Donn Felker - Freelancing for Software Developers
Views: 338
Rating: undefined out of 5
Keywords: Rails vs JavaScript
Id: A1ICndiLCGY
Channel Id: undefined
Length: 12min 49sec (769 seconds)
Published: Wed Nov 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.