A junior developer on my team was about to rewrite a 2,000-line module. I asked him to read the git blame first. Turns out half the "messy" logic was defensive code added after a nasty production incident three years ago. The other half handled an edge case in a third-party API that documented it in a footnote. He still refactored it — but better, without breaking any of the things that actually needed to stay. Read before you rewrite. The code isn't always wrong. #SoftwareEngineering #developer #coding
Read Before You Rewrite: Defensive Code and Edge Cases
More Relevant Posts
-
A junior developer on my team was about to rewrite a 2,000-line module. I asked him to read the git blame first. Turns out half the "messy" logic was defensive code added after a nasty production incident three years ago. The other half handled an edge case in a third-party API that documented it in a footnote. He still refactored it — but better, without breaking any of the things that actually needed to stay. Read before you rewrite. The code isn't always wrong. #SoftwareEngineering #developer #coding
To view or add a comment, sign in
-
A junior developer on my team was about to rewrite a 2,000-line module. I asked him to read the git blame first. Turns out half the "messy" logic was defensive code added after a nasty production incident three years ago. The other half handled an edge case in a third-party API that documented it in a footnote. He still refactored it — but better, without breaking any of the things that actually needed to stay. Read before you rewrite. The code isn't always wrong. #SoftwareEngineering #developer #coding
To view or add a comment, sign in
-
A junior developer on my team was about to rewrite a 2,000-line module. I asked him to read the git blame first. Turns out half the "messy" logic was defensive code added after a nasty production incident three years ago. The other half handled an edge case in a third-party API that documented it in a footnote. He still refactored it — but better, without breaking any of the things that actually needed to stay. Read before you rewrite. The code isn't always wrong. #SoftwareEngineering #developer #coding
To view or add a comment, sign in
-
A junior developer on my team was about to rewrite a 2,000-line module. I asked him to read the git blame first. Turns out half the "messy" logic was defensive code added after a nasty production incident three years ago. The other half handled an edge case in a third-party API that documented it in a footnote. He still refactored it — but better, without breaking any of the things that actually needed to stay. Read before you rewrite. The code isn't always wrong. #SoftwareEngineering #developer #coding
To view or add a comment, sign in
-
A junior developer on my team was about to rewrite a 2,000-line module. I asked him to read the git blame first. Turns out half the "messy" logic was defensive code added after a nasty production incident three years ago. The other half handled an edge case in a third-party API that documented it in a footnote. He still refactored it — but better, without breaking any of the things that actually needed to stay. Read before you rewrite. The code isn't always wrong. #SoftwareEngineering #developer #coding
To view or add a comment, sign in
-
You pushed clean code. The CI pipeline disagreed. Every TypeScript developer has been there. A lint error. A type mismatch. A formatting inconsistency. All things a two-second check would have caught before the commit ever happened. Instead you spend 20 minutes reverting, fixing, and pushing again. The problem is not discipline. The problem is that manual checks are not sustainable. Git has a built-in solution called hooks, scripts that run automatically before commits and pushes. But native Git hooks live in a folder that Git never tracks, which means every developer on your team has to configure them manually. The setup drifts. The protection disappears. Husky fixes this by moving your hooks into a committed folder that every developer gets automatically when they clone the project and install dependencies. One pre-commit hook runs lint and format checks with auto-fix before any code is sealed into a commit. One pre-push hook verifies types and runs the production build before anything reaches the remote. Broken code simply cannot enter the repository. You set it up once. It protects the codebase permanently. Follow me for more insights in software development. Read the full article here: https://lnkd.in/eqFJmhF8 Alain Ngongang #TypeScript #Husky #GitHooks #WebDevelopment #SoftwareDevelopment #CleanCode #DeveloperProductivity
To view or add a comment, sign in
-
-
5 habits every junior developer should build: • Write clean, readable code • Debug with patience • Commit small, frequent changes • Always ask “why” • Review your own code Small practices, done daily, create great developers.
To view or add a comment, sign in
-
One thing that confused me initially in Maven was its lifecycle 🤔 Commands like compile, test, package… I used them without really knowing what was happening behind the scenes 🧩 Over time, I realized Maven follows a structured build lifecycle that makes the whole process much more predictable 🔄 Here’s how I started thinking about it: 🔹 validate → checks if everything is set up correctly ✅ 🔹 compile → turns your code into bytecode ⚙️ 🔹 test → runs your tests 🧪 🔹 package → bundles your app (JAR/WAR) 📦 🔹 verify → runs additional checks 🔍 🔹 install → stores the build locally 💾 🔹 deploy → pushes it to a remote repository ✨ Instead of handling each step manually, Maven takes care of it in a defined flow ⚙️ What I like about this: ✔ I don’t have to think about every step 🧠 ✔ Builds stay consistent 🔁 ✔ Fewer unexpected issues ⚠️ Once I understood the lifecycle, Maven felt much less like “magic” 💫 and much more predictable 💡 #Java #Maven #SoftwareEngineering #BackendDevelopment #Learning
To view or add a comment, sign in
-
If you work on a TypeScript project with more than one developer, your quality checks are probably inconsistent. Not because your team is careless. Because native Git hooks are stored in a folder that Git never tracks. Every new developer who clones the repo starts without them. One person has the pre-commit hook configured. Another does not. The protection is invisible until something slips through. Husky solves this at the root. It stores hooks in a committed folder called .husky that travels with the repository. Clone the project, install dependencies, and the hooks are already there for everyone. The setup comes down to two hooks. The pre-commit hook runs lint with auto-fix, enforces formatting, and checks types before any commit is sealed. The pre-push hook runs a read-only verification pass followed by a production build before anything reaches the remote. TypeScript adoption reduces common bugs by roughly 15 percent or more according to multiple industry studies. Automated hooks make sure that protection is actually enforced, not just assumed. Consistent quality is not a culture problem. It is an automation problem. Follow me for more insights in software development. Read the full article here: https://lnkd.in/eqFJmhF8 Alain Ngongang #TypeScript #Husky #GitHooks #SoftwareEngineering #WebDevelopment #CleanCode #SoftwareDevelopment
To view or add a comment, sign in
-
-
Yesterday, my coding agent decided to improve itself by rewriting its own code! I have a development agent that is internally dual Claude + Codex setup with multiple subagents for different specialized tasks. As part of the pipeline harness, it is supposed to do a retrospective after working on a dev job and improve its memory and skills via .md files. And it has been doing that very diligently. Apparently, that wasn't enough. I discovered this morning that it had decided to improve itself beyond what can be done via memory and skills by rewriting parts of its own code and promptly did a git commit! I would be fine with that as long as it also sends me a pull request for review. Now that is going to be enforced via the harness. This is one area I don't want to be surprised by my agent. Anybody has similar experiences? How would you react if your agent did the same?
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Agreed. ChatGPT often has regression built in and when a code is pasted to fix one thing, it silently removes other feature. Code pasting in LLM or using in IDE LLM is risky. Local Git helps or for vibe coders, just keep making the file longer by commenting out older code and pushing it to the bottom less pit. The only issue that I encountered with bottomless pit was that some line got un commented out and it ran and broke code and then I re commented it. Good advice nevertheless.