[Today I Found] native coding vs. supported from libraries?

Today, I have a challenge that I need to trigger JS function at the end of chained of process, to click on an item menu (alert) on GUI to expand it. This JS function is available to use. I thought that I can watch on the status of alert to make the trigger decision or not. Technically, I will save the old alert status, then end of process, I will check if any different between old and new status, I will trigger JS. The questions are when and where we will execute it.

I was thinking about callback and track the status in back-end. Unfortunately, this callback supported from current framework is executed before the action I want to do it first. So if I want to continue with this solution, I have to introduce a new callback, and make sure that it’s the last one be executed.

The second solution is I will always trigger JS, then calculate the alert status in front-end.

Note that I have only 4 hours to complete it.

This is a content of  a small debate between me and my friend. Should we use pure Javascript coding or using Java and supported java-libs? We raised some points to consider about this

Java Javascript
complicated algorithm introduce callback

tracking alert status by object (supported from libs)

no callback

same algorithm

familiar yes no
timting problem with callback. the rest is no problem time to learn about array, hash code of object

After all, JS is better solution. But I tried Java solution before because I was afraid of timing and familiar of Javascript.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s