SlideShare a Scribd company logo
Legacy Apps
                @mlomnicki

   The essence of dealing with legacy apps

is to reduce the number of WTFs down to zero.
Legacy Apps
  Growing market.
There was an app...
Almost 3 years under development

2 teams. 1st from UK, 2nd from India
tests
there were some tests! (unit, controllers)

over 100 out of 220 fail
git log
  fixes - 163 times

   fix - 144 times

  search - 52 times

 changes - 40 times

final issues - 30 times
versions
Rails 2.3.5

ruby 1.8

no bundler
WTFs
(@club.secretary == current_member ||
 @club.secretary == current_member)
WTFs
<%= @payment.new_record? ? '' : '' %>
WTFs
if some_condition
else
  do_something
WTFs
Member.first(:conditions => ["member_id LIKE #{params[:id]}"])
WTFs
if @member.something == sth || @member.somethi
  ...
elsif other_long_conditions
  ...
else very_long_condition && looks_important
  ...
Logic
models

controllers

views

layouts

initializers (!)
Everything is awful
ruby code

JS

CSS

plugins used
Arkency took control
1. Understand the app
It is hard

From the beginning you have to dive into every detail
Bugs made by your predecessor become your bugs
2. Tests
BBQ

heavy

no factories or fixtures
3. Code
PORO + real unit tests

Good Rails code

Nothing fancy yet (no DCI, no usecases...)
4. Upgrade
It is all about plugins

Moved them to lib and simplify

Do you need them all?
Where is the fun?!
Removing code is fun
1799 files changed, 37303 insertions(+), 78770 deletions(-)
SPA migration is mega fun
 Realize the rails-way is legacy!

 It does not matter how old Rails you have
To fix or to rewrite?
None is correct!

SPA is the answer

Otherwise your app is still legacy...
Profits
Users - SPA enhances their experience

Devs - SPA is better architecture
Time
80% in frontend app

20% in Rails
Gameboxed Engine
It is the best thing since Rails

Put pressure on Andrzej to open-source it
Mobile app soon
Mobile is so easy now

Thank you SPA
Q&A

More Related Content

PDF
LF_APIStrat17_API Style Guide: The Lord of API Designs
PDF
API Testing: Answers to Your Top 3 Questions
PDF
4 Major Advantages of API Testing
PPTX
Evaluating and Testing Web APIs
PPTX
Super powered API testing
PDF
An Introduction To Automated API Testing
PDF
Schema plus
PDF
Ruby tricks2
LF_APIStrat17_API Style Guide: The Lord of API Designs
API Testing: Answers to Your Top 3 Questions
4 Major Advantages of API Testing
Evaluating and Testing Web APIs
Super powered API testing
An Introduction To Automated API Testing
Schema plus
Ruby tricks2

Similar to Having fun with legacy apps (20)

PDF
Working With Legacy Rails Apps - Ahmed Omran
PDF
Build and maintain large Ruby apps 0.0.1
PDF
Railswaycon 2009 - Summary
KEY
Keeping Rails on the Tracks
PDF
The Next Five Years of Rails
KEY
Rails traps
PPTX
Rails Engine Patterns
PDF
Building Large Web Applications That Are Easy to Maintain
KEY
Ruby on Rails survival guide of an aged Java developer
PPTX
The Rails Engine That Could - In Motion
PDF
Tackling Legacy Code November 2015
PDF
RubyOnRails-Cheatsheet-BlaineKendall
PDF
RubyOnRails-Cheatsheet-BlaineKendall
PDF
At&T Interactive: The Many Facets Of Ruby
ODP
Dealing With Legacy: The Real-World Experience
PDF
Forumwarz and RJS: A Love/Hate Affair
KEY
PDF
Klaxit - How to keep it clean, for years - Paris.RB 2020
PDF
From Rails legacy to DDD - Pivorak, Lviv
PDF
Rails is Easy*
Working With Legacy Rails Apps - Ahmed Omran
Build and maintain large Ruby apps 0.0.1
Railswaycon 2009 - Summary
Keeping Rails on the Tracks
The Next Five Years of Rails
Rails traps
Rails Engine Patterns
Building Large Web Applications That Are Easy to Maintain
Ruby on Rails survival guide of an aged Java developer
The Rails Engine That Could - In Motion
Tackling Legacy Code November 2015
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendall
At&T Interactive: The Many Facets Of Ruby
Dealing With Legacy: The Real-World Experience
Forumwarz and RJS: A Love/Hate Affair
Klaxit - How to keep it clean, for years - Paris.RB 2020
From Rails legacy to DDD - Pivorak, Lviv
Rails is Easy*
Ad

Recently uploaded (20)

PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Hindi spoken digit analysis for native and non-native speakers
PPT
What is a Computer? Input Devices /output devices
PDF
STKI Israel Market Study 2025 version august
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Unlock new opportunities with location data.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Getting started with AI Agents and Multi-Agent Systems
DOCX
search engine optimization ppt fir known well about this
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
1 - Historical Antecedents, Social Consideration.pdf
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Developing a website for English-speaking practice to English as a foreign la...
Hindi spoken digit analysis for native and non-native speakers
What is a Computer? Input Devices /output devices
STKI Israel Market Study 2025 version august
CloudStack 4.21: First Look Webinar slides
Assigned Numbers - 2025 - Bluetooth® Document
Module 1.ppt Iot fundamentals and Architecture
Enhancing emotion recognition model for a student engagement use case through...
Unlock new opportunities with location data.pdf
Getting Started with Data Integration: FME Form 101
A review of recent deep learning applications in wood surface defect identifi...
Getting started with AI Agents and Multi-Agent Systems
search engine optimization ppt fir known well about this
Taming the Chaos: How to Turn Unstructured Data into Decisions
Benefits of Physical activity for teenagers.pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Ad

Having fun with legacy apps