Answer the question
In order to leave comments, you need to log in
Should I read books on algorithms when learning Ruby?
Hello everyone, I've been learning Ruby for about a month now, I really like this language. I would like to ask this question. Do I need to read books on algorithms for Ruby / RoR, so that in the future it will be easier to solve various problems. If so, what books would you recommend? Thank you.
Answer the question
In order to leave comments, you need to log in
basania : If there is an opportunity to study algorithms, then yes, it should be done! It doesn't matter what language. Python, C, Ruby. Doesn't matter! The ability to design, evaluate algorithms is very useful and does not depend on the language.
BUT! We programmers need to solve problems and very often they shout in our ears "What are you doing? Let's do it." In principle, everything is correct. When we pick up a smartphone, we don’t think what kind of design pattern or sorting algorithm or what else is used to implement “send an SMS”. So the user of our code also does not care what O-big in the implementation of what he uses)
Therefore: know how to solve the problem? If your current level does not allow you to solve problems quickly enough and meet the deadline, then study frameworks, the standard library, idioms, anything: JUST TO SOLVE THE PROBLEM. And only after improving this skill, think in the direction of improving quality.
Preferably. Even in order to use a ready-made implementation of an algorithm, you need to know about its existence and applicability conditions.
First, algorithmization is more of a mathematical discipline. So the language binding itself is not important for understanding how algorithms work and algorithmic complexity. The language will be important at the implementation stage, so as not to write everything crookedly and slowly.
Secondly, it just so happened that Ruby is used mainly with rails, i.e. for web development, where knowledge of classical algorithms is not particularly relevant. I'm not afraid to say that, probably, Rails developers do not use this set of knowledge even once a year.
Personally, I think that any developer should know how a computer, OS works, be able to evaluate the complexity of an algorithm, etc. At least at a basic level. Those. general IT culture, so to speak. But alas, a different approach is now in vogue, and many programmers are simply users of frameworks. Not for the sake of holivar, just my opinion.
If you want to learn algorithms, read Cormen. Don't like math too much? Then Sedgwick (there are books with examples in Java and C ++, as well as video courses on the Internet). On ruby, I advise you to read a book (it is not on algorithms): Ruby under a microscope.
Нет, не стоит. Все типичные алгоритмы уже реализованы до тебя и лучше тебя, можно просто взять нужный гем (хотя что-то я не вспомню ни одного гема, реализующего какой-либо алгоритм...). Лучше почитать по ООП и дизайн-паттернам.
Обязательно к прочтению: Sandi Metz "Practical Object-Oriented Design in Ruby". И всё её выступления на конференциях также обязательны к просмотру.
Ну а вообще стоит читать всё подряд, всё, что хоть как-то цепляет, интересует. А ещё лучше сначала много-много писать кода (говнокода), потом читать книги, а потом переписывать свой говнокод и писать хороший код.
Заходи в Hexlet. У них там и руби и алгоритмы и программирование вообще.
Несмотря на то, что все необходимые алгоритмы в Ruby уже реализованы в разных гемах, знание алгоритмов нужно для понимания процесса выполнения задачи, а также развития собственного логического мышления.
Базовое знание может дать хорошая книга Т. Кормена - Алгоритмы: Вводный курс.
Если хочется алгоритмы освоить побыстрее - вот хороший ресурс, где все изложено быстро и понятно.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question