神刀安全网

Congraubullations

“Java and C# are kind of the same thing, right?”

Joshwas a Java developer, but his company was doing a big upgrade of some .NET applications written years earlier by a developer named Ray. Ray had left the company the previous year, and somebody needed to help port his .NET 2.5 code to .NET 4.0 and a new version of IIS. Josh was a team player, and also knew that newer versions of .NET were almost always backwards compatible, so he didn’t expect it to create that much work for him.

Most of the applications transferred to the new servers without any issues. Most . Of course, the one that didn’t transfer was the “mission critical” package. The ERP system didn’t have all the tools the users wanted for manipulating data, so they wanted a tool that could export some records to Excel, where they could edit them, and then reimport the data.The import process was reporting that it was complete, but actually crashed and didn’t finish the job (and for bonus points, left the database in an inconsistent state).

Ray hadn’t implemented any logging, so Josh fired it up on his dev box and fed it an Excel file. The program cheerfully reported what it was up to at each step of the bulk loading process, displaying a message with a throbber image that turned into a check-mark when that step completed. Despite the crash, every message reported success.

  • Congraubullations You’re file is on it’s way!
  • Congraubullations We have recieved you’re file and are procesing it right now!
  • Congraubullations Almoast done!
  • Congraubullations Table’s are bieng added to teh system.
  • Congraubullations The system is reading teh table!
  • Congraubullations You’re procesing is almoast compleeted.
  • Congraubullations Congraubullations! You’re file has been procesed!

Ugh . Josh had minored in English, and just seeing those messages gave him a headache.He pushed his annoyance aside- this was cosmetic and not directly relevant to the problem at hand.

With a few breakpoints, it only took Josh a few minutes to identify the problem. Ray’s code was spawning a background thread using the new Thread() syntax, which was one of the few places where .NET 4.0 made some breaking changes with older versions. Josh whipped up a quick workaround and ran it again- everything worked.

With the real problem solved, Josh tracked down the messages. They were hardcoded strings. He touched up the spelling, checked in his changes, and then let QA know there was a fix they could test.

They replied back minutes later: “The file gets uploaded now, but the screen hangs on the last step. The spinner just sits there.”

  • Congraubullations Your file is on its way!
  • Congraubullations We have received your file and are processing it right now!
  • Congraubullations Almost done!
  • Congraubullations Tables are being added to the system.
  • Congraubullations The system is reading the table!
  • Congraubullations Your processing is almost completed.
  • Congraubullations Congratulations! Your file has been processed!

That was strange, since he’d just seen the code run successfully. Well… before he’d fixed the spelling. Could it be? Josh dug through the code that controlled the status display, and found the problem in a file called StatisUpdator.cs .

if (StatisMesages[i].Contains("Congraubullations")) {         finished = true; //causes the throbber to turn into a check }

At least Ray is consistent.

Congraubullations [Advertisement] Release! is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies – only $9.95 shipped!

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Congraubullations

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址