Live data from Hacker News

Ask HN: How do you get over the fear of sharing code?

news.ycombinator.com

71–80 of 100 posts

Re: Ask HN: How do you get over the fear of sharing code?

#72
post #67

I fear sharing code for a different reason. I'm a perfectionist with tendency toward procrastination and anxiety, and sometimes I overestimate my abilities. So when I submit a PR, I want to make sure the code is clean, well organized, and covers all corner cases and hidden feature details. This works well most of the time. I put effort to think about design, structure, and implementation more than coworkers. And afte…

Is this an alt account I didn’t know I had?

Re: Ask HN: How do you get over the fear of sharing code?

#73

With LLM’s now, odds are, they’ll just copy pasta that code. Yours may be similar but if you slap a license on it, most people respect that and will adhere to it. That said, fear of someone stealing your code is completely unfounded as there isn’t really anything novel we produce anymore. If you are on the bleeding edge, you welcome input and PR’s from others to make it better. Only wise men know they know nothing. C…

"there isn’t really anything novel we produce anymore."

Sorry for the somewhat snide comment but not with that attitude.... I know, end of history and all but it's not like we ran out of problems to solve, we maybe just don't bother solving them anymore. But we should!

Re: Ask HN: How do you get over the fear of sharing code?

#74
If you're a junior now, and think your code is worth stealing, it's probably only a matter of time before you gain more experience, and instead feel sorry for everyone who copied your earlier code (please don't take it personally, this is not a diss. It's typical for programmers to grow, try more approaches, and see better solutions in hindsight).

The lazy cheaters only cheat themselves out of getting experience and learning by writing the code themselves. It doesn't even matter whether you publish your code or not, because they'll just steal from someone else, or more likely mindlessly copypaste AI slop instead. If someone can't write non-trivial code themselves to begin with, they won't be able to properly extend and maintain it either, so their ripoff project won't be successful.

Additionally, you'll find that most programmers don't want to even look at your code. It feels harder and less fun to understand someone else's code than to write one's own. Everyone thinks their own solution is the best: it's more clever and has more features than the primitive toys other people wrote, while at the same time it's simpler and more focused than the overcomplicated bloat other people wrote.

Re: Ask HN: How do you get over the fear of sharing code?

#75
Fear of sharing ideas is one thing, but code? Well, that is a different beast altogether. In the end, it depends on how much YOU value the code. It might be a nothingburger but it took you hours or days to write because of some intricacies or you had to study some specification. That in itself has a lot of value and sharing it freely might not be the right move. It might even by a completely dumb code, the simplest thing imaginable, but it represents some internal logic that might disclose some inner-workings of some applications that might bare some risk. So...yeah, you have to figure out yourself which code is ok to share and which is not.

Re: Ask HN: How do you get over the fear of sharing code?

#76
Don't worry, far worse than students using your code is the people who find it and attempt to demand that you write stuff for them for free. I'm not even joking at all.

Contrarily, I've chatted with plenty of folks who found some hobby project I wrote up and thank me for writing it and saving them time and/or frustration.

Open your source or don't, people may use it without asking, if this upsets you, then don't. Do what you want with your own work. A buddy of mine sent me a screen shot of google's AI citing some crap that I wrote, I replied, "Wow, I hope no one actually use that!"

When I'm looking for developers I kind of expect to see something on github aside from the standard git tutorial. I'd much rather read someone's code than force them to do some coding test.

Re: Ask HN: How do you get over the fear of sharing code?

#77
Unless you're doing something that's super unique and new (e.g., you've discovered some new compiler trick or technique that no one else has done, and you want to write a paper on it), then I really wouldn't worry about it. You'll know when you've written something like that.

Re: Ask HN: How do you get over the fear of sharing code?

#78
I’m 20 years in. I don’t publish that much code because I’ve traditionally been in roles that discourage open source, but after 20 years in I’ve accrued a portfolio on GitHub of personal projects. No one has ever commented on any of it.

On internal projects it’s different- my code is the teams code. It’s never actually been mine. My colleagues comment on it, provide feedback and help me improve. After all, we are all supporting it. I’ve had almost exclusively positive experiences doing this, even if sometimes I had to change some of my priorities or opinions on things.

At this point I have a fancy enough title that, in the rare cases I get to write code or docs, people lower in level are willing to give me feedback and everyone higher in level is too busy. I miss it- it’s hard to improve without feedback and genuine collaboration is fun.

So I say publish it. Most likely no one will say anything. Maybe you’ll get some feedback and you’ll normalize managing it. Maybe you’ll find a collaborator. Maybe you’ll get flamed by a troll and you’ll learn there are idiots on the Internet. But most likely a few people will just look and say nothing.

An aside, this assumes you are not in some toxic subculture. Your mention other students- if you are in some form of university environment where there is a culture of belittling others you might want to wait. I promise that’s abnormal.

Re: Ask HN: How do you get over the fear of sharing code?

#79
It's a valid concern. Lazy idiots who take your work and then claim it as their own exist in the real world too. It's a social issue that requires a social solution. We need to actually enforce reciprocality, otherwise the incentives favor the zero-sum takers, who will take your work, reap the benefits, never give anything back in return, or worse, claim your work as their own and accuse you of copying them, and never face any consequences. When there are enough takers, people become demotivated and reluctant to collaborate.

In your specific case, if you spot a student claiming your work as their own, you can confront them directly, mock them and shame them in front of others, or report them to the faculty, or all of the above. Don't feel bad taking retaliatory measures against those who have already fired the first shot by claiming your work as their own.

It's fine if they copied your code and then gave appropriate credit, though. There's nothing wrong with someone else integrating your work in their projects as long as they gave credit, and even better, publically released their code so you may use what they built, too. Win-win.

Re: Ask HN: How do you get over the fear of sharing code?

#80
post #7

I’ve had several people steal my open-source code for different projects before. I’m talking copying (not cloning) the whole thing, changing the credit to their name, making no other modifications, and then republishing on their account. Fortunately they never gained much traction. The ones I know about I blocked on GitHub with a note. No idea if they ever found out or if they tried workarounds, but I figured there’s…

What license did you use? Most licenses require that forks change the name, few require credit except for original copyright headers, and no licenses require modification

I don’t recall the license in every case, but I remember some were with BSD3 and another was with The Unlicense. Even if the latter means Public Domain, it was still a shitty thing to do, and (I checked) it was specifically illegal according to the law in their country (it specifically said you can’t put your name on someone else’s work, even if public domain).
Post reply on HN