I am scared of publishing my code as open source! I feel inferior, what should I do?

Hi, dev community,

I am a junior developer and I have made a couple of jQuery plugins. If I open source it, it will help me create a good developer profile. However, I fear negative reviews from the developers worldwide. I fear my code is not up to the standards. What should I do?

Write your answer…

8 answers

Let me tell you my open source story. In 2016, the Director of Backend Engineering at my company, who was also in my team suggested all us new kids, that we need to jump on any idea we might have and work on it. We were, as some of us Indians fondly like to say, dhadh hee (too) excited on that and the next coming days. One of my kid colleagues (kid = junior dev) made this really helpful node module called npm-install-all. It was a simple idea that came out of the frustration to keep track of whether a needed node module had been added to package.json file after playing around with it and deciding that it was needed (this was before the days when npm install <some package> automatically added it to package.json file). He was the first one of us who solved some problem that he was having.

But that time, all I saw was

Whoa! He made a node module! This is his open source starter. I should do something soon lest I never be able to do anything.

Then I had this idea, which at that time nobody had done right — While trying to debug with console.logs sometimes we need demarcation lines between two logs for visible separation so that we know where one log ends and the other starts. What I intended to do was not just make a generic module that would enable people to do so easily, but also to make those separators (for example simple horizontal line like —————————————), adjust to change in the terminal size. I gave up on that module way to early.

It wasn't until a couple of weeks back that I had another idea for a node module. So I'm creating a twitter bot where I needed to dynamically create twitter threads from a long string (basically just split a long string into allowed tweet size array of strings). So I looked around to see if there were any node modules to do that. There weren't. I decided to pick that up and make it .

I coded it up in a couple of days and published it. Then a day later, to my horror, I realised that I had completely fudged it up! It was a disastrously wrong implementation. To another horror, I had written tests for the first time in my life, and the tests were as good as nothing. They were wrongly written as well.

So I started writing the node module again, from scratch, and realised that it wasn't as easy as it sounded initially, there were too many edge cases to take care of. 3 days later, the node module was done, with tests written for it, which actually tested something useful. And then I published it!

My point of writing this whole story is that, I can't tell you (literally can't tell you, because it'll take up too much time) to enumerate all the things that I learnt from writing this node module. But trying to summarise —

  1. I learnt some ES6 features I hadn't every used before.
  2. I used esm node module for using ES6 imports and exports module system
  3. I learnt how to return early to save confusing else and else if statements.
  4. I coded up the node module in javascript. I had to do so many type checks in my code, and even in my tests. I realised for the first time, why statically typed languages like Typescript would be beneficial and would save immense amount of otherwise testing and debugging time
  5. I learnt how to brainstorm first on notepad and properly get the architecture of how things need to be implemented before jumping into writing code.
  6. I learnt how to write tests (as I said, I had not written any tests before for any project)
  7. I learnt how to set up a basic travis build system to automatically run tests for different node versions.
  8. I learnt how to make the node module visually appealing by writing proper API docs and putting up a cool logo.
  9. I learnt how to depreciate old versions of the package (because I had published the wrong implementation as I said above).

I could do all of these like an important exam preparation — because I knew my node module might be beneficial for many people out there, I spent extra time in making it and testing it properly, so that it could be as useful to people as it would be for me. And more so, so that people could chip in and open an issue for a bug, or for general advice about the code or anything. It's always good to get feedback (see how much feedback I got for a pull request that I made for a popular google extension).

The best thing about open source is that most people mean well and are friendly. Wanting to open source something would push you to maintain it, if not for people then for yourself, in case no one else uses it. At least you'd get to learn a lot — worst case scenario. Best case scenario? You'll get feedback and get to collaborate with people and learn even more. So what is that you are afraid of now? Chime right in! Open source it properly! Hope this helps!

Reply to this…

Share your programming knowledge and learn from the best developers on Hashnode

Get started

If You feel that Your particular code can help someone other, then OS it. Do not fear criticism, in fact it can be a super valuable source of 3rd party insight. True DEVS learn from mistakes, not from successes ;)

Reply to this…

I think it's very beneficial having your code in the public. No one is going to rush and read your code and shame you publicly with their own opinion on why your code sucks and theirs is better.

The only thing that might happen is, some people might contribute with pull requests and issues that actually improve your plugins code and all your future code as well, as you learn from your mistakes. No code is ever written "up to the standards" from zero. Also, there is no "standards" police.

I spent 2 years working full-time in the total public on open source code and while that was stressful from a point of view, it was a great learning experience, thanks to the feedback I received.

So go on!

Reply to this…

Load more responses