7

A JavaScript developer want to understand my 1000+ lines pythonic python code without any prior knowledge about python and he just want to understand it so that he can translate it into js. What should i do?

Comments
  • 0
    Is this related to that other rant about translating scripts
  • 0
    @alexbrooklyn nope this is unfortunately a real story.
  • 3
    I fail to see how this is your problem honestly. Is it a co-worker/employee, friend, family, maybe you owe a debt? Tell them to do what devs do a figure it out. Reverse engineering can be the easiest and most fun route to learning anyways.
  • 0
    Help him ofc. Is this a trick question or smth?
  • 0
    Look on the rant below.
  • 0
    @Plasticnova he is a friend so i don't wanna be rude also i don't want to waste my time.
  • 2
    @-pthread if it’s a friend work out a compromise. Tell them to go through it and attempt to make sense, if they come up with specific questions maybe you could step in then. Basically just ask them to make an effort first, ultimately it’ll be better for them.
  • 1
    Sign him up at an asylum
  • 0
    Tell him what your script does, what functions it performs, what requirements it satisfies. Then he can write the same thing in Js.
  • 3
    If he can't understand it without your help maybe he shouldn't be translating it to JS at all. I don't know how it is for other devs but I can pretty easily understand languages I haven't seen before. Yeah, no brainfuck or the like but just looking up some language specific features and trying to follow the code gets me there, at least to a point of a high level understanding.
  • 6
    Writing code from 1 language to another isn't a matter of understanding the language, but the problem this piece of code actually solves.

    If there is language specific features being used, the odds are JS has the same features under a similar name or lib anyway - but then how hard is it to do a google search?

    python xyz() -> read what it does
    Javascript "how to do xyz"

    Or maybe I've just been in the game to long.
  • 1
    kill yourself
  • 0
    Write comments in the code.
  • 0
    I think it shouldn't be difficult. Python is very easy to read and it's very similar to js.
    If we were talking about c++, then it would be a hell.
  • 0
    @CodeMasterAlex I agree with some reservation.

    I tried to port a project written in Go to C# and it was using go channels heavily.

    And multithreading in C# does not really have something close enough, especially with go’s integration in switch/map.

    I could probably have used one of the examples I found to create something similar but I am pretty sure it would introduce hard to find bugs or performance problems.

    So I ended up building it from scratch from the original papers instead.

    But I got to learn quite a lot about go in the process ;)
  • 3
    @childporn Why the fuck would you name yourself child porn??
  • 0
    @CodeMasterAlex why wouldn't you?
  • 0
  • 2
    @EzeKoren for the same reason you shouldn't name yourself 'CancerWhore' or 'ChildFucker' or 'NiggerKiller'etc. It has something to do wirh a thing that's called common sense.
Add Comment