Matt Moll Profile picture
Jul 21, 2020 11 tweets 3 min read Read on X
A tale about refactoring code and a young boy that learned his lesson the hard way...

Big story 🧵 THREAD 🧵

#100DaysOfCode #Refactor #Lessons
Once there was a joyful jr developer full of dreams and excitement about his first deploy to production.
It was Friday in the afternoon just as he was about to close his last task of the week.
He moved the story to done and when he was about to close the IDE he saw a hidden class inside a folder from some old legacy code with the legend:
// DO NOT TOUCH. This works and it´s necessary.

"This comment is not right!" thought the young Matt..heous, mattheous right.
"I think I can make this better," said to himself as he finished his coffee and prepared his fast fingers to type the best clean code ever seen by humankind.
He started simple, partitioning a 150 lines method into a couple of them, removed unnecessary ifs, added some validations, and created an object to revamp a nasty long signature.
That was when he remembered he has seen that awful list of parameters somewhere else in his codebase, "Right!" Said the enthusiastic dev as he recalls where he has seen the ugly code. It was on the main external interface VB dll that was used to expose data to consumers.
This will be a great abstraction he thought, and ran to apply it on the dll too...
Satisfied with his piece of art and proud of his great refactor the young Mattheous compiled everything and went ahead to deploy before leaving for the week.
This is not a happy ending story as you can imagine since the refactors made by the young dev broke several interfaces with external consumers and when all the systems broke down on Saturday everyone was running to get this fixed.
The version had to be rollbacked and the beautiful piece
of art Mattheous did on friday had to be torn down. The more experienced dev of the team went ahead and recovered the good old code that to this day stills reads the text: DO NOT TOUCH. This works and it´s necessary...
Hope you like this weird kind of format, I know it´s not usual but I thought I would give it a shot.

Jokes and storytelling aside, lessons for you about refactoring code:
1) Never refactor just because you think is a good idea.
2) Think ahead when you tackle a big refactor.
3) Scope refactors to avoid ending up modifying half of your system and dependencies.
4) Never mix new features with refactors in the same task ( if something fails you won´t be sure which is the root cause).

Thanks for reading :)! Have a nice day!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Matt Moll

Matt Moll Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @MattCodeJourney

Nov 5, 2020
Agile this, agile that, everyone uses agile and few teams develop "agile-y".

If you are preparing for an interview you need to know a couple things about Software Development Methodologies!

This is the tenth and last thread of the series: Interview Preparation!

🧵THREAD🧵
First, let's get some facts & definitions down.

A Methodology is the systematic study of methods applied to a discipline.

Software engineering is the practice of using selected process techniques to improve the quality and results of a software development effort.

⬇️
There is 1 more, it is important, bare with me.

Software Development Methodology is the collection of policies, processes, and procedures used by a dev team or org to practice software engineering

So basically, methods and rules to develop software in an engineering manner

⬇️
Read 12 tweets
Oct 9, 2020
If you are tired of breaking environments or you keep hearing about DevOps but have no idea what that is...
Then this thread is for you!

Let's talk about CI/CD!

This is the ninth thread of the series: Interview Preparation!

🧵THREAD🧵
First, let's get some definitions down.

CI = Continuous Integration
CD = Continuous Delivery / Continuos Deployment
DevOps = Combination of practices of Software Development (Dev) and IT Operations (Ops)

Let's tackle these concepts and it¿s tools and practices

⬇️
CI/CD is a set of principles and practices to deliver code changes more frequently and reliably

It is one of the best practices for both DevOps teams and agile methodologies, as it goes hand in hand with their objectives:
- Focus on business value
- Code quality
- Automation

⬇️
Read 11 tweets
Oct 8, 2020
Most of the systems you will build in your life will need some form of persistence.
That is why when preparing for an interview you should be ready to talk about Databases

This is the eighth thread of the series: Interview Preparation!

🧵THREAD🧵
First, let's get some definitions down.

A Database is an organized collection of data.

A Database Management System (DBMS) is a software for users to define, create, maintain & control access to the DB.

You will also need a language to program and design your DB objects.

⬇️
There are very different types of Databases & also a lot of possible classifications.
I would say the most useful one is:

- SQL
- NoSQL

We are going to focus only on SQL Databases in this thread.

You can read MANY more classifications here:
en.wikipedia.org/wiki/Database#…

⬇️
Read 14 tweets
Sep 27, 2020
For sure the most frightening part of any interview is the: ALGORITHM EXERCISE!

This is the fifth thread of the series: Interview Preparation!

if(self.wantToPassInterview){
self.readThread();
self.likeTweet();
}

⬇️
Not every company evaluates this the same way.

If you are thinking about FAANG companies or similar this is probably the most important topic. Otherwise, this is still a big topic to cover but don't neglect the others

We will cover a roadmap for Algorithms & Data Structures

⬇️
First let's talk about some easy problems that are widely used in interviews, make sure to be able to solve them.

Read each of them and think of the solution now...

If you can't figure them, search on youtube, there are plenty of videos explaining and solving them.

⬇️
Read 13 tweets
Sep 26, 2020
If I had to recommend you to learn 1 topic for any FullStack Web Developer role it would be: Javascript

This is the fourth thread in the Interview Preparation series.

new Promise(youWillLearnSomething)
.then(leaveALike)
.then(commentBelow)
First things first, javascript can't be fully explained in a thread. I will give you pointers and common questions and some advice

Please take the time to learn and practice JS
Some resources:
freecodecamp.org/learn/javascri…
theodinproject.com/courses/javasc…
Youtube has plenty of JS material

⬇️
Javascript is a programming language, the one native for web browsers, and one of the most used in the world.

It allows you to create a front end, back end (node), and even mobile with some magic in the middle. Let's go through the fundamentals that you should learn.

⬇️
Read 17 tweets
Sep 25, 2020
Now it's time to get into the specifics. Do you know how to build Front ends?

This is the 3rd Thread on the series of Interview Preparation

Let's get started!

🧵Thread 🧵 Image
A quick note here: This will focus on web devfront end (some things apply to mobile too), but keep in mind if the position is backend developer, desktop developer, or other fields some things might not apply.

This would be the standard front end check for FullStack Web devs.

👇
First of all, you have to understand:
* What is the Web
* Server-client relationship
* How in the end our web browsers can only process HTML, CSS, and Javascript.

You can read a little bit more here in a short article I did some time ago:
codejourneyclub.com/become-front-e…

👇
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(