Jump to content

Modifying a library on github, overwhelmed with the 100,000 lines of code. (Javascript/Coffee Script)

Hello fellow programmers! I'm a slightly seasoned software engineer(3 years professional experience), but my web programming skills are my newest in the arsenal and complex JS/CSS/HTML combinations can still be quite daunting for me to wrap my head around. I'm currently attempting to modify a library called droplet.https://github.com/droplet-editor/droplet It basically allows you to create coding "legos" to drop into an editor. The purpose being for educating young programmers.

 

Basically, I'm attempting to add action listeners for keyboard presses (arrow and enter keys) that will allow users to select these lego blocks and place them into the coding section without a mouse. The purpose being to make the library useful to blind children. I understand basic action listeners in Javascript, but finding WHERE to put these damn things in an existing library seems impossible. The objects (lego blocks) seem to be defined in a plethora of places and the code is poorly commented in most sections. 

 

I'm not asking for someone to accomplish this work for me, after all that is my job! What I am looking for here is some sort of indication as to where in the bloody hell I should even start, and possibly the best/easiest way to go about it. I almost feel like throwing it out and making my own library. (would be easier, but also take much longer than the time I have)

 

Thanks fellas, I look forward to seeing your ideas.

CPU: Ryzen 5950X Ram: Corsair Vengeance 32GB DDR4 3600 CL14 | Graphics: GIGABYTE GAMING OC RTX 3090 |  Mobo: GIGABYTE B550 AORUS MASTER | Storage: SEAGATE FIRECUDA 520 2TB PSU: Be Quiet! Dark Power Pro 12 - 1500W | Monitor: Acer Predator XB271HU & LG C1

 

Link to post
Share on other sites

Not sure how helpful I can be since you sound like you are more experienced than me but personally I'd get an IDE and try to start making sense of everything. Hopefully the developers of that software followed some design principles which can maybe help you figure out what's going on once you realize which they followed. Also speaking of design patterns maybe you can apply some of them to make this an easier task. You're already basically applying the observer design pattern. 

Link to post
Share on other sites

23 minutes ago, ElfFriend said:

Not sure how helpful I can be since you sound like you are more experienced than me but personally I'd get an IDE and try to start making sense of everything. Hopefully the developers of that software followed some design principles which can maybe help you figure out what's going on once you realize which they followed. Also speaking of design patterns maybe you can apply some of them to make this an easier task. You're already basically applying the observer design pattern. 

 

Any thoughts are helpful, even from those with less experience imo. I am already using the Jetbrains IDE to poke around, and indeed I am using the Observer design pattern. However, the code seems very spaghetti like and somewhat hackish in a few areas. I also think there is code that doesn't ever get used, and intelij is pretty bad at finding that kind of stuff in Javascript due to the multiple languages used and string inputs. I appreciate the advise though!

CPU: Ryzen 5950X Ram: Corsair Vengeance 32GB DDR4 3600 CL14 | Graphics: GIGABYTE GAMING OC RTX 3090 |  Mobo: GIGABYTE B550 AORUS MASTER | Storage: SEAGATE FIRECUDA 520 2TB PSU: Be Quiet! Dark Power Pro 12 - 1500W | Monitor: Acer Predator XB271HU & LG C1

 

Link to post
Share on other sites

1 hour ago, Remixt said:

 

Any thoughts are helpful, even from those with less experience imo. I am already using the Jetbrains IDE to poke around, and indeed I am using the Observer design pattern. However, the code seems very spaghetti like and somewhat hackish in a few areas. I also think there is code that doesn't ever get used, and intelij is pretty bad at finding that kind of stuff in Javascript due to the multiple languages used and string inputs. I appreciate the advise though!

Have you considered rewriting everything?

Link to post
Share on other sites

I've not looked at the repository, I don't really have that kind of time to donate unfortunately. But it's clear that you seem to be struggling, what's not clear to me is whether that is due either to complexity in the existing implementation or your own technical inexperience. In any event:

19 hours ago, ElfFriend said:

Have you considered rewriting everything?

As a developer one must always seek to do the simplest and most pragmatic thing possible. If you feel like this would be the easier and most simplest option then you should commit to it. It seems that your instincts have already been telling you something no?

22 hours ago, Remixt said:

l like throwing it out and making my own library.

At least if you did do so then not only would you likely learn a great deal from it but you'd also likely save time maintaining and extending later on.

 

However:

22 hours ago, Remixt said:

would be easier, but also take much longer than the time I have

If you have already performed a critical weighing up of value/time then maybe you really are just going to have to unravel the existing implementation detail (and fill in any holes in your technical knowledge along the way)...

The single biggest problem in communication is the illusion that it has taken place.

Link to post
Share on other sites

When faced with an overwhelming amount of code like this, the easiest way I to understand things that I prefer is to look for existing Unit Tests. Every piece of code that is worth something is unit tested. A proper unit test is granular enough so you can understand a specific API method and how it is supposed to be used (e.g. if you're supposed to configure something beforehand, are there any other dependencies). Also test names are descriptive, you can filter the parts of the API that you are interested in, and that'll get you started.

Link to post
Share on other sites

Hey guys thanks for the responses, I forgot that I had made this post. I'm considering going with my instinct as suggested and just starting from scratch. 

CPU: Ryzen 5950X Ram: Corsair Vengeance 32GB DDR4 3600 CL14 | Graphics: GIGABYTE GAMING OC RTX 3090 |  Mobo: GIGABYTE B550 AORUS MASTER | Storage: SEAGATE FIRECUDA 520 2TB PSU: Be Quiet! Dark Power Pro 12 - 1500W | Monitor: Acer Predator XB271HU & LG C1

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×