4 ms·
Ask HN: Are you worried about competitors copying your client-side JavaScript code?
- spaceboy 10y agoA little bit, yes. But it's a given now that client-side JS is open source, and many have got used to this. I've seen developers try to obfuscate their code using obscure packing utilities, and abusing eval(), but such code is trivial to de-obfuscate/unpack, and doing so only makes me want to see the code more since you've something to hide.
- benologist 10y agoAbout 99.99999999999% of people don't want anything to do with your code, your site, your work, or any project you will ever do. Someone illicitly copying your work sounds more like a goal than a problem cause of how popular it needs to be first.
- mattbgates 10y agoYou are 100% correct about this. I have become much more trustworthy in describing to a few of my developer friends what my plans for any program I write are. My fears used to be that they would steal the idea and go make fortunes. What I found is that is untrue. Most of them don't care enough or have time to figure out my "exact idea" and write a program to do it. I have yet to see any of them ever attempt to steal an idea I have told them. Instead, I usually confide in them to understand: "Do you think this is a good idea? Should I even bother?" They have never steered me wrong. There are projects they have loved and said, "I would love to see it when you're finished. I would love to test it out!" There are also other projects where: "It's not worth it to work on that." "I don't really see that as a demand or useful to anyone but you." 99% of the time they are giving me solid and sound advice. I think the 1% that remains is: Miscommunication. They misunderstand what I am after or I just didn't explain it right. As to answer the original question: Honestly, if my code is that good... awesome. But I likely got that code from some sample library that can be found anywhere on the Internet. If the code is good and it helps someone out, than why not? I've tried to view source on sites for something cool that someone's website was doing. Sometimes I can get the script, but often times, it is usually a combination of javascript and some PHP scripts working together, so it is not always easy to just grab the code.
- kojeovo 10y agoOnly to the point where I don't put sensitive information in it. I can see theirs, they can see mine. Meh.
- wprapido 10y agocouldn't care less
- throwawaydbfif 10y agoNah. Even client side UI is just that... A UI. It's trivial to copy a UI anyways by just taking screenshots. If more substantial parts of our apps were client side, like if we sold an online image editor, I would be very afraid. However I have doubts as to how much more vulnerable to copying JS is than anything else. People have been pirating compiled apps just as long and they don't seem any less prolific
- ftkr0 10y agoAbsolutely no because It has not alternative choice. Any code can reverse-engineering, any languages.
- compumike 10y agoObfuscation works. It doesn't have to be perfect. It just has to be good enough that it's substantially harder to copy/reuse than to do whatever the alternative is (rewrite, buy, etc).
- bbcbasic 10y agoJs is obfuscated as a language feature.
- paulddraper 10y agoCopy my SPA JS code? Oh please. You have no idea the hell you have brought upon yourself.
- dbattaglia 10y agoDefinitely not. Honestly I'm not worried about people seeing the backend code either. I'm sure there are exceptions but it's been my experience that the data is by far the most valuable asset for web/sass applications.
- gumballhead 10y agoThis happened at FarmLogs once. Our bug tracker started getting some really weird exceptions due to a Chinese company reverse engineering our app with the frontend code, which had our API key in it. We didn't really mind; it was just funny.
- donovanm 10y agoNo, I don't like to live my life in paranoia. Also anyone that was sufficiently motivated could just implement it themselves anyways.
- softwarefounder 10y agoYes, well, to some degree. The best you can do is minify it. I'm more concerned with competitors copying designs, and witty UX concepts than actual JS code. This you can put obstacles in front of by making some things only available post-purchase, or by "demo only" if the customer is undecided.
- TuringNYC 10y agoHaving worked on legacy corporate code...I find it is often easier to just observe products and reverse engineer them, rather than try to understand/extend existing code. I would generally prefer to reverse engineer+rebuild. Existing code isn't always great code, it may not even be correct code. And if your code really is that good and so unique that someone might want to steal it, perhaps you should try to extract it and product-ify it. Possibly as an open source project.
- pw 10y agoNo.
- seanwilson 10y agoWould a serious competitor ever risk being sued by copying your code verbatim? Would copying just parts of your likely obfuscated codebase and trying to integrate it into their own codebase be more difficult than reverse engineering it? I don't think it's something to worry about. Someone that is smart enough to steal and use your code is smart enough to use a legal alternative.