RUBYC 2017 — HOW IT WAS
RubyC is a major Ukrainian conference devoted to Ruby, Rails and related technologies. It gathers hundreds of Ruby enthusiasts from Ukraine, Poland, Germany, Bulgaria, France and many other countries over the world to discuss the latest news and spend a beautiful summer weekend in Kyiv.
The conference took place in Kiev on the 3-4th of June. Two days of good atmosphere and interesting people. From year to year, it becomes more organized and more interesting.
Let’s talk about the speakers! There were 14 awesome topics and I will tell you about the most interesting ones.
Piotr Szotkovski: “Ruby Smells”
Piotr Szotkovski is a co-maintainer of Reek (code smell detector for Ruby), and this talk was about code style issues that it detects, such as Control Couple, Large Class, Duplicate Method Call, Repeated Conditional, Data Clump, Simulated Polymorphism, Too Many Statements, Uncommunicative Name, Unused Parameters and solutions of this issues. The speaker has a good quotes arsenal for every code smell issue:
Debugging is like being the detective in a crime movie where you are also the murderer. (@fortes)
OH: NP stands for “Naming Problem” – “NP-Hard” means a problem is as hard as naming things, which is the hardest problem we know of. (@nelhage)
I have a new metric for code quality: how much you feel the need to apologize for things when introducing a new team member to your codebase. (@codeflows)
In the end, there are steps in the mastery of a programming skill:
- Can I do this?
- Can I do this more easily?
- Can I do this more elegantly?
- Can I not do this?
Xavier Noria: “Little Snippets”
Xavier is a member of the Ruby on Rails core team. He was talking about concepts such as idiomatic Ruby, concise code, readable code, and exact code. A very strong idea of his speech is that
“Explaining why we prefer something” is different from “Proving something is the best choice”.
Almost all your code is based on your experience, preferences, furthermore, for a different language, there are different idioms and social conventions. So, when you try to correct someone’s code, you should prove that, but even though there are could be reasons why that code could be more convenient for someone else.
One of the rules is that “you have to think less” when you rereading your code. Here is a good example:
return id unless !name.blank?
As the speaker said: “There is something in this ‘less’ that makes me think more”. Try to keep your code simple to read:
return id if name.blank?
Bozhidar Batsov: “Ruby 4.0: To Infinity and Beyond”
Ruby 4.0, really??? But Ruby 3.0 will be in the next 2–7 years. So, what we are talking about? This talk was about features that should be improved to make Ruby much better language than now. Performance and threads are the main problems, but there are a lot of small features.
Did you know that WEBrick is a part of Ruby Standard Library? Do you really need it as a part of the language? Do you know what all this stuff for %Q, %q, %W, %w, %x, %i, %r, %s? This and other parts are very old and wasn’t changed from the beginning. Also, is it really important when somebody uses double quotes?
However, all we know the problem that has occurred with python 2 and python 3, and Ruby will never go like this: it will not change dramatically and will try to have backward compatibility. So, the conclusion is very simple — pick a language that is the best for your problem, but don’t try to adapt the problem to the language.
Marat Kamenschikov: “Learning Elixir: gotchas and pitfalls”
Elixir is becoming more and more popular and more and more Ruby programmers are migrating to it. It has some benefits that make it so good: 100% uptime, multithreading from scratch and Phoenix — Rails-like framework. In this talk, the speaker showed how to combine Ruby and Elixir and create simple Elixir-base Ruby web server. The main idea was to use Elixir to get requests and send responses and use Ruby to process the data.
Serdar Dogruyol: “Crystal and Kemal: Simply Fast”
Serdar Dogruyol is a maintainer of Kemal — web framework for Crystal. So what is Crystal? There is one sentence that explains everything: “Fast as C, slick as Ruby”.Crystal is super fast programming compiled language that has Ruby-like syntax. Is it really possible? — Yes! Furthermore, some simple code could be run on both Ruby and Crystal. Here are some examples:
class Foo def bar p baz(4, 2) #=> 2 end def baz(x, y) x - y end end Foo.new.bar
"Hello World".each_char do |char| print char end print "\n"
If you want to see many hipsters in one place — you should certainly attend this event! If you have any ideas how to create something cool — it’s a right place to share them with others. Ruby’s community is very big and strong and Ruby has a very promising future. All depends on the community, and every part is very significant.
There were much more interesting talks that are noteworthy: how to optimize SQL queries, how to integrate React to Rails project, how to create and maintain open-source project and more. You could check the information about these talks and speakers or watch the videos from the previous years on the RubyC website.