Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
http://rubykaigi.org/2015/presentations/prodis Most applications written in Ruby are great, but also exists evil code applying WOP techniques. There are many workarounds in several programming languages, but in Ruby, when it happens, the proportion is bigger. It's very easy to write Ruby code with collateral damage. You will see a collection of bad Ruby codes, with a description of how these codes affected negatively their applications and the solutions to fix and avoid them. Long classes, coupling, misapplication of OO, illegible code, tangled flows, naming issues and other things you can ever imagine are examples what you'll get.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
# The Worst Ruby Codes I've Seen in My Life In this presentation by Fernando Hamasaki de Amorim at RubyKaigi 2015, the focus is on identifying and analyzing poor Ruby code practices, particularly those stemming from WOP (Workaround-Oriented Programming). While Ruby is generally celebrated for its clarity and elegance, Hamasaki points out that the misuse of workarounds can lead to significant code issues and complexity. ## Key Points Discussed: - **Definition of WOP:** WOP refers to the use of workarounds and patches in coding, often arising from advanced problems in software development. - **Experienced Programmers at Fault:** The examples presented are drawn from the work of seasoned developers, illustrating that even those with experience can create problematic code. - **Example of Poor Code - Credit Card Masking:** A method to mask credit card numbers is criticized for its complex implementation, as it modifies the original variable instead of simply returning the masked version. This can lead to unintended consequences in other parts of the application. - **Rails Controller Flow:** A Rails controller's action for domain creation is highlighted for its convoluted logic. The presentation suggests simplifying the flow to prioritize readability by discarding complex error handling paths. - **Confusing Class Design:** A poorly constructed Ruby class is discussed, particularly its constructor which requires certain keys in a hash. Hamasaki recommends using the fetch method for clearer error handling and improved design, advocating for clearer definitions of class methods to avoid confusion. - **Naming Conventions:** Misleading method names are critiqued, exemplifying how expectations may not align with actual functionality, resulting in potential misuse of methods. ## Conclusions and Takeaways: Hamasaki emphasizes the importance of clarity in Ruby programming. Good practices should include avoiding WOP, utilizing clear naming conventions, and establishing design structures that promote straightforward logic flows. By learning from examples of bad code, developers can improve their craft and create cleaner, more maintainable applications.
Suggest modifications
Cancel