This Is Not How You Port Java Code To .NET

12 commentsWritten on November 2nd, 2011 by
Categories: What's Wrong With This Picture

  • http://twitter.com/peterhoogers Peter Hoogers

    I lol’d

  • Anonymous

    Ha, yeah I got a kick out of this. The lib really works well, though. I forked this project to github, since the original repo seemed to be dead:

    https://github.com/jbogard/SharpSSH

  • anon

    don’t get it

  • http://www.daedtech.com Erik

    Wow… lol.  You could conceivably ‘deprecate’ the .NET value type altogether.  

  • http://twitter.com/joecarr1 Joe Carr

    If you’re trying to just get something working, and not going for an idiomatic port, it might be easier to create an Integer class like this rather than updating all the references to Integer within the java code.

    Depends on the frequency of uses of the Integer object, and the frequency of time you expect to be in the source…

    • http://davybrion.com Davy Brion

      look at the left side of the screenshot… he went a lot further than just implement java.lang.Integer ;)

      • http://www.basarat.com/ Basarat

        That is funny. Nevertheless it is a lot easier to do then to change ALL the references to these types to .NET ones. Simpler to simply swap out functionality and not change the names / references. 

        • http://profiles.yahoo.com/u/XHP2LPHRJMLI25MBX7I3FZPE6M James C

          I good refactoring tool (like Reshaper or JustCode) could handle that in a matter of seconds.

  • Przemysław Włodarczak

    Sadly, this is still the best SSH library in .Net world. Sigh….

  • Steve E

    Sadly I’ve had to use this library a number of times because it is the best .NET SSH library available. And yes, it’s a complete PITA when you get a String back and don’t realize right away it’s the wrong String.

  • Olivier DALET

    Funny enough I had to strugle with this lib just a couple of weeks ago!

  • Matt Wagner

    Holy crap, I randomly came across this post from another of your articles… I know this exact code, as I tried updating it and re-writing parts of it! That code was such a thorn in my side as it exposed all those faux-Java types whenever imported the library… ugh.