"We Ran Out Of Columns" - The Worst Codebase Ever

ThePrimeTime
16 Aug 202423:29

Summary

TLDRThe video script narrates the speaker's experience with a chaotic yet fascinating codebase that started with a database column limitation, leading to creative solutions and humorous anecdotes. It touches on the culture shaped by databases, the quirks of legacy systems, and the ingenuity of developers who carved out their own efficiencies within a monolithic application. The story highlights the beauty in the mess, celebrating the direct impact developers had on improving user experiences, despite the lack of a coherent master plan.

Takeaways

  • 😲 The speaker expresses excitement over a story that begins with a database running out of columns, highlighting the unusual and challenging nature of the situation.
  • 🔢 The script discusses various database limitations, such as a hard limit of 32,000 columns per table in SQL Server and the concept of 'dynamic pivot' when needing more than 1,124 columns.
  • 💡 The speaker reminisces about their first software job, which was both a trial by fire and a memorable experience, despite the codebase being the worst and best they have ever encountered.
  • 🏢 The importance of the database in a company's culture is emphasized, with the database being described as a 'culture maker' and a central point where all code meets to operate the system.
  • 📈 The story illustrates the evolution of database design, from a table with 1,500 columns to using JSON storage in a column, reflecting the creative solutions developers come up with when faced with limitations.
  • 🚀 The speaker shares anecdotes about unique and sometimes absurd database practices, such as a table named 'sequence key' used for generating IDs before auto-incrementing was supported.
  • 📅 A humorous situation is described where a company's login system was dependent on a manually filled-out 'calendar' table, which if not updated, would prevent logins.
  • 👷‍♂️ The narrative includes tales of interns and developers creating one-off applications and workarounds, sometimes resulting in more complex issues or workarounds themselves.
  • 🛠️ The speaker reflects on the chaotic yet innovative nature of the codebase they worked with, which lacked a master plan but allowed for individual developers to create their own solutions.
  • 🌐 The script touches on the idea of open-sourcing old software for AI training, suggesting that real production code could be beneficial for AI learning.
  • 🛑 The story concludes with the speaker's appreciation for the 'beautiful mess' of the codebase, highlighting the positive aspects of working in a system without strict architectural constraints.

Q & A

  • What was the initial excitement about the story involving columns?

    -The excitement stemmed from the unexpected situation of running out of columns in the 'Merchants' table, which led to the creation of 'Merchants 2', sparking interest in the challenges and solutions related to database schema design.

  • What is the maximum column count allowed in SQL Server tables?

    -SQL Server has a hard limit of 1,024 columns per table, which is a significant constraint that developers need to consider when designing database schemas.

  • Why is it recommended to reconsider your approach if needing more than 1,124 columns in a dynamic pivot?

    -Needing more than 1,124 columns suggests that the data model might be overly complex or not normalized properly, indicating a potential need for a more efficient data structure or redesign.

  • What was the speaker's realization about professional programming compared to their early hobbyist programming?

    -The speaker realized that professional programming can involve working with poorly designed codebases and dealing with complex, real-world problems, which is quite different from the simpler, more controlled environment of hobbyist programming.

  • What was the cultural impact of the database in the speaker's first job?

    -The database became a 'culture maker', influencing how the entire company operated, with everything revolving around stored procedures and the database's constraints, shaping the company's workflow and practices.

  • What is the significance of the 'sequence key' table in the script?

    -The 'sequence key' table, with a single column and row, served as a simple yet effective method for generating unique IDs for new entities in the system, highlighting a clever workaround for the lack of auto-incrementing IDs in SQL Server.

  • Why did the speaker suggest that every piece of software over 10 years old should be open-sourced for AI training?

    -The speaker believes that real production code from older software could provide valuable insights and learning opportunities for AI systems, potentially improving their ability to understand and work with complex, real-world codebases.

  • What was the 'calendar' table's role in the system mentioned in the script?

    -The 'calendar' table was a manually filled-out database table that, when full, would prevent users from logging into the system, illustrating an unusual and potentially problematic dependency on a simple data table for system access control.

  • How did the speaker describe the experience of working in a codebase with no master plan?

    -The speaker found it liberating to work in a codebase without a master plan, allowing developers to create their own 'world of sanity' within the larger, chaotic system, and build new solutions without the burden of adhering to a rigid design.

  • What was Justin's approach to improving the merchant search page's performance?

    -Justin decoupled the page by making each box on the screen its own endpoint, loading everything asynchronously, which drastically reduced the page load time from minutes to seconds, demonstrating the power of a focused, independent approach to optimization.

Outlines

00:00

😅 Database Column Limit Excitement

The speaker expresses excitement over a story that begins with a database running out of columns. They discuss the maximum column limits in various database systems, such as Microsoft SQL Server, and humorously suggest that needing more than a certain number of columns is a sign to rethink one's approach. The narrative reflects on the speaker's early programming experiences and the stark contrast between amateur and professional codebases, highlighting the chaotic yet fascinating nature of legacy systems.

05:01

📚 Legacy Database Culture and ID Generation

This paragraph delves into the cultural impact of databases within a company, using the term 'Watering Hole' as a metaphor for where all code converges. The speaker shares anecdotes about a 'Merchants' table with over 1,500 columns and the creative workarounds used when the database ran out of columns, such as storing JSON in a column. They also touch on the use of sequence keys for ID generation in the absence of auto-incrementing features in SQL Server, and the resulting implicit joins across multiple tables.

10:04

😵‍💫 Bizarre Database Practices and Intern Stories

The speaker recounts peculiar database practices, such as manually filling out a 'calendar' table that dictates system accessibility and the daily dropping and repopulating of an 'employees' table. They express concern over the lack of automation in these processes and share a story about an intern who had to manually extend the calendar's range to prevent system lockouts. The narrative also touches on the idea of open-sourcing old software for AI training purposes.

15:05

🤯 Over-normalized Databases and Developer Autonomy

The paragraph discusses the concept of 'normalization syndrome' where databases have an excessive number of columns, leading to overly complex and atomic data structures. The speaker shares personal experiences with such databases and the tendency to create one-off applications for individual users, as exemplified by a developer named 'Gilfoil.' The narrative highlights the autonomy developers had in carving out their own areas of sanity within the monolithic app, leading to a decentralized yet functional development environment.

20:06

🛠️ Codebase Chaos and Creative Problem Solving

The speaker reminisces about a particularly chaotic codebase that lacked a master plan or architectural review, allowing developers to create their own mini-apps within the larger system. They describe the ingenuity of a developer named Justin who dramatically improved the performance of a slow merchant search page by refactoring it to load asynchronously. The narrative celebrates the beauty of a codebase that, despite its messiness, enabled developers to solve problems creatively and efficiently.

🌟 Embracing the Beauty in Chaotic Codebases

In the final paragraph, the speaker reflects on the positive aspects of working in a seemingly disorganized codebase, appreciating the lack of constraints and the direct connection with users. They express a sense of nostalgia for the fast feedback loops and the ability to build and iterate quickly without the burden of grand planning or consistency requirements. The speaker finds beauty in the autonomy and creativity that such an environment fosters, even in the face of what could be considered a 'worst-case' scenario in software development.

Mindmap

Keywords

💡Codebase

A codebase refers to the entire collection of source code for a software project. In the video, the codebase is described as both the 'best' and 'worst' the speaker has worked with, highlighting the complexity and legacy nature of the system, which is a central theme of the video.

💡Database Normalization

Database normalization is the process of organizing data to minimize redundancy and dependency. The script mentions 'properly normalized tables with all the foreign keys to Merchants,' illustrating the contrast between a well-structured database and the chaotic, large tables that the speaker found in their first job.

💡Stored Procedures

Stored procedures are a type of database object stored in the database that contains a series of SQL statements to perform a specific task. The script refers to a company culture built around stored procedures, indicating a reliance on this technology and its impact on the company's operations.

💡Dynamic Pivot

A dynamic pivot in the context of databases refers to a technique used to rotate rows into columns or vice versa. The video mentions a limit of 1,124 columns in a dynamic pivot, suggesting a point at which the complexity of the database operations becomes unwieldy.

💡Merchants Table

In the script, the 'Merchants' table is a central database table that stores customer information and has run out of columns, leading to the creation of 'Merchants too.' This highlights the challenges of managing large amounts of data in a single table and the creative solutions developers come up with.

💡JSON

JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write and for machines to parse and generate. The script mentions storing JSON in a database column as a workaround, which is a common practice but also a point of contention in the video.

💡Sequence Key

A sequence key in databases is typically used for generating unique IDs. The video describes a 'sequence key' table with a single column and row, which was used to generate IDs before auto-incrementing features were common, indicating a historical approach to database management.

💡Soap Services

SOAP (Simple Object Access Protocol) services are web services that use XML for messaging. The script mentions a dozen SOAP services alongside the main codebase, indicating the complexity and the integration of different technologies within the system.

💡Reflection

In programming, reflection is the ability of a program to examine or 'introspect' its own structure, particularly through the size, type, and properties of an object. The video describes using reflection to dynamically build a string structure based on the database, showcasing a creative but complex solution.

💡Justin's Improvement

Justin's Improvement refers to a specific instance in the video where a senior developer named Justin improved the performance of the merchant search page by decoupling elements and loading them asynchronously. This example illustrates the power of individual initiative in tackling systemic issues within a codebase.

💡Enterprise Design Pattern

Enterprise design patterns are reusable solutions to common software design problems that occur in large, complex, enterprise-level applications. The script contrasts the speaker's experiences with the 'Enterprise design pattern' and the more ad-hoc, direct approach taken in their first job, highlighting a preference for simplicity and direct feedback loops.

Highlights

Excitement over a database issue where they ran out of columns in the 'Merchants' table, leading to the creation of 'Merchants 2'.

Discussion on the maximum column count allowed in SQL Server, with a hard limit of 32,000 columns per table.

Advice to reconsider design choices if needing more than 1,224 columns in a dynamic pivot.

Reflections on the early days of programming and the evolution of professional software development.

Critique of the myth that modern startups use the greatest technologies and have well-structured codebases.

Experience from the first software job and the contrast between personal projects and professional codebases.

The 'Merchants' table's significance in the system, acting as a central data point with over 500 columns.

Innovative workarounds for database limitations, such as storing JSON in a column.

The 'sequence key' table, a minimalist design with a single key and value for generating IDs.

Challenges with a 'calendar' table that manually controlled system access, highlighting the importance of database design.

Humorous account of an intern's task to pre-fill the 'calendar' table for five years to prevent access issues.

Description of a legacy system where the database's design influenced the company's culture and operations.

The 'MacBook Under the Stairs' analogy, illustrating the neglect and potential risks of outdated or poorly managed systems.

The concept of 'database as a culture maker', emphasizing the central role of databases in shaping business processes.

Anecdote about a salesperson gaming the system by manipulating sales records, leading to accounting irregularities.

The story of 'Gilfoil', a legendary developer known for not checking in code and creating one-off applications.

Reflection on the beauty and chaos of a codebase without a master plan, allowing for creative problem-solving.

Justin's improvement of the merchant search page by breaking it into multiple end-point loads, significantly increasing performance.

Nostalgic appreciation for the direct connection with users and the simplicity of problem-solving in the early days of software development.

Transcripts

play00:00

I have never been more excited about a

play00:01

story that starts off with we ran out of

play00:04

columns this is just making me excited

play00:06

wow flashbang flashbang all right we ran

play00:08

out of columns the best worst code base

play00:11

on the merchants 2 table yeah we ran out

play00:14

of columns on Merchants so we made

play00:16

Merchants

play00:19

too oh my gosh what is the allowed a

play00:22

maximum column uh column count uh squeal

play00:26

light how about squeal light isn't it

play00:28

999 oh there's a hard limit of 32,000

play00:31

okay columns per table 1,600 oh yeah

play00:34

squeal server you're right you're right

play00:35

uh Microsoft SQL Server I forgot about

play00:38

this one okay they have the same thing

play00:39

if you need more than this in your

play00:40

Dynamic pivot time to get a second

play00:42

thought to what you're doing I love this

play00:44

if you need more than 1,24 columns in

play00:47

your Dynamic pivot it's time to give a

play00:50

second thought of what you're doing

play00:51

really you know I would probably put

play00:54

that number way lower okay we're talking

play00:57

about way way low lower than that it's

play01:01

that 2 to the 10 that things got out of

play01:02

control you're like really two to the 10

play01:05

that's the number that's crazy when I

play01:07

started programming as a kid I didn't

play01:08

know people were paid to program even as

play01:10

I graduated high school I assumed that

play01:12

the world of professional development

play01:14

looked quite different from the code I

play01:15

wrote in my spare time it's true it

play01:18

looks worse that's the big lie I think

play01:22

our industry has had for so long is that

play01:24

you take these companies and whether

play01:27

it's it used to be the fangs of old but

play01:29

it's now probably the startups of today

play01:31

uh all these startups using all the

play01:33

greatest Technologies all the hooking up

play01:35

to where everybody's just a cyber Mario

play01:37

that just simply puts pipes together and

play01:39

that's it even their codebases with

play01:42

almost no business logic are absolute

play01:44

dog water when I lucked my way into my

play01:46

first software job I quickly learned

play01:48

just how wrong and how right I had been

play01:50

my first job was a trial by fire to this

play01:52

day that code base Remains the worst and

play01:54

the best codebase I've ever had the

play01:56

pleasure of working in while the

play01:57

codebase will forever remain locked by

play02:00

proprietary walls of that particular

play02:01

company I hope I can share some of its

play02:03

most fun and scary stories I'm excited

play02:06

here okay we're excited here come on the

play02:09

database lives forever in a large Legacy

play02:11

system the database is more than a place

play02:13

to store data it is a culture maker it

play02:16

dude this is so true oh my gosh I never

play02:20

even thought about that but in my head I

play02:21

was thinking about my first job my first

play02:23

real job my first fully real real job in

play02:26

which everything was stored procedures

play02:29

and like we we we the entire company

play02:32

like morphed itself around this idea of

play02:34

