Talks

This Old App

What could renovating an old house have in common with upgrading an old app? *Everything!* Let me show you how this old house renovation project proceeds, from planning to scheduling, demolition to finishing, and how every stage directly relates the lessons learned from app upgrades over the course of my career.

RubyConf 2022

00:00:00.000 ready for takeoff
00:00:17.100 let's get started this old app my name is Lori Olson you can find me on
00:00:24.539 social media just about anywhere with the tag Windex Lori or wndx Lori I'm
00:00:31.980 from Lethbridge Alberta Canada my husband Trevor is down in the
00:00:37.200 audience and I am a dog mom of two cute little dogs scooter and Casey
00:00:43.379 I also am a developer trainer and mentor of over 35 years
00:00:50.219 and more recently the founder of the Windex School of mobile apps where I
00:00:55.739 teach about Ruby motion and dragon Ruby and I'm the creator of six pack apps my
00:01:02.640 program where I teach people how to go from app idea to successfully launched
00:01:08.700 app so warning um this is stories from my 35 year career and Ruby
00:01:19.020 didn't exist 35 years ago so there will be some non-ruby content
00:01:24.840 So This Old House or away no no we were going to do this
00:01:31.680 old app um well actually
00:01:37.020 this is the question that I was exploring old houses and old apps
00:01:44.820 we started a house renovation this year and it occurred to me that old houses
00:01:52.619 and old apps actually have quite a lot in common
00:01:59.159 so when you're talking about upgrading an app or renovating a house
00:02:07.799 there are so many commonalities so we'll start at the beginning this is
00:02:14.700 our house it's a four level split it was built in 1955.
00:02:20.400 uh we purchased it in 2014 from the original owners so they'd owned it for
00:02:27.239 59 years and as you can imagine it needed quite a few updates
00:02:34.500 now when you talk about house renovations or app upgrades
00:02:40.620 actually follow the same sort of pattern where you need to do a lot of planning
00:02:46.099 you need to schedule what's going to happen and then there's demolition or
00:02:52.200 you know ripping out of your app uh construction building all the fun new
00:02:58.620 stuff into your app and then of course there's all the finishing details
00:03:05.160 but what makes the journey really interesting is all the challenges that
00:03:10.920 you face along the way so let's start talking about some of
00:03:16.560 those challenges so our ceiling now ceilings are fun especially when you
00:03:23.459 have things like skylights and we have three of them in our house and we've had
00:03:30.540 some fun experiences with leaks and in fact there was a whole lot of
00:03:38.220 scary up in that ceiling when we decided we were going to take it down
00:03:44.340 one of the first things we learned was that this roof of ours was stick built
00:03:50.700 and not trust built so if you're unfamiliar with roof framing truss belt is like engineered structured they build
00:03:59.040 these trusses off-site and bring them in and they're all very even and you know
00:04:05.220 straightforward stick belt though that's all built on site custom on the Fly and
00:04:12.239 it's very sort of higgledy-piggledy which really explains some of the weird around our skylines
00:04:21.120 and then wasps and you're like okay what does wasps have to do with ceilings wow
00:04:26.880 so one day we came home and in this window right here we found like 50 wasps
00:04:34.320 and that was rather terrifying especially since we have two small dogs
00:04:39.600 so we hired an exterminator and he came and crawled around on the roof and he
00:04:45.720 was like I don't know there's this hole over here maybe that's where they're getting in and he injected some
00:04:50.759 insecticide and we cleared up the Wasps inside and now we only get an occasional
00:04:57.540 wasp coming in who's very slow and probably crawled through the insecticide
00:05:03.780 okay but when we took down the ceiling they found four wasp nests up in the
00:05:11.520 ceiling and yeah they weren't happy and neither were we
00:05:16.979 so of course I'm sure you can't possibly think of an analogy when you're doing app upgrades and finding stuff under the
00:05:25.080 covers when you start ripping things apart which reminds me of my gas back project
00:05:31.380 this is very early in my career gas pack stands for gas plant product accounting
00:05:37.979 yes I worked in the oil patch for quite a number of years and when we were doing our upgrade slash
00:05:46.259 rewrite we started experiencing a lot of random crashes in gas pack
00:05:52.860 now this is a code smell and it is often the smell of a memory stomp in your
00:06:01.199 application so yes I ended up having to go on a bug hunt
00:06:07.380 and I'm sure some of you who are familiar with uh old C applications
00:06:13.139 which is what this was things oh well there's there's like tools for that but
00:06:19.080 this was cutting edge when I did this app Borland C plus plus and object
00:06:26.160 Windows Library and no there were not cool tools for hunting memory stones
00:06:33.360 so let me just jump to the end of the story momentarily and say what we
00:06:39.000 actually had was an off by one air in the combo box control of the object
00:06:45.419 Windows Library when you said hey I'm going to put a string in here that is eight characters
00:06:52.919 long they only allocated eight characters which if you're
00:06:59.580 familiar with C again is wrong you need nine characters because you need space
00:07:04.800 for that null Terminator on your string so how did we actually find this well we
00:07:13.199 ended up debugging assembly code because the memory manager was written
00:07:19.440 in assembly code and I'm sure you're kind of thinking now
00:07:25.199 wait if it was like an off by one error like why was it hard to find why was it
00:07:30.539 random Why didn't it just happen all the time when you use the con combo box
00:07:36.720 well turns out when you dig into the assembly code of the memory manager that
00:07:42.860 they allocated memory in four byte chunks so if you were allocating memory for say
00:07:51.840 a seven character string you got eight bytes
00:07:57.360 and you wouldn't have a memory stomp because there was that extra bite at the end but I was allocating strings of
00:08:06.060 eight characters exactly in one spot in my app
00:08:11.220 and so randomly when uh that was hit the app would crash
00:08:19.139 okay let's move on to our next challenge
00:08:24.740 flooring in our house so you always have this Choice all right
00:08:30.599 when you have Hardwood are you going to refinish it or replace it now obviously this is beautiful
00:08:38.159 hardwood floor and it was original and we wanted to save it in fact we saved the old stuff
00:08:44.399 from a previous renovation renovation on the Upper Floor so that we could piece in
00:08:52.500 um hardwood to replace the kitchen linoleum
00:08:58.260 and our general contractor started hiring a four contractor and he actually
00:09:04.140 went through four different contractors because they quit and they priced themselves out of the
00:09:11.940 job and they outright refused to even quote on the job
00:09:17.760 and I had to ask myself why why were these people basically refusing and
00:09:25.560 avoiding this job so when he brought the fifth contractor in I was like I want to
00:09:31.140 be there I want to ask these people questions what is it
00:09:36.899 and it turns out that this was a really freaking difficult job because these
00:09:43.800 floors were so old we had old slat underneath the hardwood and piecing
00:09:52.500 old hardwood in trying to even it up and make it actually a job you can be proud
00:09:59.399 of that was going to be an excessive amount of Labor and would cost an excessive
00:10:07.019 amount of money so in the end we actually ended up ripping out that gorgeous old hardwood
00:10:15.180 and replacing it with new but I think you'll agree the new stuff looks awesome
00:10:20.519 too so that reminded me of the NGL now
00:10:26.640 project that I worked on the Natural Gas Liquids inventory system
00:10:32.339 these folks had to do an upgrade they had to do an upgrade for three years and
00:10:40.200 they failed and they spent a lot of Blood Sweat and
00:10:45.600 developed her tears on this and they still failed to do their upgrades for
00:10:51.180 three years and then they hired me a supposed Java expert yep it was a young
00:10:57.839 project and they wanted to go by this time three years later they had to go from weblogic
00:11:05.640 5.1 all the way up to weblogic eight so this was a fairly significant jump
00:11:13.380 so I started looking at what could the problems be well the first problem was
00:11:19.260 licensing now having been an experienced weblogic developer I knew that weblogic 5.1 had a
00:11:28.019 cool little bike it was a cool little bug where you could run a production instance using a developer license
00:11:36.120 for free yeah so yes actually that was what they did
00:11:42.060 they did have an official license they weren't using it but when they went to
00:11:47.339 upgrade they could not upgrade because the licensing was always standing in the
00:11:53.940 way I figured this out for them I got them their new license and we got past this
00:12:05.700 there were five or six different XML libraries involved in this project
00:12:11.339 all of them three plus years out of date and well I don't know if you're familiar
00:12:18.779 with XML development back in the early 2000s but
00:12:24.720 the library developers were deprecation happy and semantic versioning what's
00:12:29.940 that um they were basically oh let's deprecate this API and in the next Point
00:12:36.300 release let's remove it and then the next Point release let's remove that or let's deprecate that thing we just added
00:12:43.139 and the next Point release let's let's remove that it was a nightmare and again the people
00:12:49.880 in our project had difficulties I however knew that this was just really
00:12:56.399 hard work so I downloaded all the source tarballs I rebuilt all of the Java Docs
00:13:04.440 I read through everything to find the
00:13:10.399 deprecations and The Replacements for the things being deprecated and
00:13:15.720 basically moved each Library along one point release at a time until we got to
00:13:22.440 the future okay so that was
00:13:28.380 very difficult however we got to the end we upgraded the app everybody was happy
00:13:34.860 and the development team was educated in a process going forward so that they
00:13:40.980 could keep their app upgraded see I got one of my dogs in here
00:13:46.560 so it does pay actually to higher experience when you're having problems
00:13:53.579 next challenge our fireplace now why with this beautiful fireplace
00:13:59.880 that we actually you know was a significant reason why we bought this house
00:14:05.399 why would this be a problem well we didn't love the bulky over-engineered
00:14:12.959 extras like a half wall and a squat ugly closet made out of brick that was
00:14:20.040 attached to the fireplace not only that but in front of the
00:14:25.200 fireplace was a conversation pit and I
00:14:30.300 used the term loosely because this is what a conversation pit is supposed to
00:14:36.779 look like this is a mid-century sort of styling and you're supposed to have
00:14:42.000 stairs down and you're supposed to have comfy seating and it's supposed to be kind of spacious this was not spacious
00:14:49.920 there was a huge drop down there were no stairs we just oh it was horrible we didn't
00:14:56.639 like it and then raccoons where did raccoons come in yes we had raccoons living in
00:15:04.620 the chimney this actually is a real picture of uh
00:15:10.260 Mama raccoon trapped in the live trap and the two baby raccoons trying to
00:15:15.540 figure out how to get her out we did eventually trap all of the raccoons and get them relocated out of
00:15:22.860 the city only to have a new family move in
00:15:27.959 okay so during our uh renovation
00:15:34.320 I'm not sure if you can see it here but there's like water stains on our brick
00:15:39.779 and at this stage of the renovation our contractor leaned up against the fireplace looked up and said
00:15:47.220 hey I can see daylight and I was like of course you can see daylight I've been telling people this
00:15:53.820 is where the leak is yes that is where the leak was so we've got that fixed
00:16:00.300 and we're at an almost done stage here the fireplace looks actually pretty
00:16:05.820 beautiful we now have a natural gas insert the chimney has been capped off
00:16:11.220 no more raccoons and of course we filled in the
00:16:16.740 conversation pit so this reminded me of the perfectly
00:16:21.959 clear project perfectly clear is a photo correction Library
00:16:27.360 and it is actually the photo correction library that you will find in most of
00:16:32.760 these photo printing kiosks out there um where you plug in your digital photos
00:16:39.600 and they do some sort of magic which is perfectly clear that makes your photo better
00:16:45.899 automatically um but the perfectly clear folks actually wanted to have a sort of direct
00:16:52.519 consumer version so they wanted to have a Photoshop plugin
00:16:58.079 and they hired a team and that team was building a Windows version of the plugin but they also
00:17:05.760 wanted a version for the Mac and that team didn't want to do it
00:17:12.120 so a friend of mine recommended me to do this work and I'm like
00:17:17.280 hey Mark you know I don't know Squad about Mac development right and he's like oh you're a good developer
00:17:24.179 I know you can do it Lori so I buckled down learned some stuff and of
00:17:31.500 course this was right when Apple decided they were going to switch out their carbon
00:17:37.500 API for the new coolness cocoa
00:17:42.539 of course Photoshop is written in carbon at this point and the Photoshop plugin libraries were
00:17:50.220 actually quite grotesque this is when I also discovered that the
00:17:55.620 windows guys knew they were grotesque and they were just building the windows plugin using
00:18:00.660 Windows apis this is why they didn't want to do the Mac version
00:18:06.600 so the perfectly clear guys also wanted to have a plug-in that would be reusable Beyond Photoshop
00:18:13.380 so thinking I didn't want to leave them saddled with a plug-in that was going to
00:18:18.960 be immediately obsolete I wrote the plugin using cocoa and
00:18:24.539 wrapped it in the plug-in carbon apis
00:18:30.059 cool I I was proud of that and then we started running into bugs so
00:18:35.580 at this point we had photos that would come in with 8-bit colors and photos that would come in with 16 bit colors
00:18:43.559 that 8-bit color stuff worked fabulously well 16-bit not so much
00:18:51.419 and when I hit this bug we had like one week left until the big
00:18:57.419 trade show where they were going to introduce this plugin this is also the point where they went
00:19:02.760 oh yeah the windows guys have been struggling with this bug for months
00:19:09.419 so but with this knowledge I was like okay well if it's in Windows and in Mac
00:19:15.480 this has to be something that photoshop is doing so I insisted that they actually
00:19:23.520 pay the money to get into the Photoshop Developers community and we got into the Photoshop
00:19:30.059 private forums where I discovered in an obscure Corner
00:19:35.340 in only one place this description why does my 16-bit plugin only see values
00:19:40.500 from 0 to 32 768. 15 bits and not 0 to 65 535 16 bits
00:19:53.280 that's because they only use 15 bits of the data from the colors
00:19:58.980 they're obviously screwing around doing something special with that extra bit
00:20:04.559 okay so I wrote a filter to translate our
00:20:10.080 16-bit colors into a 15-bit space and lo and behold the plug-in actually started
00:20:17.400 to work yay I wrote up a description of what I did for the windows guys they fixed
00:20:24.240 their version and lo and behold we managed to successfully get the plug-in in for the trade show yay
00:20:34.080 another challenge books and bookcases I mean maybe not everybody has this challenge
00:20:40.620 but we do we have lots of books so many books
00:20:47.520 lots and lots of bookshelves here's where we started to pull them all down
00:20:53.340 during our renovation and when you're doing this you need to have a certain amount of order and
00:21:00.240 structure to categorize your your books and number the boxes and you pack them
00:21:08.280 away in reverse so that when you're unpacking them you
00:21:13.500 get from the beginning which is kind of important we ended up with 55 boxes of books
00:21:20.940 stored in our garage which is fun now we actually calculated the number of
00:21:27.000 linear shelf feet that we needed for storing all our books which is important
00:21:33.720 when you're designing an entire new bookcase because we wanted to have enough space
00:21:39.900 and maybe some extra because yeah books they just multiply
00:21:45.900 so this is the first half of our new bookshelf and this is the second half of our new
00:21:51.659 bookshelf and in fact if you use the wide angle camera you can now see the
00:21:57.780 entire eastern wall of our house is one massive bookcase
00:22:03.900 and we love it so a little bit of planning and you too
00:22:09.659 can have beautiful things this reminded me of my very first rails
00:22:17.700 project each Reaver so each Reaver was a
00:22:24.299 rails app from a very early stage but it did grow to be a bmoth that
00:22:31.140 provided access to all of the oil and gas data in Canada
00:22:36.780 well data production land pipelines facilities environmental incidents all
00:22:42.600 of it someone else's data not ours in someone
00:22:48.600 else's Data Center not ours in Oracle
00:22:55.080 yeah so this was not entirely fun also not entirely fun
00:23:01.679 this data is stored in the ppdm data model the public petroleum data model
00:23:09.539 over 2600 tables created by hundreds of Industry experts
00:23:17.340 oil industry experts yes that means exactly what you people
00:23:22.860 laughing think it means it is a hot mess of a data model and dealing with it is SQL join help
00:23:31.740 and accessing data in a remote Data Center we had problems we had access problems
00:23:37.980 we had authentication problems we had internet latency problems we had
00:23:44.520 performance problems we had we take the database down for updates problems
00:23:53.340 So eventually we decided we were going to do an upgrade but it was actually
00:23:59.220 kind of a rewrite and we created well treatment just one simple app for one
00:24:05.760 subset of the data Wells created our own database
00:24:11.640 we used redis as our primary database
00:24:16.860 that may sound odd but it worked out really well and we've populated that database with
00:24:24.179 asynchronous jobs using sidekick and these jobs ran daily weekly and
00:24:30.659 monthly to update the data that was updated daily weekly and monthly from
00:24:36.179 our data source but we were no longer subject to this remote data center for
00:24:42.840 our application and all the reports that people wanted to generate sure they still had to
00:24:49.440 access that remote data store but we did it all again asynchronously with sidekick unlike the previous app where
00:24:57.120 everything was live against the remote database and we ended up with well Trevor which
00:25:04.440 was a fantastically performant app that
00:25:10.080 was easy to use Easy to navigate and we never had to worry about remote
00:25:16.799 access slow access or the database is down again yay
00:25:25.200 next challenge the walls okay walls are important in your house
00:25:31.740 and one of the decisions you have to make when you are renovating is are you
00:25:37.140 going to paint over all this all drywall or are you gonna rip it down and replace
00:25:42.659 it well we're also taking down walls
00:25:47.940 with our renovation and when you take down walls you end up having to do a lot of patching
00:25:55.320 so guess what 60 year old drywall and new drywall have different
00:26:02.580 thicknesses so we discovered this when we did a renovation on our upstairs four years
00:26:09.419 ago and we were doing the patching route and our drywallers hated us and so did
00:26:17.580 the painters because everything was uneven and didn't look good so this time
00:26:24.360 we ripped it all down because nobody wants to deal with all
00:26:30.480 the discontinuities and we replaced it all with new drywall which the drywallers actually kind of
00:26:37.919 loved and that was including on the ceiling
00:26:43.260 this reminded me of my own application wimby this is a ruby motion application
00:26:51.840 wimby stands for Wells in my backyard it has all of the abandoned oil and gas
00:26:59.039 wells in Canada in it and why does this app exist it's because
00:27:05.760 it's entirely possible for someone to have an abandoned oil and gas well in their backyard
00:27:14.100 anyway so this app has been around four years it was my first IOS app
00:27:19.740 and it just works I really like it because it just works but
00:27:26.940 last year I got this email from Apple about how my app was suddenly in
00:27:32.940 violation of the App Store guidelines yeah the new guidelines that they just
00:27:38.279 introduced that said you have to update your app every three years or we're gonna rip it out in a store
00:27:45.179 yeah so that's when um that also happened to occur right
00:27:51.960 when I was having some vision problems a macular hole and I couldn't actually
00:27:57.360 read my computer screen and so a month later I got the notice that my app had
00:28:02.700 been removed from the app store which was fairly crushing
00:28:07.980 but recently I finally you know put together some time to go back and I was
00:28:13.320 like hey I I'm gonna get with me back in the App Store but no no I wasn't going to get with me
00:28:20.340 back in the app store because it turns out when I was going to do a rebuild and
00:28:25.559 I was going to upgrade some of my gems my gem called teacup which was actually
00:28:31.860 90 of my user interface is no longer supported and in fact
00:28:38.220 highly not recommended to use so I have to rip out the entire UI of
00:28:45.779 wimby and replace it I actually didn't have time to do that before the conference because I got
00:28:51.240 covered I did intend to do it okay so we're moving into the end game
00:28:58.919 here so let's cover some please no in your renovation project please no one
00:29:04.559 asbestos you really don't want to have asbestos it's really scary
00:29:09.840 and we got our asbestos test and we came up negative so that was a huge relief but
00:29:17.520 when you have old things you got to check for stuff like this also like
00:29:22.799 aluminum wiring now aluminum wiring was installed between like 1965 and 1972.
00:29:31.980 so why was it used for only such a short period of time well that was about when
00:29:38.159 the insurance industry came up with these statistics that you your house was
00:29:44.880 55 times more likely to catch fire if you had aluminum wiring so we dodged
00:29:52.500 that one too there was a major renovation done on our house we found this building permit behind the drywall
00:30:00.559 that says 1971 but apparently they didn't do any electrical work so yay
00:30:08.880 but old rails Acts if any of you are dealing with old rails apps there's a
00:30:14.760 lot of scary stuff behind the covers because say let's go back and look at
00:30:20.820 each River again when was it created rails 0.13 was when we started
00:30:27.840 and back at that point we did roll your own authentication roll your own
00:30:34.159 authorization roll your own job cues
00:30:39.240 let's just take like one tiny slice out of this and see like what what
00:30:44.520 be a problem how about passwords I mean some people with early rails apps had
00:30:50.640 passwords that were saved in the clear in their databases and then they fixed them with password
00:30:57.720 saved with reversible encryption still also a bad idea there are still rails
00:31:03.480 apps out there like this and if you doubt me there's also rails
00:31:08.820 apps out there not too long ago that still have passwords showing up in log
00:31:15.179 files because all your rails actions are logged with their parameters
00:31:21.360 so really just because the app is old and works doesn't mean there isn't scary
00:31:26.880 underneath the covers okay I'm running over time so let's get to the Finish
00:31:33.720 and I'm sure you're going Lori now you're going to show us the pictures of the completed renovation
00:31:39.320 no I'm not so nothing ever goes according to plan our renovation was scheduled to be
00:31:46.620 completed on October 28th a month ago this is what it looked like on Sunday
00:31:52.860 before we left to come here this is my living room yeah I mean lots of it is done but
00:31:59.460 there's lots of it yet to go and as long as your app is in production
00:32:07.340 it's never finished so don't think you don't have to do some
00:32:13.200 upgrading okay now I'm really finished so if anybody is interested in mobile app
00:32:20.399 development or game development in Ruby come and check out the Windex school I
00:32:27.659 have free staff for Ruby motion and for Dragon Ruby there and of course you know