DEV Community

Cover image for KWOC | Kharagpur Winter Of Code Project Report.
Tushar Nankani
Tushar Nankani

Posted on

KWOC | Kharagpur Winter Of Code Project Report.

About Me

Hi, I'm Tushar Nankani, currently, a sophomore pursuing Computer Engineering from Mumbai University, and this winter, I worked on a bunch of projects under KWoC.

About KWoC

Alt Text

Kharagpur Winter of Code is a 5-week long online program for students who are new to open source software development. The program not only helps students to get involved in open source but also prepares them for many open-source summer programs, Google Summer of Code being one of them.

Overview of my Contributions:

I made contributions to around 10 projects and I will be taking you through them! I won't take you through the code as it doesn't make sense, I will describe my contributions to the projects, instead.

[ Project Owner / Project Name ]

gif


Codemon

  • Codemon is a CLI tool to ace competitive programming contests on the website - Codeforces.
  • The codebase of the project was Python. It is a very impressive and helpful tool and I have started using it since I regularly give CP contests.
  • I made a PR #65 in which I optimized the code:
    • use a tuple for multiple conditions under one if statement.
    • remove unnecessary use of f-string.

CleanPy

  • CleanPy helps you organizes files in folders and helps you to clean your PC. The codebase is Python.
  • I made a PR #21 in which I refactored the code:
    • remove unnecessary break & pass statements.
    • followed python's flake8 guidelines to improve the code.

Ookla Crawler

  • Ookla-Speedtest.net-Crawler is a python web crawler that fetches more than 25 billion pages of https://www.speedtest.net to fetch download speed, upload speed, latency, date, distance, country code, server ID, server name, sponsor name, sponsor URL, connection_mode, isp name, isp rating, test rank, test grade, test rating, path. The codebase of this was Python as well.
  • Here I made a PR #70 in which I improved code performance.
    • removed unnecessary list comprehension and instead used an in-built python constructor - list(). It is unnecessary to use a comprehension just to loop over the iterable and create a list/set/dict out of it. Python has a specialized set of tools for this task: the list/set/dict constructors, which are faster and more readable.
    • remove self - no use of self, the method doesn't use its bound instance. Decorate this method with @staticmethoddecorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.

MarvellOS

  • akshgpt7/MarvellOS is a basic operating system GUI mock-up built using python's GUI module Tkinter.
  • Here, I made a PR #40 which includes:
    • Opening a file using with statement is preferred as function open implements the context manager protocol that releases the resource when it is outside of the with block. Not doing so requires you to manually release the resource.
    • When comparing a variable to True, one should always use the form if x is True or simply if x. Since boolean in python are singletons, identity checks with is operator is recommended.

TemplateBuddy

  • Documentive/TemplateBuddy is an open-source tool for creating resumes and formatting research papers without hassle. The codebase was HTML, CSS, JS & Python.
  • Here, I resolved a UI issue #39 and improved upon the webpage in the PR #113:

    • change in the UI of the templates. flex-wrap: wrap; would do the job of creating N * 3 templates. This would also make the page responsive Alt Text Alt Text
    • Minor changes in the UX: changed to a more readable and legible font, improved font size, and add transitions and transformations.

Alt Text


newspaper app

  • Rohan-cod/newspaper-app is a web app using Django framework. Frontend using HTML, CSS, Javascript, and Bootstrap. Add articles that can be viewed by anyone. Here I worked on the Python part of the codebase.
  • I made the PR #46 in which I optimized code performance and fixed potential bug risks
    • Add @staticmethods, instead of using self.
    • Remove unnecessary else after return.
    • Remove multiple imports.

todxpy

  • xypnox/todxpy is a simple and easy to use yet configurable todo CLI app built with Python

Alt Text

  • Here, I made a bunch of changes in PR #37 which includes:

    • Changing the default arguments.
      • It is recommended not to use a mutable like list or dictionary as a default value to an argument. Pythonโ€™s default arguments are evaluated once when the function is defined. Using a mutable default argument and mutating it will mutate that object for all future calls to the function as well.
    • Remove unused imported modules [Anti-pattern]
    • Remove unnecessary else / elif used after return
      • return statement causes the control flow to be disrupted, making the else / elif block here unnecessary. This doesn't mean you can not use it, but it is recommended to refactor this for better readability.
    • Remove unnecessary use of comprehension.
    • raise AssertionError is preferred over bare assert statements. Whenever the use of assert is detected, the enclosed code will be removed when compiling to optimized byte code. The assert statement is generally for unit-testing or finding issues during the development process.
    • Opening a file using with statement is preferred as function open implements the context manager protocol that releases the resource when it is outside of the with block.
  • It is one of the projects I can improve upon even after this ends, it has a great future scope.


WildfirePy

  • wildfirepy/wildfirepy is a Python library for Wildfire GIS data analysis.
  • Here, I made a [PR #96] in which I optimize code performance and fix potential security issues.
    • remove unnecessary dict() call
    • It is slower to call e.g. dict() than using the empty literal {}, because the name dict must be looked up in the global scope in case it has been rebound.
    • raise AssertionError is preferred over bare assert statements. Whenever the use of assert is detected, the enclosed code will be removed when compiling to optimized byte code.
      • The assert statement is generally for unit-testing or finding issues during the development process. This does not mean you will necessarily see the error.

hashcode_web

  • inaxia/hashcode_web is an e-learning platform to learn different languages from the best hand-picked courses.
  • The codebase here was HTML, CSS & JS. Here I made 2 important PRs.
  • First PR #11 - add glassmorphism to landing page.

Alt Text

  • I also did some major changes in the UI and improve the **UX**

    • Switched to a more readable font.
    • Navbar changes
      • add transitions
      • remove background hover
      • improve color coordination
    • footer changes
      • increase padding
      • improve hover effect
      • minor fix of mailto
    • Card changes:
      • add box-shadow to the card
      • add transitions when hovered on courses
      • change gif images layout to circular
      • improve the overall user experience

Alt Text

Alt Text


That's it from my end, hope you had a fun read!

gif


My Overall Experience

  • My experience with KWoC was great.
  • Got a lot of exposure:
    • Difference between good, bad, and a well-written codebase.
    • How a project can be maintained effectively.
    • Became fluent with Git and GitHub.
    • I also made a bunch of issues while testing code, that I could not fix but could be addressed.
  • It was a great learning experience for me and not just tech-related, I learned that communication is the key to everything.

I came across a lot of projects, that gave me so much exposure. I will look forward to these projects and more in the future, as all of them have a great future scope. I also look forward to joining in as a mentor in the coming years.

Also, one doesn't need these events that happen in Summers or Winters to contribute. You can start contributing!

And the best time to do it is right now, today, because tomorrow, typically means never.

That's it from my end!

Tushar Nankani
GitHub | LinkedIn

Top comments (0)