<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>legacy code Archives - ShiftMag</title>
	<atom:link href="https://shiftmag.dev/tag/legacy-code/feed/" rel="self" type="application/rss+xml" />
	<link>https://shiftmag.dev/tag/legacy-code/</link>
	<description>Insightful engineering content &#38; community</description>
	<lastBuildDate>Mon, 10 Feb 2025 13:40:07 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://shiftmag.dev/wp-content/uploads/2026/09/cropped-Shift-32x32.webp</url>
	<title>legacy code Archives - ShiftMag</title>
	<link>https://shiftmag.dev/tag/legacy-code/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>You&#8217;re not a senior engineer until you’ve worked on a legacy project</title>
		<link>https://shiftmag.dev/senior-software-engineer-legacy-code-4839/</link>
		
		<dc:creator><![CDATA[Alen Kosanovic]]></dc:creator>
		<pubDate>Mon, 27 Jan 2025 13:19:37 +0000</pubDate>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[legacy code]]></category>
		<category><![CDATA[legacy project]]></category>
		<category><![CDATA[software engineering]]></category>
		<guid isPermaLink="false">https://shiftmag.dev/?p=4839</guid>

					<description><![CDATA[<p>Everybody hates working on legacy projects, myself included. As fate would have it, one landed in my lap recently. </p>
<p>The post <a href="https://shiftmag.dev/senior-software-engineer-legacy-code-4839/">You&#8217;re not a senior engineer until you’ve worked on a legacy project</a> appeared first on <a href="https://shiftmag.dev">ShiftMag</a>.</p>
]]></description>
										<content:encoded><![CDATA[<figure class="wp-block-post-featured-image"><img fetchpriority="high" decoding="async" width="1200" height="630" src="https://shiftmag.dev/wp-content/uploads/2025/01/legacy-code.png?x32039" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" style="object-fit:cover;" srcset="https://shiftmag.dev/wp-content/uploads/2025/01/legacy-code.png 1200w, https://shiftmag.dev/wp-content/uploads/2025/01/legacy-code-300x158.png 300w, https://shiftmag.dev/wp-content/uploads/2025/01/legacy-code-1024x538.png 1024w, https://shiftmag.dev/wp-content/uploads/2025/01/legacy-code-768x403.png 768w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>


<p class="wp-block-paragraph">Working on it didn’t make me hate legacy projects any less; it did help me get a deeper understanding of the processes and practices we use today. </p>



<p class="wp-block-paragraph">I am proud that I am a part of a team that uses <strong>most of the best practices:</strong>&nbsp;</p>



<ul class="wp-block-list">
<li>Writing clean code and automated tests&nbsp;</li>



<li>Participating in pull requests and tasks reviews&nbsp;</li>



<li>The app is in production within the same day of merging into the master branch&nbsp;</li>



<li>Agile is well-adopted&nbsp;</li>
</ul>



<p class="wp-block-paragraph"> It’s not perfect. Pull requests sometimes contain trivial suggestions and discussions. The ops team usually messes something up (or at least that’s what we devs like to think). Our product owner occasionally wants us to fast-track some ‘easy’ features… again. But all in all, things are pretty good.&nbsp;</p>



<h2 class="wp-block-heading"><span id="a-trip-to-the-ant-museum">A trip to the Ant museum&nbsp;</span></h2>



<p class="wp-block-paragraph">Since our team was performing well, our velocity was borrowed to another product, managed by another part of our company. We weren’t thrilled about it since the project <strong>uses an older version of Java, </strong>and the code wasn’t written the way we would do it. &nbsp;</p>



<p class="wp-block-paragraph">The job was to add a few metrics – simple ones, like whether the app is running and for how long, is it processing data (fast enough). The project itself was in maintenance mode, and no new features had been added in a while. Since we are accustomed to adding metrics, this should have been a piece of cake.&nbsp;</p>



<p class="wp-block-paragraph">Rolling up our sleeves, we first noticed that <strong>the project had been built using something very old - </strong><a href="https://en.wikipedia.org/wiki/Apache_Ant" target="_blank" rel="noreferrer noopener"><strong>Ant</strong></a><strong>  build files. </strong>They are big XML files that contain every piece of information on how to build the project in question. For example, you need to specify that the project needs to be compiled, tested, and packaged. All details like source, target, and resource location must be explicitly configured within those files. This used to be pretty common for many programming languages. You wrote a build file once, copied it on each new project, and then changed it until it worked for the new project. &nbsp;</p>



<p class="wp-block-paragraph">Here’s what an Ant build file for a Hello World project would look like:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="692" src="https://shiftmag.dev/wp-content/uploads/2025/01/Screenshot-2025-01-27-at-14.07.35-1024x692.png?x32039" alt="" class="wp-image-4842" srcset="https://shiftmag.dev/wp-content/uploads/2025/01/Screenshot-2025-01-27-at-14.07.35-1024x692.png 1024w, https://shiftmag.dev/wp-content/uploads/2025/01/Screenshot-2025-01-27-at-14.07.35-300x203.png 300w, https://shiftmag.dev/wp-content/uploads/2025/01/Screenshot-2025-01-27-at-14.07.35-768x519.png 768w, https://shiftmag.dev/wp-content/uploads/2025/01/Screenshot-2025-01-27-at-14.07.35.png 1888w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">There must be a more convenient way to manage that, right? Well, that’s why the idea of <a href="https://en.wikipedia.org/wiki/Convention_over_configuration" target="_blank" rel="noreferrer noopener">convention over configuration</a> came to life, suggesting that developers only need to specify unconventional aspects of the application.&nbsp;<strong>Modern build tools have adopted</strong> <strong>this paradigm by providing developers with defaults that can be overridden if needed.</strong> That’s why most java source files are in src/main/java source, while the compiled classes are in the target folder—no need to specify this over and over.&nbsp;</p>



<p class="wp-block-paragraph">That got us thinking about whether this approach would be helpful in our current projects. We had a huge application properties file, with most values having the same value (e.g., application port).&nbsp;<strong>Could we apply the same principle to our application properties?</strong>&nbsp;Most properties could have defaults, and our properties file wouldn’t be as large.&nbsp;</p>



<h2 class="wp-block-heading"><span id="things-we-take-for-granted">Things we take for granted</span></h2>



<p class="wp-block-paragraph">Back to our legacy project – we managed to build and package our application! The tedious part was behind us, and we could start coding. But&nbsp;<strong>how do we embed our metrics component into the legacy code base</strong>? We took this for granted because our application framework usually handled it. &nbsp;</p>



<p class="wp-block-paragraph">Now, what would be the best way to inject our metric components into various parts of the legacy code? Singletons! Well, it seemed the easiest way, at least, but the community considers them anti-patterns. Why? Isn’t our beloved XY framework relying on singletons? If not, what does it use? What is dependency injection? How does it function under the hood?&nbsp;</p>



<p class="wp-block-paragraph"><strong>These questions got us thinking about basic concepts that we took for granted</strong>. Using singletons wasn’t exactly a bad idea in this case since most of the code wasn’t covered with unit tests. Nevertheless, we couldn’t have a good night’s sleep unless the code was immaculate. We tried a different approach and ended up with decent and simple code – no singletons, no new abstractions.&nbsp;</p>



<h2 class="wp-block-heading"><span id="the-limited-role-of-developers">The limited role of developers&nbsp;</span></h2>



<p class="wp-block-paragraph">The only thing left was to deploy it so that we could test it. This was a problem, of course—in this case, we were not the ones deploying or testing it.&nbsp;<strong>Deploying had to be done by the ops team, and testing by the test team.</strong>&nbsp;Why couldn’t we, as developers, manage the whole feature from start to production instead of opening tickets and waiting for other teams before we could close our task?</p>



<p class="wp-block-paragraph">Firstly, we couldn’t avoid manual testing since much of the code wasn’t covered with tests. We also couldn’t deploy the application ourselves since the infrastructure didn’t allow us to. &nbsp;</p>



<p class="wp-block-paragraph">This had us thinking about the reasons behind&nbsp;<strong>the separation of duties</strong>&nbsp;and&nbsp;<strong>how our current approach is better</strong>. Seeing that our lead and cycle time on this project was significantly higher than usual (it took us weeks to deliver something we usually deliver in several days), the evidence was strongly in favor of that.</p>



<h2 class="wp-block-heading"><span id="learn-outdated-practices-to-understand-current-ones">Learn outdated practices to understand current ones</span></h2>



<p class="wp-block-paragraph">At the end of the <s>day</s> month, our metrics were up and running in production. My feelings about legacy projects haven’t changed – I still hate them, and I am not expecting you to hate them any less. &nbsp;</p>



<p class="wp-block-paragraph">We couldn’t change the project we were assigned to, and these were the cards that we were dealt. What we could <strong>change is our attitude towards the legacy project</strong>. Instead of feeling resigned, we saw it as <strong>a place to ask questions and learn.</strong> &nbsp;</p>



<p class="wp-block-paragraph">It taught us how things were done before and why they are done differently now. Instead of just knowing the best practices, we gained first-hand experience with the history behind them. &nbsp;</p>



<p class="wp-block-paragraph">Once you start having this deep-rooted knowledge, other developers will recognize this and trust your knowledge and expertise. If you want to be that person, you better be ready to dig into some legacy projects.&nbsp;</p>
<p>The post <a href="https://shiftmag.dev/senior-software-engineer-legacy-code-4839/">You&#8217;re not a senior engineer until you’ve worked on a legacy project</a> appeared first on <a href="https://shiftmag.dev">ShiftMag</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: shiftmag.dev @ 2026-10-24 06:01:20 by W3 Total Cache
-->