stored procedures it became the the

play02:37

culture of the company the database sets

play02:39

the constraints for how the system as a

play02:41

whole operates it is the point where all

play02:43

code meets the the database is a water

play02:46

is the watering hole in our case The

play02:48

Watering Hole had quite a bit of

play02:50

pollution it always does man did you

play02:52

know that squeal server has a limit on

play02:54

the number of columns you can have in a

play02:56

table me neither at the time it was 10

play02:58

uh two to the 10 uh today it appears to

play03:01

be 2 to the 12 needless to say most

play03:03

people don't know this we did the reason

play03:05

Merchants our table store customer

play03:07

information ran out of columns a long

play03:09

time ago you know I've seen people get

play03:11

around some of this by just storing Json

play03:13

you know how many times you've seen Json

play03:15

just stored in a random column how is

play03:17

that legal Jason called it dude

play03:20

it's oh my gosh something about that

play03:23

just makes me emotionally painful then

play03:25

you know when it gets real bad when you

play03:27

see people using those like those fuzzy

play03:30

those fuzzy matches or redx matches on a

play03:33

wear statement to grab to like just look

play03:37

at the

play03:37

string that is Json not not we're not

play03:41

talking about postgres with the uh the

play03:42

Json good stuff we're talking about not

play03:45

postgres and and just getting it you

play03:47

know Jason B yeah it's called No squeal

play03:50

Jason B is legit though yeah I haven't I

play03:52

haven't tried any of those yeah columns

play03:54

like wears Food Dude yes yes this this

play03:56

is real this is real we column food dude

play04:00

I've seen this and this is awful it's

play04:02

2024 and if you're not using postgres

play04:04

you're either a bank or wrong well there

play04:06

is squeal light can we all agree squeal

play04:08

light is amazing I've never said

play04:10

anything bad about postgres but squeal

play04:12

light is also very very good hasht ad

play04:16

squeal light is is very very good squeal

play04:19

light is slow when people say that I

play04:21

don't think they know what they're

play04:22

saying there's an entire talk about how

play04:24

how not slow squeal light actually is

play04:26

sharper guy do you write JavaScript on

play04:28

the server lot of people people be

play04:30

complaining about speed yet I don't see

play04:32

them using C or Zig to write the world's

play04:35

most optimized code that's what I'm just

play04:37

say is you know you you can't be

play04:38

complaining about the difference between

play04:40

like two microseconds when you're out

play04:43

there using a garbage collector okay

play04:44

buddy okay

play04:46

buddy I like serverless it's like okay

play04:50

oh I'm really concerned about

play04:51

performance then

play04:53

anyways needless to say most people

play04:56

don't need to know this we did the

play04:57

reasons Merchant 2 blah blah blah

play04:58

Merchant merch mer 2 was the solution a

play05:01

table if I remember correctly with 500

play05:03

plus columns itself damn damn they had

play05:05

1,500 columns merchants and my best

play05:08

friend Merchants too were the lifeblood

play05:09

of the system everything made its way

play05:11

back to Merchants somehow or other but

play05:13

it wasn't as if Merchants was the solo

play05:15

or Duo table there was plenty of

play05:17

properly normalized table with all the

play05:18

foreign keys to Merchants but one will

play05:20

always hold a special place in my heart

play05:22

sequence

play05:24

key I can't wait for this sequence key

play05:27

that for ease of understanding I have

play05:29

recreated the whole sequence key table

play05:31

above yes you read that

play05:33

correctly this is the whole table a

play05:37

table with the single key and a single

play05:38

value if Simplicity is a virtue then one

play05:41

might declare sequence key to be the

play05:43

perfect table what could be simpler a

play05:47

constant one in which you don't have to

play05:49

look up you may be asking yourself what

play05:52

possible use case could you have for a

play05:54

table with one column in a row

play05:56

generating IDs now the story I heard at

play05:59

the time was the Once Upon a Time squeal

play06:01

server didn't support Auto incrementing

play06:03

IDs it was their primary key gener like

play06:05

I honestly my brain couldn't even

play06:07

conceive of this many DBS did like this

play06:10

is just too painful sequence key I just

play06:12

didn't want to believe it there's no way

play06:13

I was going to let myself believe that

play06:16

this was real I just I even as I read it

play06:18

I'm like n nope not going to do it it's

play06:20

not gonna be primary key not gonna be

play06:21

nope

play06:22

this was the accepted correct

play06:25

answer my search to figure out if this

play06:27

was true was inconclusive but in

play06:29

practice had served as much as much more

play06:32

than that sequence key was the glue in

play06:34

every stored procedure that created new

play06:36

entities you first grabbed a key from

play06:38

sequence key incremented it then insert

play06:41

that as your ID for n different tables

play06:43

you now had an implicit join between all

play06:46

those entry tables if you saw an ID in

play06:48

the system there was a good chance

play06:50

related tables would have a row with the

play06:52

exact same ID honestly kind of clever

play06:55

but isn't that just like database the

play06:56

calendar a database may live forever but

play06:58

our login system was limited by the

play07:00

calendar I this okay okay I don't mean

play07:03

an actual calendar I mean a database

play07:05

table called calendar what did it

play07:07

contain a manually filled out calendar

play07:09

when asking a resident Shaman who went

play07:11

by the name of munch he informed me that

play07:14

when the calendar runs out we can't log

play07:16

to uh log into the system I got to know

play07:18

why that is I got I just got to know I

play07:20

just got to know how that happened like

play07:22

how how did that happen this happened a

play07:24

few years ago so they had an intern fill

play07:26

out five more years to make sure that it

play07:27

didn't happen anytime soon what system

play07:30

used this calendar no one knew what also

play07:34

like couldn't the intern just write a

play07:35

for Loop of inserts like do you even

play07:37

have to man like now I'm concerned oh

play07:39

now you're concerned so let let me get

play07:41

this straight you weren't concerned when

play07:43

the things called we ran out of columns

play07:46

you were

play07:47

concerned when they had an intern that

play07:50

that that filled in five more years for

play07:52

logging in MacBook Under the Stairs

play07:54

again this is MacBook Under the Stairs

play07:56

except for Worse what's a for Loop you

play07:58

can for days nuts

play08:00

uh employees every morning at 7:15 the

play08:02

employees table was

play08:05

dropped you think layoffs are bad now

play08:08

you should saw layoffs back then okay

play08:10

this was this is the real one all the

play08:12

data completely gone then a CSV from an

play08:14

ADP was uploaded into the table during

play08:16

this time you couldn't log into the

play08:17

system sometimes this process failed

play08:19

this wasn't the end of the process the

play08:21

data needed to be replicated to

play08:22

headquarters so an email was sent to a

play08:24

man who every day would push a button to

play08:26

copy the data one would just think you'd

play08:28

have

play08:30

you would one would think this process

play08:33

only happened when there was a change in

play08:34

employment you know what you know what I

play08:37

think would be really great I think

play08:38

every company you know what hey since

play08:41

we're since we're we're talking about

play08:42

video games stop killing video games and

play08:44

all this you know what I think I think

play08:46

we need to have every single piece of

play08:48

software that's 10 years older or more

play08:50

to be open sourced and for the llms to

play08:52

train on okay I want real production

play08:55

code for all these llms to be trained on

play08:58

I think that's the only reasonable way

play09:00

to get things done because I don't see

play09:03

how I if co-pilot does not suggest this

play09:05

to me I'm going to be really really

play09:07

upset I think co-pilot should suggest

play09:11

the email once a day press the button to

play09:13

deploy the employees

play09:15

table every day okay and if this guy

play09:18

goes on vacation all hell's breaking

play09:20

loose okay that's what I want the

play09:22

replacement database you might be

play09:23

thinking to yourself couldn't someone

play09:24

clean up this database make it nice to

play09:27

nicer to work with dude no did not think

play09:30

that to myself cuz there's 1,24 columns

play09:32

in merchants and over 500 in Merchants

play09:35

too that's an imposs no one's cleaning

play09:37

up that code base ever for any reason

play09:39

ever forever ever ever ever okay well

play09:42

the company was way ahead of you there

play09:44

was a copy of the database data in this

play09:46

copy was about 10 minutes out of date

play09:48

syn only went one way but this database

play09:51

was normalized how normalized to go from

play09:53

Merchants to a phone number was seven

play09:54

joins Somebody went real Enterprise you

play09:57

know I you know the funny part is is I

play09:59

know everyone here is like damn how

play10:01

could they do that oh this is awful but

play10:04

I've done that you know there's this

play10:06

thing that happens where you first work

play10:10

in an environment in which you have

play10:12

exceeding amount of columns and so the

play10:15

answer is to make everything Atomic

play10:17

normalization syndrome yeah this happens

play10:20

this isn't somehow wild right why is

play10:22

this so relatable to me because this is

play10:24

everybody's mistake with databases and

play10:26

you know what if I were to start doing a

play10:27

bunch of database work again guess how

play10:29

many of these mistakes I would

play10:31

make I probably wouldn't get out to the

play10:34

maximum number of columns but I could

play10:35

easily see myself going I'm at like

play10:37

25 columns at this point maybe I maybe I

play10:40

need to rethink my maybe I need to

play10:41

rethink my stuff and then it keep go up

play10:43

to like 35 I'm like damn when you first

play10:46

move into a house it's shiny and new and

play10:48

then you do things and then you start

play10:49

doing things to it the sales number

play10:51

every salesperson had a quota they

play10:52

needed the meet every month called win

play10:54

oh is this Cloud wait is this a cloud

play10:57

flare like is this the are we about to

play10:59

meet the saf the sa the safety and Trust

play11:02

team commonly referred to as the sales

play11:03

team the tables that kept this data not

play11:06

the financial keepings but the sales

play11:07

specific way of accounting for this were

play11:09

incredibly complicated every day a job

play11:11

would figure out which rows had been

play11:13

added and updated and sync them with the

play11:15

system at headquarters if this wasn't

play11:18

really a problem until one salesperson

play11:20

figured out they could ask for those

play11:21

records to be manually changed this

play11:23

salesperson had already got their win

play11:25

and landed another big sale that month

play11:27

so they wanted it to be moved to next

play11:28

month oh my gosh what a genius the man

play11:31

is stacking sales oh this is so good

play11:36

imagine accounting for this like just

play11:38

just for a second this guy just effed up

play11:42

Accounting in a whole special beautiful

play11:44

way like so so beautiful you're

play11:47

receiving money but no sale has happened

play11:50

for a while oh oh this is so good this

play11:54

is so this is this is the perfect storm

play11:57

of of gaming the system and inter inter

play11:59

was tasked with doing so word got out

play12:01

and over the next 3 years requests would

play12:03

grow exponentially at one point we had

play12:04

three interns whose fulltime job was

play12:06

writing these squeal statements writing

play12:08

an application to do this was deemed too

play12:10

difficult before I left though I made

play12:11

sure to help those interns build their

play12:13

own no idea if it ever took off though

play12:15

IRS shambles deeply illegal accounting

play12:18

actually I know this is deeply illegal

play12:19

this is so good the code base what but

play12:22

what is a codebase without or a database

play12:24

without a code base and what a

play12:26

magnificent codebase it was when I

play12:28

joined everything was in team Foundation

play12:29

server oh I I've heard nothing but good

play12:31

things about team Foundation server you

play12:33

know I've never had the privilege of

play12:34

working in it myself but I've heard

play12:36

amazing stories that it's absolutely one

play12:39

of the best pieces of software out there

play12:42

ever if you aren't familiar this was

play12:44

Microsoft made centralized Source

play12:46

control system the main code base I

play12:48

worked in was half VB half C now that

play12:52

seems pretty normal I actually I I've

play12:54

worked in very similar ones it ran on

play12:56

IIs oh man I now that's actually the

play13:00

only server that I was not smart enough

play13:02

to understand sure I could raw dog TCP

play13:05

created my own video format was able to

play13:06

send uh I had a whole distributed graph

play13:09

Network to be able to send uh my own

play13:11

custom protocol through nodes that the

play13:13

for the government uh Hardware hopping

play13:15

and all that couldn't understand I I I

play13:18

it it literally was too it was too

play13:20

confusing couldn't do it literally could

play13:22

not do it we still use IIs bless your

play13:24

soul and use session state for

play13:26

everything oh this this actually seems

play13:28

like a good idea I would use session

play13:29

state for everything engine x a riot oh

play13:32

what did this mean in practice if you

play13:34

navigated to a page via P path a or path

play13:37

B you'd see very different things on

play13:38

that page but to describe this codebase

play13:40

as merely half VB and half C would do a

play13:43

disservice every JavaScript framework

play13:45

that existed at the time was checked

play13:46

into the repository typically with some

play13:48

custom changes the author believed

play13:50

needed to be made most notably knockout

play13:52

backbone and marionette but of course

play13:54

there was a smattering of jQuery and

play13:57

jQuery plugins m nothing like knockout

play14:00

backbone marionette Jacqui and some

play14:03

jQuery plugins how much do you want to

play14:04

bet date Pickers in there date picker by

play14:07

the CEO of frontend Masters Mark good

play14:10

guy Mark making date picker for

play14:11

everybody's life date picker was the

play14:13

single greatest library of all time okay

play14:16

don't don't even try to tell me that

play14:19

jquery's date picker wasn't

play14:20

revolutionary don't even try don't even

play14:22

try but this codebase didn't stand alone

play14:25

next to it were a dozen or so soap

play14:27

services and a hand full of native

play14:30

Windows applications most notable was

play14:32

the shipping manager Fable has an entire

play14:35

application was built in a weekend to

play14:36

buy a solo developer let's call him

play14:38

gilfoil gilfoil was by all accounts an

play14:40

incredibly fast programmer I never met

play14:42

him but I felt like I knew him not just

play14:45

through his code in the repos but also

play14:48

through all the code remaining on his

play14:49

hard

play14:50

drives wait what Gil foil's hard drives

play14:53

wait what Munch yes this was the name he

play14:56

really went by kept Gil foil's hard

play14:58

drives in in raid configuration on his

play15:00

desk years after Gil foil had left the

play15:02

company why because Gil foil was known

play15:04

for not checking in code not only that

play15:07

but for building a random one-off

play15:08

Windows application for a single user it

play15:10

wasn't uncommon to have a user come to

play15:12

us with a bug report for an application

play15:14

that only existed on Gil foil's hard

play15:16

drive I can NE I cannot say that this

play15:18

I've have ever experienced anything like

play15:20

this this is this is a peak of

play15:23

coding and athleticism I have I have

play15:27

never seen okay it's too good it's

play15:30

actually too good for me he's literally

play15:32

the goat okay bus Factor

play15:36

one deny refuse literally customers

play15:39

coming and be like hey I need to fix

play15:41

this bug on this application what

play15:43

application we've never heard of that

play15:46

well actually it turns out one of you

play15:47

guys wrote an application just for me

play15:50

most of my job was tracking down bugs

play15:52

that teams didn't want to dedicate work

play15:53

to one particularly nasty bug would pop

play15:55

up every once uh once every few months

play15:58

after we shipped things the shipping

play16:00

queue would have would have stuck orders

play16:02

in them that claimed to both be already

play16:04

shipped and not shipped I went through a

play16:06

series of workarounds a squeal script

play16:08

window applications Etc to try and get

play16:11

us out of the broken State I was advised

play16:13

not to try and track down the root cause

play16:15

but I couldn't help myself oh yeah oh

play16:17

yeah along the way I learned how Gil

play16:19

foil thought the shipping app pulled

play16:21

down the entire code base or the entire

play16:23

database and then filtered by date

play16:25

keeping all past orders the go uh oh

play16:29

keeping all orders past the go live date

play16:31

of the application the app relied on a

play16:33

soap service not to do any servy things

play16:36

no the service was pure function it was

play16:39

the client that did all the side effects

play16:41

in that client I discovered a massive

play16:42

class hierarchy 120 classes each with

play16:45

various methods inheritance going 10

play16:47

levels

play16:49

deep those are some rookie numbers okay

play16:52

10 levels that's all you got that's all

play16:54

you got Gil foil the only problem all

play16:57

the methods were empty I do not

play16:59

exaggerate here not mostly empty

play17:03

empty okay okay I like this I like this

play17:06

there's there's a thing here there's a

play17:07

thing here that one stumped me for a

play17:09

while eventually I learned this was in

play17:12

service of building a structure he could

play17:15

then use reflection on I oh my oh that's

play17:17

so beautiful that reflection would let

play17:19

him create a pipe delimited string whose

play17:22

structure was completely database driven

play17:23

but entirely static and he would send

play17:26

over a socket turns out this was all

play17:28

eventually sent to uh kellwell kiwi kill

play17:32

the service that talked to shipping

play17:34

carriers why did this bug happen

play17:36

kellwell used nine digigit long numbers

play17:38

every month someone had disabled the

play17:41

Cron job that deleted old

play17:43

orders you know there's something that's

play17:45

very beautiful about that I'm just going

play17:48

to be real here for a second this idea

play17:51

of using reflection to build up a string

play17:54

and every method was empty it's so

play17:58

chaotic it's beautiful it's lovely you

play18:01

know I I mean that's the thing is that

play18:02

when you see truly novel ways to solve

play18:04

something there's something about it

play18:06

that just gets me excited yeah it's

play18:08

sorcery level this is beautiful in the

play18:09

same sense as a black hole exactly it's

play18:12

black hole beautiful it's not that you'd

play18:14

ever want to be remotely close to a

play18:17

black hole and get spaghettified into

play18:18

the universe it's that its beauty is

play18:21

also why it's so terrifying right it's

play18:24

its beauty is in its terribleness it is

play18:28

it is great in the classic sense of the

play18:30

word great just like in yeah it's just

play18:32

like a volcano like a volcano is

play18:35

beautiful it's awesome there you go it's

play18:37

awesome uh the Beautiful Mess there are

play18:39

so many more things to tell from this

play18:40

code base like a team of super senior

play18:42

developers who were rewriting the whole

play18:44

thing without shipping any code for 5

play18:45

years or the red hat Consultants

play18:47

building one the one database to rule

play18:49

them all there were so many crazy

play18:51

corners of this code base so many

play18:53

reasons why there were a whole teams

play18:54

dedicated to starting from scratch on

play18:56

just one bit of its functionality but I

play18:58

think most important story to tell about

play19:00

or but I think the most important story

play19:03

to tell is about Justin's Improvement of

play19:05

the merchant search page the merchant

play19:07

search page was the entry point into the

play19:09

entire application every customer

play19:11

service rep would get on the phone with

play19:12

the merchant and type either their ID or

play19:14

name to find their information that

play19:16

would land you on a massive page with

play19:18

