DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • What Do You Mean by Debugging in C?
  • Advanced Python Techniques Every Programmer Should Know
  • What Is Pair Programming?
  • Why PHP Is More Hated and Popular Than Ever Before

Trending

  • Exploring Sorting Algorithms: A Comprehensive Guide
  • The Stairway to Apache Kafka® Tiered Storage
  • Spring Authentication With MetaMask
  • Programming With AI

It really happened, legacy programmers tales

Oren Eini user avatar by
Oren Eini
·
Nov. 17, 10 · News
Like (0)
Save
Tweet
Share
6.06K Views

Join the DZone community and get the full member experience.

Join For Free

fairy tales always start with “once upon a time”, and programmers tales starts with “when i was at a client”…

two days ago i was a client, and the discussion turned to bad code bases, as it often does. one story that i had hard time understanding was the super if.

basically, it looked like this:

image

i had a hard time accepting that someone could write an if condition that long. i kept assuming that they meant that the if statements were 50 lines long, but that wasn’t the case.

and then yesterday i had an even more horrifying story. a wcf service making a call to the database always timed out on the first request, but worked afterward. what would be your first suspicion? mine was that it took time to establish the database connection, and that after the first call the connection resided in the connection pool.

they laughed at my naivety, for it wasn’t connecting to the database that caused the timeout, it was jitting the method that the wcf service ended up calling.

yep, you got that right, jitting a single method (because the runtime only jit a single method at a time). i had even harder time believing that, until they explained to me how that method was built:

image

some interesting stats:

  • it had a cyclomatic complexity of either 4,000 or 8,000, the client couldn’t remember.
  • the entire rhino mocks codebase fits in 13,000 loc, so this single method could contain it several times over.


but you know what the really scary part is?

i upgraded from super if to black hole methods, and i am afraid to see what happen today, because if i get something that top the black hole method, i may have to hand back my keyboard and go raise olives.

Programmer (hardware)

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • What Do You Mean by Debugging in C?
  • Advanced Python Techniques Every Programmer Should Know
  • What Is Pair Programming?
  • Why PHP Is More Hated and Popular Than Ever Before

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: