Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Right now, at work, I am getting insane with a task of re implementing some web forms that talk to shinier API. No documentation "just read the previous ruby server side validation code and put it on the js front-end". So I am hunting for hints and people to to be sure the code does what it intended to do. And I get cup sized eyes when asking for documentation :D.


That's the _worst_ kind of specification. "It has to be like the old one, but with this differences".

That means you have to study the old code, which is of course poorly documented and probably buggy; and then try to reproduce it in a sane way.


Alternative idea: keep running the same Ruby code.

- https://github.com/ruby/ruby.wasm (compile Ruby to WASM)

- https://mame.github.io/emruby/ (example of Ruby compiled to WASM)

- https://opalrb.com/ (compile a subset of Ruby to JS)

This requires downloading several MB of code (and then caching it in-browser) so would be ideal for internal-only stuff.


Pretty cool. (I changed the languages for privacy reasons but your solution still stands)


Ah, well even if it's some super-obscure or internal thing, if it compiles down to C that doesn't mind POSIX you might still be able to Emscripten-ify it!

(Part of my thinking with this solution is to broadcast "you are asking me to do something that requires a solution this complex to wrangle the problem space effectively" to try to fend off similar inanity in the future, admittedly, perhaps I'm being a bit optimistic/unrealistic heh.)


You are lucky, I am reimplementing CRM functionality on a web api by looking at SQL Server Profiler!


Why wouldn't you reach for a decompiler first?

I guess perhaps you are working with some very obfuscated code, still if you are black box profiling code it might make sense to crack open that box as much as possible. Unless what you are working with is DRM-level "performs like cow dung in a blender" horrifically inefficient, I can't imagine it is obfuscated that badly.

At any rate, hopefully you are paid well for it, reverse engineering is difficult, to say the least.


They have the source code but they need someone to sign off, etc, etc (I am an external contractor) and meanwhile I started by doing what I could and now am nearly finished. Decompiling the old app would be hard because it is a VB application.


Holey moley, that's just plain cruel.


Haha, wtf :D.


We had an application running a business for 10 years. It started printing labels incorrectly. There was a bug in the code. The source code provided for the application was at least 5 years out of date. Documentation was null. Additionally, the variable names were TextBox1, TextBox2....etc.

I decompiled the app, documented the UI and which variable is what. Rewrote the whole app. It was quite painful but good learning experience. I would love to do another one.


Yeah I'm doing the same thing; I get by well enough with trying to read the old code and playing around with the old user interface, but there's hundreds of fields and thousands of features that I have to go through one at a time. Most validation is just a regular expression though, easy enough to port.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: