Latest Ext JS 7.8 is now available. Learn more

How to Solve Issues with JS Frameworks?

February 1, 2022 199 Views

JavaScript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes, etc. — you can bet that JavaScript is probably involved.  It is the third layer of the layer cake of standard web technologies, two of which (HTML and CSS) we have covered in much more detail in other parts of the Learning Area.

Sencha Ext JS is the most comprehensive JS frameworks for building data-intensive, cross-platform web and mobile applications for any modern device.  Ext JS includes 140+ pre-integrated and tested high-performance UI components.

This article will discuss how to solve issues with JavaScript.

How to Solve Issues with JavaScript?

How to Define (Articulate) the Problem in Human Language?

Articulate the issue in a human language, do not worry about the code just yet.  Many times the problem is already stated. Sometimes the wording is a little rough.  So, go ahead and rewrite the problem to make the most sense for you. Read it over a few times to ensure nothing is lost in translation.

Even though you might not have any great insight on how to solve the issue exactly, you can already see these little flashes of light, these tiny light bulbs.  There is already an instantaneous translation into something small but illuminating step closer to your solution.  You will get in that positive feedback loop; it would not be a lot, but you would be getting there. So reformat that issue problem. It would not be quite a pseudocode just yet but phrase it in a way that you can understand and rearticulate the issue.

This would seem small, but it can be a real confidence booster.  Get in that feedback loop, that positive feedback loop, reminding you that the translation to a computer-readable solution is already in play but still in English. Once you are done with this, it naturally oozes into the next step.

Why Should You Iterate and Translate?

Like any other programming task, you will find yourself going over and over the same problem; reading it, absorbing it, assessing it, repeating, iterating. Now it is time to start translating this problem while you are iterating.  Do not let all that brain energy go to waste just by looping through this problem in your head and not getting anywhere like a hamster on the wheel. 

Take action for each iteration; let your human language problem start morphing into a programming language solution, and now that you are morphing this language, it is called pseudocode.  It resembles a programming language, but it is designed to use more human-readable terms to solve your programming problem.

What is nice about pseudocode is that there is no standard; there is no compiler.  Therefore, pseudocode cannot break, and it is totally up to you to form it.  Its purpose is to give your brain a step in translating your problems into code. Now that you have your pseudocode out there, solve this entirely in JavaScript.

How to Solve with Programming Language?

Go over our pseudocode, and hopefully, by this point, your brain has been making some connections to how this should look like a real program.  Then use JavaScript, take what you know from that language and apply it to complete the problem with minimum functionality.  After that, all you should want is to work and not worry about making it perfect and pretty. 

This step may stop you dead in your tracks; even if StackOverflow it, it might stop you slowly in your tracks. If you get to this step and are stuck, what happens if you do not know where to go.  After reading the language documentation or testing some similar code you saw on StackOverflow.  At this point, your eyes might be glazed over you might feel like quitting.  The negative thoughts are starting to drip in this problem; programming sucks; these thoughts are natural, but you do not have to listen to them because we will take a detour.

Why Should You Ask for Help?

This is a collaborative industry; despite the stereotype of unsocialized nerds living in a dank basement cranking out brilliant code on zero sleep, the overwhelming majority of good code results from a concentrated and collaborative effort. Not renegade coders, not I am doing it my way. 

When you are stuck, you are tired, reach out, ask your mentor, ask your discord groups.  When working with your helper, be sure to listen to this person’s feedback and take notes actively.  A lot of this stuff is second nature for them but not for you, so they might be talking a little quickly, jot down what they’re saying so you can reference it later.

How to Get a Working Solution (Refractor)?

After countless hours of thinking and writing, you finally got your program working. So now it is time for an extra round of fortitude testing because number one developers love to hurt themselves in weird ways. Number two, there is only one thing better than solving an issue is solving that issue optimally. Unfortunately, so often, your first solution is not the most efficient. Honestly, what gets most of us paid in this industry is efficiency—communication, actions, and programs.

The technical term for redesigning our program to run better or more efficiently without changing its functionality is called refactoring. So an excellent way to kick off this process is to ask yourself: how else can I solve this? What are some alternative ways? Do not be afraid to experiment and break things; just set aside your original solution in a safe place, play around with a copy of that solution and see what you come up with. You can start by changing function and variable names to something more semantic so that you and other developers who might work on this know what this stuff is. Naming these things descriptively is a self-documentation that makes the development and maintenance process more efficient.

The process involved in solving issues with JS Framework is: firstly, write down the problem, write it in English, segment it, separate it, give your brain some room to breathe with the problem. Secondly, iterate and translate go over the problem again and again. After that, start pseudo coding and get one step closer to the pure programming solution because that will segue you. Thirdly, solving the problem in a programming language. Do not be afraid to reach out if you have trouble with this step. Finally, improve the working solution, also known as refactoring. As programmers, it is our job to solve problems.

This technique can bring us to the solution in a straightforward, logical, and efficient process that helps us do our jobs and improves our problem-solving abilities and confidence levels. You can use Sencha Ext JS, the most comprehensive JavaScript framework build data-intensive, cross-platform web and mobile applications for any modern device.

Do you want to solve issues with JavaScript? Head over to Sencha and explore more.