Since I'd be a solo dev on my projects, ecosystem and speed of development are important to me. How does Golang's ecosystem for web dev compare to Ruby on Rails currently? I know that Ruby has lots of gems (devise, etc) to make web dev faster. Does Golang's ecosystem have similar tools at this point?
A few other notes: On the front-end, I think I'd be most interested in using Vue.js from what I've read. I'm not really considering Elixir/Pheonix at the moment, as I don't like the idea of needing to learn both Elixir and Erlang. Thanks!
Also, when running an rspec test that touches/creates/modifies ActiveRecord database objects, the rspec scaffold will automatically create a new database transaction for running your test so that the test database you are using is not affected.
In general, don't worry if the Ruby that you write looks nothing like the concise and sometimes 'magic' Ruby that more experienced developers can produce. You'll get there when you get there. Try to learn as much about Enumerables as you can https://ruby-doc.org/core/Enumerable.html
Vue.js is a good choice. Not as popular as React... yet.
Rails, as other commenters have noted, has a learning curve. As long as you try to stick within the normal usages of Rails, you should be fine.
Whatever you do with Rails, stay far away from their template markup languages (haml). Write the front-end in Vue.js, consuming APIs, don't do any server-side rendering of anything. If you really want to do server-side front-end, ditch Ruby/Rails and just go full blown Node.js front and back end.
Good luck, just get started!
Could you build your app by generating HTML on the server, including some JavaScript and returning it? That's how old reddit, Hacker News, Stack Overflow, and no-JS Amazon are built.
I myself know/use way too many languages/frameworks. I do very (most?) often choose Vue/Go and stongly recommend this combo. I also use Ruby/Rails at my day job.
Go is mature enough but isn't as comprehensive as the Rails ecosystem. Rails is a good framework but still has a deep learning curve. Most of your back-end will be simple database/json requests. It's easier to be self-sufficient with Go, with Rails I always feel like I'm using so many things I don't fully understand.
There will be enough Go libraries for doing the common things you will want to do.
If you do have any special requirements (real time, video rendering, scaling to a ton of users etc) then it would be good to spend time looking at the pros and cons of various tech stacks
You dont need to learn Erlang to use Elixir, rather you would need to know Elixir to use Phoenix; like you need to know Ruby to use Rails.
Also you can build a Twitter timeline clone in under 18 minutes using Phoenix LiveView: https://youtu.be/MZvmYaFkNJI
I'm happy to clear up some things but in the end your language/framework choice doesn't matter as much as long as you are comfortable. Just start doing.
> I'd like to start making a social media web project and I'm wondering if I should use Golang or Ruby/Rails on the back-end?
They are very different things.
RoR is a web-framework. There is a clear path to the whole process of writing a web-application. Interacting with a database, auth, routing, code-generation, structure... Using a web-framework you can lean on years of experience, tutorials, documentation etc.
Go is just a language. Granted it has an extremely useful standard library and is basically designed with web-servers in mind (among other things). But you'll need to make decisions yourself as of which libraries you want to pull in to achieve the same feature set as with a framework. There are also web-frameworks in Go you can choose from.
> I don't have any prior coding experience.
Both Go and Ruby are very accessible languages. I suggest you go through some tutorials, look at some code and see which language sparks more interest.
> I've been reading a lot online about how Object Oriented Programming makes maintaining code difficult in the long term, which makes me think Golang might be a better choice than Ruby.
My opinion: You've been reading the wrong type of articles. OOP is very much a useful paradigm applied to many, well working, huge code bases. And it is one of many paradigms that are useful. There are some people who "overdo" paradigms. Be pragmatic, not dogmatic.
At this stage, just trace along with w/e is "idiomatic" (AKA how most people write). The code you'll write will be beginner level code anyways, which is fine.
Programming paradigms like Object Orientation, Functional Programming, Procedural Programming, Event Driven Programming, Data Driven Programming and so on are just tools.
You'll learn them along the way as you get a deeper understanding. They are all useful in the right context, with the right language when solving a particular problem.
Just write simple code and try to keep it reasonably DRY. Clean up stuff you don't need from time to time. Write comments so you get why you did a thing in a particular way. Don't worry about paradigms. They don't matter until you know they matter and they are not a style attribute but something you use.
> which makes me think Golang might be a better choice than Ruby.
Go is a multi-paradigm language. You can write idiomatic OO code in Go and many do. Abstraction through interfaces, polymorphism though composition, message passing through dynamic dispatch (or in some cases channels), local retention through private fields and error values are all corner stones of modern OO and Go has a very clean way to use them if needed.
> Also, Golang's speed sounds like it would help to keep my server costs low if my site were to get some traffic.
At this stage the bigger money saver will be using a language (and framework/libraries) that you will be motivated to use (fun) and just jive with you will have a larger impact on your wallet and productivity. Then, when you get more experienced you will learn about performance and how to optimize for certain things. In short: Don't worry about it yet.
> How does Golang's ecosystem for web dev compare to Ruby on Rails currently? I know that Ruby has lots of gems (devise, etc) to make web dev faster. Does Golang's ecosystem have similar tools at this point?
If your happy with making a lot of decisions on your own then you'll be fine with "just" Go. Just keep in mind that as a beginner, there are a lot of things you are not thinking about right now. Using a battle-proven framework will avoid common pitfalls.
In any case, w/o trying to sound patronizing: start reading articles that don't want to sell you opinions and products but are actually technical and useful. Start with these for example:
https://www.martinfowler.com/articles/web-security-basics.ht...
https://developer.mozilla.org/en-US/docs/Web
These kind of articles are not flowery opinionated things. Just dry, technical, pragmatic stuff. developer.mozilla.org is a fantastic reference for people who work with the web.
> On the front-end, I think I'd be most interested in using Vue.js from what I've read.
Great idea. Vue.js is very beginner friendly and has has great tooling around it.
Use whichever you feel more comfortable with and productive in. Either will work just fine.