1,463 reputation
58
bio website
location
age
visits member for 3 years, 8 months
seen 2 days ago

Feb
26
revised Declaring JS Functions in Two Ways : What's the Benefit?
added 140 characters in body
Feb
26
answered Declaring JS Functions in Two Ways : What's the Benefit?
Feb
24
comment Is there any reason to use the “var” keyword in ES6?
I haven't tried this yet (since I'm not yet writing ES6 code), but it seems that using var as a conscious indicator that this variable is intended to be scoped to the entire function might be a useful "self-documenting" convention.
Feb
8
comment Should I prefer classes or singletons in JavaScript/Node?
I wouldn't design yourself into a singleton design unless the type of object could NEVER have more than one. If you might ever want more than one, then you may as well design an object that you can instantiate more than one of.
Jan
30
comment Why is the Document Object Model the view?
The DOM is the visual representation or visual presentation. Most people would call that the view (what you see and what a user interacts with). It's the Document Object Model to the browser which just means it's the structure that the browser uses to display things, but it's not the data model or object model of your app. Yes, the terminology is a bit unfortunate, but it's not your app's model - that would be something completely different.
Jan
28
awarded  Good Answer
Jan
8
comment JavaScript program design: to what degree should I separate logic and display?
My preferred answer here is that you should assess your immediate goal and any likely future goals you might have with this code and find a design that is clear, concise, extensible in likely directions, yet efficient in implementation. This means you don't go way out of your way to decouple things that are unlikely to need to be decoupled, but at the same time, you pick an intelligent architecture that is easy to understand, implement, debug and produce solid maintainable code with while meeting the needs of your immediate project and any likely follow-on projects.
Jan
8
comment JavaScript program design: to what degree should I separate logic and display?
Javascript, by its nature is NO more coupled to the HTML and CSS than you write it to be. Your Javascript code has no generic coupling to your HTML or CSS unless you make it be coupled. So, I think your supposition here is entirely flawed that by its nature things are coupled - they aren't.
Jan
7
awarded  Nice Answer
Jan
7
answered Is it possible to protect client side algorithms 100%?
Dec
24
comment JavaScript strict mode compatibility
@Izkata - In strict mode, this === undefined in a regular function call. That is different than this === window in a regular function call in non-strict mode. I'm just pointing outa difference between strict mode and non-strict mode. Perhaps you didn't know that Javascript changes the value of this when you make a regular function call.
Dec
3
comment What exactly is the meaning of “node” in Document Object Model (DOM)?
See here: stackoverflow.com/questions/9979172/…
Nov
19
comment how can I minimize my ajax calls to the server while creating a dashboard
Yeah, if you have buggy code, you app won't work - all you have to do is write code that works. There's no inherent reliability issue with distributing data to different parts of your app without making separate Ajax calls. If you are implementing it like a cache, then you may need to implement cache expiration so you get fresh results when you want fresh results.
Nov
19
comment how can I minimize my ajax calls to the server while creating a dashboard
You can minimize the number of Ajax calls by supporting on your server one Ajax call that retrieves all the info you need so only one roundtrip is needed to fetch all the data. If you need to share this info among completely separate modules, then you will have to make something like one central data manager which the modules will get their data from and the one central data manager will actually get the data or return the cached data.
Nov
10
answered How to debug minified javascript on production?
Oct
5
comment Is JavaScript safe?
Much of the web doesn't work with full features without javascript enabled. The wide majority of the public is perfectly fine with any security aspects of javascript being enabled and it enables a much more functional web. So, unless you are building a site that is targeted at the minor portion of users that runs with javascript off, ignore them. I would NOT try to find any wording that tries to convince them to turn javascript on as that element is doing what they want and you can't change their minds. Just tell them that they must have javascript enabled in order to use your web site.
Sep
2
awarded  Yearling
Aug
25
comment What is the “best practice” for converting an external API's data structure?
Again, this is too generic a question. The app should structure its data in what makes the most sense for the app. There are many considerations that go into determining what makes the most sense. How the data must be organized for communicating with an API is only one of those considerations. How the data is used within the app is likely more important, but is just yet another consideration. How the data is stored persistently (if stored persistently) is yet another consideration, security might be another consideration and so on...
Aug
25
comment What is the “best practice” for converting an external API's data structure?
What do you mean "where it should be handled"? The consumer of the API constructs the arguments to an API function themselves. The implementor of the API processes the arguments as the specific implementation sees fit. I guess I don't understand what question you're asking. I'm thinking you need to provide an explicit example that shows several options you might be asking about.
Aug
25
comment What is the “best practice” for converting an external API's data structure?
This seems like far too generic a question. The right structure for sending data to an API depends upon a whole lot of things that are specific to the data, the application, how the data is normally consumed, how the data is transmitted and the specific API function, etc... For example, a Javascript API takes arguments and objects with properties, but a REST API requires most things in string form which may mean JSON.