Wednesday, October 25, 2017

My experience in GitHub

I have already been a contributor to a project (you can read a blog about my journey here) and now it's time to be an owner of open source project!

This week I have started an obtaining file info library written in Golang.

How to create an open source project?

Step #1: decide on your idea
I got my idea from professor, because I did it for my open source class.

Step #2: pick up the programming language
I wanted to do something nice and not stressful and pleasant. I  am quite a fan of Golang, so my choice was obvious. Golang is fast, easy and has a nice set of packages.

Step #3: pick up the license
I decided to go an easy way and use good old MIT license.

Step #4: start coding
Coding was easy and smooth, I got a lot of help from various Golang packages, so it was nice.

Step #5: file some issues
If you want people to contribute, you should file some issues, include some nice explanation, screenshots and some starting-point information(if applicable). You should also create a detailed instructions in README. Nice documentation would for sure attract developers.

My experience with contributors

I have done all the steps from a previous section and just waited. 4 hours later I got pull requests for all my issues from one person. He/She was supposed to be my classmate(that's one of the tasks to contribute to one another's projects), but I did not recognize the name... After going through the list of my group, I did not find his name. According to GitHub profile, the guy is from Germany! It is crazy! I did not expect somebody not from my group to contribute!

Anyway, Danke Marcel Beck!

Thursday, October 19, 2017

Small step for developer giant leap for community

Every person who has tried to fix some code he/she didn't write, knows that the real fun begins after the build...

Most of the projects have straight forward documentation that covers the build part. But when it comes to code editing: you are on your own. Now your success depends on how fast you are going to understand the logic of the mysterious lines written by some strangers.

I have noticed that it's much easier to improve/debug/add features to the code written by a single person, because he/she sees the big picture and idea, so it's easier to follow those.

Unfortunately when it comes to work on a project with hundreds or thousands of contributors, understanding the full logic is almost impossible and would take ages to fully know what is going on.

Luckily for me and other open source contributors, every project like that has communication channels. For example, Mozilla Dev Tools team is using Slack. That's the place where one can ask questions and get help. When you talk to people there you need to keep in mind that you are not the only one who is looking for help.
So if you want to get a straight forward answer, you need to ask a clear question.


Developing code is not an easy thing, but working with something written by a large amount of people is even harder. At the same time project may be more successful if more people contribute to it.

And as my open source journey continues, I hope, I will be one of the many who are working on something important, who are defining the future of the technology.

And the next stop is fixing code. My bug wasn't really a hard one, but it took some time to understand the logic of the flow. Fortunately, Jason Laster was there to answer my questions or to refer to the right person.

And now I am trying to pass tests and push the code to my GitHub forked repository. The first time I run tests I got the following output:

                                                                                                                                               
Snapshot Summary
 › 11 snapshot tests failed in 1 test suite. Inspect your code changes or run with `yarn test -- -u` to update them.

Test Suites: 2 failed, 59 passed, 61 total
Tests:       12 failed, 332 passed, 344 total
Snapshots:   11 failed, 101 passed, 112 total
Time:        96.983s, estimated 100s
Ran all test suites.

error Command failed with exit code 1.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
                                                                                                                                               

It amazes me how something small like changing a color of an icon can cause problems!
After asking how to get started with fixing failed test, I was told that there was an issue with line endings, so after git pull: -1 failed test suit and -1 failed test!

Jason advised me to ignore the failed tests, so git push!!! I have never though that such a simple git command can bring so much satisfaction!

I am almost there, my next step is to create pull request.

My code did not fail any of the PR checks! That feeling is amazing!
Do you know what feels even better? When real developers approve your code and give you some pleasant comments!







Saturday, October 7, 2017

The least stressful built ever

Deciding where to start my open-source developer path was maybe the hardest part of my contribution so far (I hope) 


The next step is to set up environment and run the project locally. 

Without any positive attitude or expectations I went to the link which gave me some instructions how to set all the required dependencies and start debugger.

I got Yarn, Node.js and the project itself:
git clone git@github.com:devtools-html/debugger.html.git  
So far so good!

Next step was to install all the dependencies with even more magical command: yarn install. Nothing stressful and with no pain I have successfully started the project on port 8000 with yarn start.

And that was it! 

Tip for the future: Have more courage and Murphy's law doesn't always work.

Wednesday, October 4, 2017

Baby steps

I spent my last week and a few days this week trying to find the perfect first bug in order to start contributing.
It was tough...
I felt like a lost child in a big mall. You have so much choice that it becomes overwhelming!

"What if I am not able to fix that problem...", "What if I will be stuck and will not only lose some marks from a final grade but also my confidence as a programmer...", "What if I will have some issues with setting up the environment...", ""What if...", "What if..."

It seemed like I had considered every possible bad scenario.

I did not have a bug and the deadline to pick it was coming up.

I have finally got some courage to ask my professor (David Humphrey) for help. I came into his office and within a few minutes he told me where to go, what to do, whom to ask!

I got connected with Mozilla Debugger's team trough their Slack channel. I got my chance to polish my React skills and get involved in Mozilla's large and friendly community!
Almost immediately Jason Laster has contacted me and suggested to start with this bug. At the same day earlier Dave was discussing how Jason was helpful and assisted my classmate in submitting his first bug!

Even though I am still a bit confused about a lot of things, it is nice to know that there are people who are ready to hold your hand when you are doing your baby steps!


Sunday, September 24, 2017

Find your perfect IDE

I am the person who learned C and C++ using a good old plain vi...
Quite a few of my friends who helped me in my C++ journey we begging me to get some other IDE and even offered to install some. 

And finally I just gave up and got Visual Studio. I have used VS quite a lot from the moment I have actually wrote my first "Hello World" long long time ago. I have used VS 2005, 2008, 2010, 2013, 2015 and
now I am quite a fan of Visual Studio 2017.

It's hard to get started with Visual Studio, but as soon as you get familiar with all the features you can benefit from those a lot and increase your productivity! I guess, the only disadvantage of Visual Studio is that you need a license to use it and it's available only for Windows Users. 

The next IDE that I love is IntelliJ IDEA. This IDE was a dramatic upgrade for my Java course. I am thankful for my friend who have recommended it to me about a year ago. The first nice thing is that you can get a free version. 

One day I was writing a function for my assignment and next to it's title has appeared a yellow bulb. IntelliJ has suggested me to modify the function into lambda function. I thought: "Ok, I can rewrite it" and the button "generate lambda function has appeared". Being a heavy vi user I didn't think it would be that easy and I thought I would have to modify it. But the generated version was just perfect! It was the happiest day in my programming life and Java course was one of the easiest ones so far.
I have also used Visual Studio Code quite a lot recently. Good news! It's easy to use and it's free! VS Code includes all the features you need to have to write, compile and debug code! And it's available for all operating systems!
Here are some life-hacks for VS Code fans:




1. How to open VS Code from command line(Windows)?
Open command line => type "code ."
















2. How to search for a phrase in all your project's files?

















3. How to search for a phrase in on file?
Ctrl + F

















4. How to split the screen into 2+ editing windows?



Wednesday, September 20, 2017

The MIT License: Layer vs Developer


In an open source class professor have suggested me to read the plain MIT License and then compare my thoughts to the article written by layer with line by line explanation of the license.
I feel like this is going to be an interesting experiment since I Am Not A Layer.

The first thing that I missed reading MIT by myself was a structure of the license. It is quite interesting, because quite a few other licences I saw follow the same structure. And luckily to me, Kyle E. Mitchell, the author of this blog-post did. I think it is important to highlight it here:
  • Header
    • Licence Title
    • Copyright notice
  • Licence grant: "Permission is hereby granted..."
    • Grant scope: "... to deal in the Software..."
    • Conditions: "... subject to ..."
      • Attribution and Notice: "The above ... shall be included ..."
      • Warranty Disclaimer: "The software is provided 'as is'..."
      • Limitation of the Liability: "In no event ..."
Along with the structure Kyle also covered a bit of history which I found extremely interesting, again here is a link for you to read the full article.

Another interesting part was an explanation of Grant scope phrase("to deal in the Software without restriction"), the layer has explained it as "intentionally broad and open-ended". Apparently it gives more freedom for licensee.

To sum it all up, the MIT License grants permission to use and even sell Software and at the same time protects licensors from liability. Still that's one of the most popular and widely used license nowadays.

Is it easy to compile source code?



Starting from the previous week I have worked on compiling Mozilla Firefox (v 55.0.3) source code.
The first thing I did was getting a hard drive. After my professor has scared me with 40 Gb of source code I had to order it. 

Later on I figured that 40 Gb is a whole history of all the versions, bug fixes and changed front-end.
The version I got from this website is less then 2 Gb, so don't get scared! 

I have been following the instruction on Mozilla Developer website. Fortunately, I have had Visual Studio 2017 on my laptop with almost all the required C++ packages. Next step was downloading and setting up Rust.


And then the fun begins with opening a terminal from start-shell.bat from mozilla-build. The few commands you type: "mach bootstrap" and "mach build".

It takes a bit of time, but as soon as the build is ready, you just hit "mach run" and voila... you got a home-build version of Firefox(that's what they say in the documentation).

In reality the fun part is only about to start... You will have to deal with quite a few errors.


One of the issues I have had was the Rust error: "error[E0463]: can't find crate for 'std', note: the 'i686-pc-windows-msvc' target may not be installed".

The solution for that was a command: "rustup target add i686-pc-mingw32".
Quite a few of my classmates got some issues with Rust version, environment variables and executable files. So keep in mind that it won't necessary be an easy journey, but definitely you will get a lot of valuable experience.

And at the very end it's all worth it, since you got an excellent feeling of accomplishment and confidence as a programmer!




It's only a beginning

What have I learned for the past 8 months of Open Source Programming? I was convinced from the very beginning that this course would be i...