5 ms·
This is a great resource, as a career-long ruby developer I've even forgot about some of these (coerce method). Good to keep this info around!
by rubyist5eva 5y ago
This is a great resource, as a career-long ruby developer I've even forgot about some of these (coerce method). Good to keep this info around!
- ta988 5y agoI'm switching to a ruby career. Any advice for a young rubyist?
- nurettin 5y agoI'd advise you to write your methods with type signatures.
- ta988 5y agoThanks. I'm coming from typed languages (kotlin,c++) and I'm clearly into the typing camp even in Python.
- rubyist5eva 5y agoLearn functional style programming, it will take you a long way towards writing maintainable, concise code. The request/response cycle and stateless applications are a great fit for functional programming in Ruby. You may be tempted to use a lot of meta programming, because Ruby makes it easy. Resist the urge and only use it if you have no other option (which is rarely the case). Byebug (or whatever debugger you have available) is your best friend. Also using your repl (irb/rails console) will let you “play” with your application and use your application like a shell with a domain specific language. If you have access to Ruby 3.0, absolutely learn how to incorporate static types into your application it will save you so many headaches in the long run. If you’re working on a web app, learn how to use your database without the ORM. ActiveRecord, for example, is really nice but if you don’t understand the underlying SQL it generates you’re going to be in for a word of pain. Learn the different ways to inject custom SQL into your active record queries. Use the .merge function to easily create complex queries using scopes from multiple activerecord classes. Checkout Trailblazer to learn modern paradigms for building web apps with Ruby. If your employer will pay for it, or you can afford it: Rubymine is absolutely worth every single penny. Use the 30 day trial and you’ll be hooked, I can almost guarantee it. Take a few minutes and understand how the Ruby Ghost Class works, it’s seldom useful but you’ll impress any senior developer with his salt if you know what it is and how it works.
- ta988 5y agoThanks!
- ta988 5y agoI have my own license for all JetBrains products so I have RubyMine (and the ruby plugin in intellij which is the same thing). The code base is still in 2.5 or 2.6. But I hope to bring it to 3.0 slowly the get typing. I'm used to typed languages and I would really miss that. Why would I have different debuggers available? Can't I just choose the one I want locally?
- rubyist5eva 5y agoDifferent code bases and teams usually just end up with a bespoke debugger, there are multiple available. There’s the default debugger, byebug, pry debug and I believe Rubymine uses one called debase, under the hood. You can use whichever you want but usually one will be specified in your project Gemfile because someone on the team likes that particular debugger and added it long ago.
- andrei_says_ 5y agoWatch Sandi Metz’ talks and consider her books. Also Russ Olsen’s books.
- ta988 5y agoI have a few books already but none of those two. Thanks! I'll get that.
- rubyist5eva 5y agoPractical Object Oriented Programming in Ruby is the definitive Sandi Metz book :)