News for hackers. Stuff that matters.
Re:Dear Client, Here’s Why That Change Took So Long by bfdm on Tuesday May 07, 2019 @12:30PM (#19850995)
There is a small subset of devs that will rush and get the work "done" in the underallocated time. The catch is in, of course, the Definition of Done. This is why we spend time aligning teams on exactly this.

Sure I can fire off that one line change and tell you it's done. But, does it work? Is it right? Do you care?

Typically this sub-par work is done by inexpensive outsourced development shops being managed by a client rep without the capacity to see through the lies until the project goes sideways in the future. The developers who rushed the work are paid and out of the picture and never have to fix the problem or touch that code again, so they don't care.

Re:Dear Client, Here’s Why That Change Took So Long by plausibilities on Tuesday May 07, 2019 @12:43PM (#19851126)
Handyman Contractor mentality vs Civil Engineer mentality in a nutshell

Unfortunately not everyone cares about resilience and certain performance thresholds when it comes to construction, especially when budgets become involved.

Some customers will are happy to cheap out for a hack-job remodel in the hopes that they can flip their home and run off before the bagholder realizes they got a lemon.

Re:Dear Client, Here’s Why That Change Took So Long by dsfyu404ed on Tuesday May 07, 2019 @01:08PM (#19851338)
The handyman spends 20min thinking about how to solve the problem.

The civil engineer spends 20min thinking about how to solve the problem and 20-days making sure there's no way whoever signs his paycheck is going to be told by a court to pay out a bunch of money if something goes sideways.

An professional engineer is basically just a lawyer for the laws of physics. You're not paying for his ability to come up with a solution. Anyone can read the books and do that. You're paying for the fact that other people take that solution seriously.

Re:Dear Client, Here’s Why That Change Took So Long by hinkley on Tuesday May 07, 2019 @02:34PM (#19852171)
There was some CivE professor that people liked to quote who talked about how he had no qualms flunking people from his classes because a degree in Civil Engineering was a license to kill.

If you let dumbasses through the system, they will build a pedestrian bridge in a hotel lobby that fails and kills a hundred people at a party.

Re:Dear Client, Here’s Why That Change Took So Long by vincnetas on Tuesday May 07, 2019 @02:59PM (#19852370)
For those who didn't catch the reference : Hyatt Regency Walkway Collapse

https://www.youtube.com/watch?v=VnvGwFegbC8

Re:Dear Client, Here’s Why That Change Took So Long by gmueckl on Tuesday May 07, 2019 @06:31PM (#19854040)
A lot of the most serious software engineering work that I have done had much the same ratio: coding the a solution that mostly works was easy. Making sure that it is robust against all kinds of failures (CPU, RAM, bus/external device failure, random bit flips etc.[0]) and does the right thing was a lot of work.

[0] The system I worked on was hardened against all of that and some more failure modes.

Re:Dear Client, Here’s Why That Change Took So Long by Waterluvian on Tuesday May 07, 2019 @12:53PM (#19851208)
"handyman vs. civil engineer." I'm going to use this the next four or five times and see if the analogy helps.

I mean both are valid depending on what you want. Are you asking me to whip up a script to answer a one-off question or a pipeline to answer that question for every customer every quarter?

Re:Dear Client, Here’s Why That Change Took So Long by avgDev on Tuesday May 07, 2019 @12:57PM (#19851242)
Spot on.

I was 1st SE at the company I am at now. Previous applications were developed by outside contractors. I tried making some changes to that code base and found massive issues. Source code was older than the compiled application. Massive methods that were 1k+ lines long. Business rules all over the place in IF statements. Barely any documentation/comments. Only way forward is complete rewrite.

I'm a relatively fresh SE, but I read books/research good practices because I'm trying to avoid major mistakes. Also, it is hard to explain to people who even know some code, how difficult it is to make what seems like a simple form.

At this point I would refuse to work without time for unit testing/refactoring/research.

Interestingly, few days ago I made a very minor change in app I developed straight out of school. App had 0 unit testing and minimal integration testing. It created a bug, because I allowed the specs to change weekly and I just coded it without thinking. Therefore, many lessons were learned that day.

Re:Dear Client, Here’s Why That Change Took So Long by adanto6840 on Tuesday May 07, 2019 @01:13PM (#19851384)
I've been a stakeholder in many a "rewrite is the only way forward" projects, though I have almost never actually advocated/voted for a "from-scratch" rewrite. I obviously say this having none of your domain-specific context -- so grain of salt -- but, in my experience, a total 'scratch' rewrite is rarely the right answer.

Furthermore, it's often nearly impossible to even be able to ascertain the 'right answer' until you've gained significant exposure to both the application & the business needs; in my experience, you'll have a far better understanding & appreciation of the architecture after a year (or three) of exposure. At that point you are much better positioned to objectively understand the potential ROI (or lack thereof) on a rewrite project vs a more conservative but concerted effort towards incremental improvement over time.

When mentoring developers on this general topic, one of the key things that I emphasize is that a functional application (even if substandard in architecture) is already solving a business need and often generating revenue/profit/positive ROI (as the case may be) for what was probably a "[re]write" project at some point in the past. Rewriting is a large undertaking with many unknowns & high costs, often higher than anticipated, and with no guarantees of reaching full functional parity in a given stated timeline. That results in difficult budgeting & ROI calculations (read: risky), and typically means the project itself is risky -- meaning the potential reward would need to be quite large to be worth it & offset the risks. I find that to rarely be the case when you already have a functional application, even if substandard. ;)

Re:Dear Client, Here’s Why That Change Took So Long by dllthomas on Tuesday May 07, 2019 @01:43PM (#19851682)
Also keep in mind that often the existing application is the only real artifact you have capturing all of the complexity and corner cases your rewrite will have to deal with.
Re:Dear Client, Here’s Why That Change Took So Long by adanto6840 on Tuesday May 07, 2019 @05:02PM (#19853427)
This is a very good point and it's probably far more common than it is given credit for.

Sometimes you manage to catch some of these early on, but often they aren't caught until later in the process -- at which point the cost for the change (and the impact on budget/timeline, and potentially even the very architecture you set out to fix!) is drastically higher.

I've seen it happen a number of times where the 'spec' seemed simple enough at commencement & throughout most of the project; then you'd have each department test & the reports would start coming in... and the result would inevitably be a multiplier on the project scope.

Not from missing features mind you, but via the omission of 'complexity handling' / business logic which was documented -- but the code itself was the documentation, which isn't overly unusual (and IMO isn't even a particularly bad thing in many cases, though not all).

Re:Dear Client, Here’s Why That Change Took So Long by dllthomas on Wednesday May 08, 2019 @12:01PM (#19860132)
It's important that documentation be clear, discoverable, and up to date.

Code-as-documentation is best-in-class at staying up to date, when it comes to documenting what a system does and how. Often the relevant pieces are very discoverable as you're going to make a change. For other goals, it's much less discoverable. Clarity depends on both how the software is written and who the audience is.

Tests-as-documentation are arguably a special case of code-as-documentation. Outside of the case of well maintained tests-as-documentation, code-as-documentation often has a hard time expressing "why" and distinguishing between what has to be a certain way and what just happened to be that way.

It also has some trouble expressing aspiration - "we've decided it should be this way, but it's not yet".

Re:Dear Client, Here’s Why That Change Took So Long by zebraflask on Tuesday May 07, 2019 @11:01PM (#19855551)
Late to the thread, but just to chime in, briefly - I would agree unless the underlying platform has been deprecated.

If we're talking about something in Java that could be better, in the abstract, but it still works, agreed: it might not be worth the effort to redo. Java isn't going anywhere, and versioning differences aren't always critical.

If we're talking about deprecated front end frameworks that no longer have any LTS (Angular 1 comes to mind), moving over to a framework that does have LTS is a pretty smart move, if the code or app is that important and valuable.

Re:Dear Client, Here’s Why That Change Took So Long by bluGill on Tuesday May 07, 2019 @01:45PM (#19851707)
In my experience it takes months of looking at existing code before you see the good architecture under the superficial mess.

In other words, work in the current code for at least a year before proposing a re-write.

Source code older the the application doesn't mean much as a statement - any good process will build off a CI system which only takes old source code. The question is how different is the application the code generates from what exists, and what to do about differences.

Massive methods are sometimes a sign that the good architecture missed something. Refactor them of course, but that doesn't mean the architecture is bad, just that it needs to change to fit current requirements.

Documents/comments lie. Their value needs to be contrasted to the risk that they mislead you. I'm not saying you shouldn't have them, just not a much as you think.

The problem with books and research is knowing when to apply them. The rules exist for good reason, but they are really guidelines not rules and sometimes they need to be broken. I'm considering that now in my application, the GUI depends on the business logic depends on the network at first glance, but looking closer I'm debating calling it fine because there is no business logic (network sends 5, business logic changes the type from int to mm/s, GUI displays 5 mm/s), so the complexity of making the business logic the thing everything depends on doesn't seem worth it. Maybe, I'm still trying to figure out where we go next, different guesses result in different optimal architectures: if we were really sure they wouldn't be guesses.

I do agree that you shouldn't do anything without creating a test. Note that test is singular, don't try to create exhaustive tests, not only will it take too long, but you often will waste time on a test that is incidental to the implementation and not required. Create a test or two around something you want to change, and then make your change. You get some assurance you didn't break anything, if you were wrong and broke something, you at least get another test out of it.

Re:Dear Client, Here’s Why That Change Took So Long by commandlinefan on Tuesday May 07, 2019 @01:54PM (#19851799)
> it takes months of looking at existing code

All the while listening to management say, “this should be a one line change, why should it take more than a few hours?”

Re:Dear Client, Here’s Why That Change Took So Long by megablast on Tuesday May 07, 2019 @03:12PM (#19852473)
> this should be a one line change

Oh great, you do it then.

Re:Dear Client, Here’s Why That Change Took So Long by collyw on Tuesday May 07, 2019 @02:26PM (#19852088)
Sometimes it's completely obvious that a design decision is flawed.
Re:Dear Client, Here’s Why That Change Took So Long by dllthomas on Tuesday May 07, 2019 @02:51PM (#19852303)
And when that's true, the design decision in question is often flawed.
Re:Dear Client, Here’s Why That Change Took So Long by bluGill on Wednesday May 08, 2019 @08:20AM (#19858106)
I disagree with the term obvious.

Sometimes it only seems completely obvious until you discover an unexpected constraint that the design decision address well. Sometimes those constraints are no longer a limiting factor and you can safely rethink the design, sometimes they are an elegant way to prevent a specific real problem and you shouldn't.

Re:Dear Client, Here’s Why That Change Took So Long by drewolbrich on Tuesday May 07, 2019 @01:26PM (#19851525)
Even though the code you are interacting with appears awful, you may want to reconsider the rewrite strategy. This post may be helpful: https://www.joelonsoftware.com/2000/04/06/things-you-should-...

Consider rewriting only a handful of small parts that are causing problems critical to the success of the product, and making small improvements to the rest of it as needed over time.

Re:Dear Client, Here’s Why That Change Took So Long by avgDev on Tuesday May 07, 2019 @01:41PM (#19851666)
This is impossible in my case, the source code is outdated. We do not have the source code of the project, which we run in production. The dev lost it.

I have tried working with the source code but it has many bugs and it appears to be two years out of date. This leaves us with an application only in its current state with no way of making any changes.

I may be able to extract pieces of information, reuse some stored procedures and so on.

Re:Dear Client, Here’s Why That Change Took So Long by bluGill on Tuesday May 07, 2019 @01:48PM (#19851729)
At least you have something. You need to tell your boss that all features in the last 2 years need to be rewritten from scratch, with no lessons learned to speed up the effort, but that is still faster than starting over (particularly if the boss can say some things didn't turn out useful).
Re:Dear Client, Here’s Why That Change Took So Long by avgDev on Tuesday May 07, 2019 @01:57PM (#19851836)
Would you take this approach even if the framework is outdated? Part of rewrite is to switch to a newer framework and make general improvements in maintainability, reliability and speed.
Re:Dear Client, Here’s Why That Change Took So Long by kolinko on Tuesday May 07, 2019 @02:20PM (#19852047)
Yes. By the way - „Working effectively with legacy code”.

https://www.amazon.com/Working-Effectively-Legacy-Michael-Fe...

If you start from scratch you may bump into the same edge cases that the original writers bumped into, and end up with a code that is not much better than the original - even in the original is 2 years out of date.

I’m sure there were cases when writing from scratch was a good call, but I don’t remember hearing about it.

Re:Dear Client, Here’s Why That Change Took So Long by avgDev on Tuesday May 07, 2019 @03:17PM (#19852539)
I guess if I do rewrite, I shall write about it as I go. If I fail it will make for a good story.
Re:Dear Client, Here’s Why That Change Took So Long by adanto6840 on Tuesday May 07, 2019 @05:22PM (#19853561)
I'd emphasize that failure on a project like this may not be what you'd traditionally have in mind when thinking 'that project failed', though it happens and it could be that bad in the absolute worst case.

The issue is primarily that of the reward versus cost -- especially the opportunity cost.

When the system is rewritten, will the business have increased revenue or decreased cost? Will it do so significantly, surpassing at least the cost to rewrite (salaries, etc) -- that's the absolute minimum bar, but then you have to consider the opportunity cost which is the real concern:

If you had instead spent the same amount time adding new features, implementing an A/B test suite to increase conversions, improving marketing capabilities, retention mailers, or really any other activity that could positively impact the company business metrics -- would the impact be better than the impact of the rewrite?

In most cases the customers (internal or external) don't really know or care how good/bad the underlying code is, as long as the product serves their needs. When that's true, even partially, the value of 'rewrite' almost never exceeds the opportunity cost alone, let alone the absolute cost (and that's to say nothing of the risks).

Re:Dear Client, Here’s Why That Change Took So Long by bluGill on Tuesday May 07, 2019 @02:09PM (#19851933)
Yes. A framework is a detail, the business logic shouldn't care. Even if the framework is tied in I'd keep using it while moving newer stuff to something else. I've been in big rewrites to change the framework and everything else, on hindsight I believe I could have done an in-place refactor of everything to the new framework and been working the whole time, at less cost.

That isn't hypothetical, in the above rewrite we took one part that was considered too essential to wait brought it in, wrapped it, and used the new framework. It was working much sooner than the other code. It still isn't completely re-written - but it doesn't need to be as the core business logic is known to work.

Re:Dear Client, Here’s Why That Change Took So Long by ma2rten on Tuesday May 07, 2019 @01:55PM (#19851806)
If it's language that has byte-code like java or .net you might be able to decompile the production binary.
Re:Dear Client, Here’s Why That Change Took So Long by dllthomas on Tuesday May 07, 2019 @02:56PM (#19852345)
Even if it's not, decompilation might be useful. What I'd try is decompiling both the running version and the build of the available source code, and see if the diff is informative.
Re:Dear Client, Here’s Why That Change Took So Long by ma2rten on Tuesday May 07, 2019 @05:34PM (#19853666)
Last time I checked x86 decompilers were not that useful.

They were producing code that is not compilable, often completely failing on more complex, translating code compiler boilerplate into code.

This was a while ago so maybe things improved since then.

Re:Dear Client, Here’s Why That Change Took So Long by dllthomas on Tuesday May 07, 2019 @06:58PM (#19854218)
The goal here is some window into "what changed". For that, we don't need "compilable", and boilerplate won't be an issue provided it's stable (by no means guaranteed, to be sure).

If I had to bet at even odds, I'd bet against it being useful. But the win is potentially large and the effort isn't.

Re:Dear Client, Here’s Why That Change Took So Long by avgDev on Tuesday May 07, 2019 @03:16PM (#19852523)
Good suggestion.

I have decompiled the version in production. I will admit that reading it, is extremely frustrating as there are no objects and fields are named field1, field2, field3.

Re:Dear Client, Here’s Why That Change Took So Long by Drdrdrq on Tuesday May 07, 2019 @05:52PM (#19853786)
Still, you can compile + decompile the code you have, and compare that to decompiled production app. This might allow you to apply any cganges back to the code.

Btw, it's not a dev who lost the code, it's the company and inadequate development process. It should never have been the single dev's responsibility to make backups.

Re:Dear Client, Here’s Why That Change Took So Long by avgDev on Wednesday May 08, 2019 @11:33AM (#19859800)
Definitely did not mean to only blame the dev. The company knows that errors were made on both sides, hence why we are working on improving the process.
Re:Dear Client, Here’s Why That Change Took So Long by scarejunba on Tuesday May 07, 2019 @03:41PM (#19852759)
Slightly relatedly, we bundle our source code into our deployable artifact along with the revision. A bit silly and it increases the artifact size, but it's just another layer in the Docker image and so it's not that painful.
Re:Dear Client, Here’s Why That Change Took So Long by hinkley on Tuesday May 07, 2019 @02:40PM (#19852208)
At the end of the day, GP is claiming zero confidence on being able to maintain this piece of code. It's come out of their mouth as "I want to rewrite this" but what it means is "I think it would be less painful to rewrite in a way I can support than to bumble around like an idiot for 3 years in this one."

There are a lot of things you can do with that input but you really have to acknowledge that there's a pretty big problem here, and some empathy is going to be part of our path out of this mess.

Re:Dear Client, Here’s Why That Change Took So Long by kl4m on Tuesday May 07, 2019 @02:11PM (#19851953)
Re:Dear Client, Here’s Why That Change Took So Long by knightofmars on Wednesday May 08, 2019 @09:29AM (#19858610)
Don't take the Joel On Software article as gospel (not saying that anyone is). There are other models out there as well: https://medium.com/@herbcaudill/lessons-from-6-software-rewr...
Re:Dear Client, Here’s Why That Change Took So Long by megablast on Tuesday May 07, 2019 @03:15PM (#19852506)
Sounds like you don't even have source control and a CI system.
Re:Dear Client, Here’s Why That Change Took So Long by avgDev on Tuesday May 07, 2019 @03:25PM (#19852608)
You are correct.

We have implemented source control and CI is the next obvious step, but those things were not in place 10 years ago when the application was developed.

Re:Dear Client, Here’s Why That Change Took So Long by maccard on Tuesday May 07, 2019 @02:06PM (#19851914)
On the contrary, there are plenty of devs who won't take on any work until it's been designed, scoped, run through management, prioritised and scheduled, when the actual fix is a one line change that would have taken less effort than the meeting where it was prioritised.

There's a happy middle ground between the two, and assuming developers who will deliver quick fixes are all hacks who don't care is counterproductive.

Re:Dear Client, Here’s Why That Change Took So Long by commandlinefan on Tuesday May 07, 2019 @02:41PM (#19852211)
> There's a happy middle ground

Yeah, the happy middle ground is a management infrastructure that doesn't insist that you say exactly how long everything is going to take before you start doing it and accept that there ARE unknowns in software development.

Re:Dear Client, Here’s Why That Change Took So Long by hinkley on Tuesday May 07, 2019 @02:36PM (#19852185)
Those people got burned by managers who like to think that all of their problems are one line fixes that can be rushed out.

They think that 'simple' from the user's perspective is 'simple' from an engineering sense and usually those are inversely correlated.

Essentially that engineer has grounded the management team. They can't be trusted to behave so their toys have been taken away.

Re:Dear Client, Here’s Why That Change Took So Long by megablast on Tuesday May 07, 2019 @03:14PM (#19852493)
Ha, hilarious. I have had changed that were done as soon as they were mentioned, but still required several more meetings to ensure everyone was aware of the upcoming change, had signed of on it (even though it was a severe bug), and discussed it ad-infinitum. Including how to do it, even though I already did it at the start of the meeting. Approximately 100x the time it took to do the work.
Re:Dear Client, Here’s Why That Change Took So Long by bfdm on Saturday May 11, 2019 @01:27AM (#19884714)
Well, sure. I've had those too. The trick is making sure some of that time is spent validating the assumptions you made explicitly or subconsciously.

Doing the change right means making sure that a) your change actually meets the request as the requestor understands it and b) doesn't break other features that already exist.

Re:Dear Client, Here’s Why That Change Took So Long by majkinetor on Tuesday May 07, 2019 @02:54PM (#19852322)
Definition of Done (DoD) does not exist. It is whatever stakeholder needs it to be. Stakeholder might be delusional or not, its your thing to educate or if impossible, avoid working in toxic conditions that future will bring.

Everything is a feature:

- Automatic tests, a feature. You can buy it if you want or you can accept accidental bugs any time even for stuff that worked before, or even complete meltdown. You don't have to buy them (I personally usually stop working here as this is professionally unacceptable for me, there are tones of sub standard shops that can do this) but accept warnings and give written stuff about it so I can later just ignore your anger with full confidence.

- CI/CD - you can buy it, means we are agile and fast, we do 20 deployments a day vs 2 per week where some may fail due to insulin spike at the moment. Maybe you don't want it, and snail speed is acceptable for timeframe/budget or is the least evil.

- Epic docs - you can have them or not, again, it will determine how many people you will eventually have in the help desk team, the local IT team, the perceived quality of the system, etc...

- Metrics - yes, we can make nice dashboards and you can know FIRST when anybody gets unknown exception or CPU goes higher then 90% but maybe you don't care or don't have a budget and maybe we will spend time doing wrong things.... because we don't know how often are features used...

- Full auditing - maybe you need this 10 years back in full detail for legal reason, or NOT because you don't give a damn about it as you plan to sell it in 3. Your decision.

and so on and on...

Everything is a feature. I wont accept work without some features - I can be realistic if needed but we need to mutually understand and agree what it means for the system and have that written down on public place (for example company ticketing system).

Re:Dear Client, Here’s Why That Change Took So Long by bfdm on Saturday May 11, 2019 @01:31AM (#19884729)
I'm not sure how any of that relates to you suggesting "DoD does not exist" above. What do you mean?

The DOD is not a singular ruleset, but something defined by the project team, and which can evolve as the needs or the project request. It may or may not involve some or all of the components you've mentioned.

Re:Dear Client, Here’s Why That Change Took So Long by majkinetor on Saturday May 11, 2019 @02:26AM (#19884897)
OK, bad wording I guess. What I meant is there is no universally acceptable DoD even if you pin most of the project decisions.

It exists but its dynamic and context/stakeholder/implementator/task/feature specific.

Re:Dear Client, Here’s Why That Change Took So Long by throwaway55554 on Tuesday May 07, 2019 @01:12PM (#19851370)
> There is a small subset of devs that will rush and get the work "done" in the underallocated time. The catch is in, of course, the Definition of Done.

For these devs the Definition of Done is handing it to QA to debug. They do not include all the QA tickets their rush job creates as part of their DoD, and neither does their bad manager. Therefore, it does, in fact, look like they're way more productive than the rest of the team.

Re:Dear Client, Here’s Why That Change Took So Long by hinkley on Tuesday May 07, 2019 @02:43PM (#19852239)
I've worked with devs who were so self unaware that they thought they spent less than 10% of their time fixing bugs in their code.

In the end they were right. Because they refused to own their own bugs, everyone else was cleaning up after them.

The real problem was when they started using this bullshit ratio to inform their opinions on development processes, pushing back on attempts to mature our process and tools.

Re:Dear Client, Here’s Why That Change Took So Long by dkarl on Tuesday May 07, 2019 @04:12PM (#19853015)
What's wrong about this is that from the client point of view, Definition of Done ends up depending on who they're talking to more than their situation.

Hence the sibling comment of "Handyman Contractor mentality vs Civil Engineer mentality." It becomes a question of identity rather than a question of what the situation demands.

I'm not sure how to fix this, but I don't think the problem is as bad in practice as it is in discourse. I don't think people who see themselves on the "Civil Engineer" end of things would do the equivalent of providing CAD drawings and structural analysis for someone who asks them to replace their mailbox. On the other hand, it's still a problem if they talk as if they would.

Re:Dear Client, Here’s Why That Change Took So Long by pjmlp on Tuesday May 07, 2019 @04:46PM (#19853289)
We do.

That is why any proper RFP answer already provides a broad overview how the problem would be tackled, and possible solutions to the described problem.

Also why during the project development, at various delivery phases, artifacts like architecture diagrams, documentation and UAT from customer team take place.

Re:Dear Client, Here’s Why That Change Took So Long by dkarl on Wednesday May 08, 2019 @06:49AM (#19857608)
It sounds like you're only selecting jobs that require the approach you're accustomed to, which is fine when you get to pick your jobs, but it isn't an option for internal dev teams that work on a product. The jobs come at whatever size they are. If the job is to change a word on a web page, there isn't going to be an architecture diagram, and UAT is going to mean someone reloaded the page and messaged "looks good, thanks!" to the developer.

For a consumer product with millions of users, there's probably a checklist of device platforms, screen sizes, browsers, and screen orientations to check that one-word change, but for a SaaS offering with less than 100k users, probably not.