all their information the page was

play19:19

information Debs in the best way full of

play19:22

any information you could need and any

play19:24

links you could want to visit but it was

play19:26

dog slow Justin was the sole senior

play19:29

developer in my group he was bright

play19:31

snarky and couldn't care less about the

play19:32

business he told it like it was didn't

play19:35

pull any punches and could always solve

play19:36

problems by himself faster than teams

play19:38

around him one day Justin got tired of

play19:41

hearing about how slow the merchant

play19:43

search page was and went to fix it every

play19:45

box on the screen became its own endo on

play19:48

load everything above the fold would

play19:50

start fetching and as one load in more

play19:53

requests would come in it took the page

play19:54

time from minutes to subc Well Done

play19:57

Justin also kind of wild really like an

play20:00

npl1 query problem that went

play20:02

on just absolutely no

play20:05

respect for the servers let's go let's

play20:09

go uh two ways to decouple why was

play20:12

Justin able to do this because the

play20:14

codebase had no master plan there was no

play20:15

overarching design the system had to fit

play20:18

into no expected format for apis no

play20:20

documented design system no

play20:22

Architectural Review Board making sure

play20:23

things were coherent the app was a

play20:25

complete and utter mess no one could fix

play20:27

it uh no one could ever fix it so no one

play20:30

tried to what did we do instead we

play20:32

carved our only own little world of

play20:34

sanity this monolithic app and due to

play20:36

its sheer necessity had grown to be a

play20:38

microcosm of nice small apps around its

play20:40

edges each person when tasked with

play20:42

improving some part of the app would

play20:44

inevitably give up untangling that web

play20:46

and find some nice little corner to

play20:48

build new things and then slowly update

play20:50

links to point to their nice new stuff

play20:51

orphaning the old one this may sound

play20:53

like a mess to you but it was remarkably

play20:55

enjoyable to work it gone were the

play20:57

concerns of code duplicate gone were the

play20:59

concerns of consist consistency gone

play21:01

were the concerns of extensibility code

play21:03

was written to serve a use to touch as

play21:06

little of the area around it as possible

play21:08

and to be easily

play21:10

replicatable or replaceable our code was

play21:13

decoupled because coupling it was simply

play21:16

harder it's actually kind of nice it's

play21:18

kind of

play21:19

sweet it's kind of like a little sweet

play21:22

ending here this is this is such a

play21:24

lovely story I I love the fact that this

play21:27

guy could work in potentially one of the

play21:29

worst code bases ever created and just

play21:32

see the positive part of it all I really

play21:36

love trying to look at things in the

play21:38

positive light and this is just like the

play21:40

ultimate expression of being positive

play21:43

even about something that could be so

play21:45

awful lovely after in my career sense

play21:49

I've never had the privilege of working

play21:50

in such a wonderfully ugly code base

play21:52

every ugly codebase I've encountered

play21:54

since has never transcended into uh its

play21:56

need for consistency perhaps it was

play21:59

because the codebase had been abandoned

play22:01

by serious developers long before all

play22:03

that remained were rag tag interns and

play22:05

Junior developers or perhaps it was

play22:07

because there was no layer between those

play22:09

developers and the users no translations

play22:11

no requirements Gathering no cards just

play22:14

you standing at the desk of the customer

play22:15

service rep ask them how you could make

play22:18

their life better I missed that direct

play22:20

connection that fast feedback that lack

play22:22

of making Grand plans the simple problem

play22:24

and code connection perhaps it's a

play22:26

simple it's simply a naive Nostalgia but

play22:29

just as I find myself laying on the

play22:31

couch longing to go back to some of the

play22:33

worst years of my childhood when faced

play22:35

with yet another Enterprise design

play22:37

pattern my mind flashes back to that

play22:38

beautiful horrible code

play22:49

base I've had something that's kind of

play22:51

like this in the sense that it was just

play22:52

like every team had their own little

play22:54

thing and it was just like a hod Podge

play22:55

together application and it was

play22:57

beautiful it wasun to work in I could

play22:59

get my stuff done and it was virtually

play23:01

impossible to look at anybody else's

play23:04

stuff there is something that's very

play23:06

beautiful about the ability to just

play23:08

disregard everything and just build your

play23:11

own

play23:12

thing there is something beautiful about

play23:15

that I do love this this was

play23:17

fantastic thank you Jimmy Miller

play23:19

beautiful absolutely beautiful the

play23:23

name I'm I'm I'm a little touched I'm a

play23:25

little climed right now A Jen

Rate This

5.0 / 5 (0 votes)

関連タグ
Legacy CodeDeveloper InsightsDatabase LimitsCodebase CultureSoftware EvolutionTechnical ChallengesDynamic PivotReflection UsagePerformance OptimizationCoding Anecdotes
英語で要約が必要ですか?