какое знание Ruby я должен иметь? [закрытый]

На данный момент (январь 2019 г.) нет возможности выполнять развертывание облачных функций, как вы описали. Доступна и доступна только последняя версия облачной функции, и вы не можете переключать трафик между версиями, как это было бы с App Engine. Обратите внимание, что уже есть открытый запрос , который включает это.

26
задан Community 23 May 2017 в 12:00
поделиться

6 ответов

This is sort of from the top of my head; I'm sure I am missing a lot. Besides the things mentioned here, understanding programming and object-oriented programming in particular is a must, of course.

A few important language features:

  • Realise that in Ruby, everything is an expression, and be able to apply that principle, even if you think it makes your code unreadable.
  • Closures are mentioned; I would also expect Rubyists to know the differences between blocks and procs (and lambdas) and know how to convert between them. Closure mastery is important to being able to write beautiful Ruby, in my opinion.
  • Operator overloading: know what happens when you define methods named [], []=, ==, +, <<, etc. on an object.
  • Be proficient with most instance methods of Array, Enumerable and Hash (even if you don't know the exact definition by heart). Your Ruby code will be so much more verbose if you don't use methods like collect, inject, join, zip, etc. where appropriate.
  • Thoroughly understand what Symbols are, and when you should use / avoid them.
  • Understand what metaclasses are, know the difference between class variables and class instance variables.
  • Know how object attributes work in Ruby, how you can define them with attr_accessor and friends, and how you can define them yourself.
  • Be able to use modules, both as mix-ins and as namespacing tool. You should also understand how to mix-in instance methods and class methods (or be able to figure out how you could do it).
  • Know the difference between raise/rescue and throw/catch, and be able to use both correctly.
  • Understand how metaprogramming works, and at least have a basic idea of all the methods that allow you to do metaprogramming (mostly hidden in the classes Module and Object).
  • Be able to use a Hash method argument as a substitute for named arguments (even if it's just because it's a common pattern).
  • Know how concurrency does and doesn't work in Ruby.
  • Continuations, even if they're rarely used.

Some vital tools:

  • Know and understand Ruby gems
  • and rake
  • and RDoc.
  • and YAML.

Some framework knowledge:

  • Basic knowledge of Rails would be useful. Even if it's only because the outside world sometimes doesn't seem to know the difference between Rails and Ruby.
  • Know there are other web frameworks than Rails: Merb, Sinatra, Camping, ...

Ultimately, keep in mind that the above is "just knowledge", and not skills. It's probably easy to pick up most of this if you're not familiar with it.

60
ответ дан 28 November 2019 в 06:07
поделиться

Я написал подробный блог о вопросах интервью с ruby ​​и rails, с которыми я столкнулся во время своих интервью.

http://anilpunjabi.tumblr.com/post/25948339235/ruby-and-rails-interview-questions-and-answers

Надеюсь, вы найдете их полезными !!!

2
ответ дан Anil 28 November 2019 в 06:07
поделиться

It sounds like you are looking for some general theory. I have not read any recently, but a book on the subject of Principles of Programming Languages might be helpful (look for one that discusses both object oriented and functional languages).

Also you may find illuminating to look into how Rails or Rake works (as opposed to how to use it). This may help you get a deeper understanding of what Ruby can do.

3
ответ дан 28 November 2019 в 06:07
поделиться

You could probably fill in any gaps in knowledge you have due to being a real programmer and not an academic by reading The Ruby Programming Language by the creator of Ruby, Yukihiro Matsumoto. It covers a lot of obscure details, such as the vagaries of multiple assignment in different kinds of lambdas, and is relatively new, covering new semantics in Ruby 1.9.

A boss of mine once told me that a long-term programmer that he knew and trusted once turned to him and asked, "I forget... how many bits are in a byte?" The moral of the story wasn't that this guy was an idiot--it was that it's sometimes possible to write a fair bit of competent code over a long term and miss out on things that seem to others as though they should be elementary.

15
ответ дан 28 November 2019 в 06:07
поделиться

замыкания являются ключевыми (знайте об их области видимости), собственные классы (или метаклассы, или как вы хотите их называть), миксины (и включают, и расширяют, и все глупые трюки, которые вы можете с ними делать) , и метапрограммирование - это специфические для Ruby вещи, которые приходят на ум. Стандартные методы объектно-ориентированного программирования и функционального программирования также были бы честной игрой.

7
ответ дан 28 November 2019 в 06:07
поделиться

В список @molf я бы добавил:

DSL - как их использовать и как их писать. Для этого может быть действительно полезно копаться во внутренностях rake и capistrano.

Rack - ключевое преимущество использования Ruby (по сравнению с Python, в частности) для создания веб-приложений. Понять, почему это преимущество, как оно работает и как обычно используется.

Передача сообщений и вызовы функций - еще одно ключевое преимущество Ruby перед чем-то вроде Java. Использование method_missing и то, как он делает возможными ActiveRecord и DSL.

9
ответ дан 28 November 2019 в 06:07
поделиться
Другие вопросы по тегам:

Похожие вопросы: