unownone / Fast-online-compiler

Fast Online Compiler is an API based Code Compiler/runner running on the cloud!
https://unownone.github.io/Fast-online-compiler/
11 stars 5 forks source link

Implement DRY principle in `app/compile.py` #4

Open unownone opened 2 years ago

unownone commented 2 years ago

Summary

The code we use to compile/interpret code snippets have not followed DRY (Don't Repeat yourself) Principles that well . A more functional( or OOP based , functional preferred though) approach towards compiling a code sample ( optional ) and running a code sample would yield a better code reusability metrics.

It should also help us cover more ground , i.e. support more languages.

Hints:

This can be achieved by breaking down compilation and running into two different functions followed by one function that will take in the language and code snippet, which would decide what needs to be done for the given language.

LyubomirT commented 1 year ago

Hello! I created a fork of your repository with my attempt to implement this. Please review the fork repository and let me know if I can open a pull request with the changes.

unownone commented 1 year ago

hey @LyubomirT great going buddy! can you already create a Pull request ? Then I can easily give you all the feedback and also review your code easily!

LyubomirT commented 1 year ago

Alright. The Pull Request's ready, you can find it here: #14

I am excited to be contributing to this project! I'm looking forward to your feedback and any suggestions you may have.