7
votes
Should I stop using jQuery and create custom abstractions?
Custom abstractions should feel custom. That is, they should take advantage of knowing your particular needs. Without that you’re simply replacing a well known library with an obscure one that has ...
7
votes
Accepted
How to process large image with a minimum time lag
I cannot and will not recommend any libs or frameworks for this, but if you are willing to implement a system by yourself, here is a simple outline of what might work:
send the image to the server and ...
6
votes
Accepted
I keep bouncing from "god function" to "tiny SRP functions" how do I break this cycle?
What you need is a new abstraction.
Simply pulling out common bits of functionality ends up creating a mess. You need to find a brand new way of looking at your problem that enables you to extract ...
5
votes
Accepted
Why JS MVC frameworks prefer data binding to UI element reference?
The purpose of data binding is to decouple the view from the model. Neither the model nor the view should know about each other. Data binding is the glue that connects the model to the view and ...
5
votes
Hosting a static website containing JavaScript/jQuery
There is a difference between hosting static .js files that are served to clients, and running a JS program on the server to generates dynamic files in response to requests.
The services you are ...
4
votes
How to impersonate user in web app?
Update to your update.
So I am looking at building something into my web page that allows the business user to pick an end user from a list of names, then pass that login name along to the web ...
3
votes
Are there standards for handling card swipers in applications?
Not really, no. At least, not outside of the fact that there are three tracks to read from, and each has a maximum number of bytes they can hold.
While there are standards that are followed, it's ...
3
votes
Accepted
Using CSS classes to express state
Using classes to track state is pretty common, for example - in AngularJS: https://docs.angularjs.org/api/ng/directive/form#css-classes
but - remember that css-classes are easily manipulated in the ...
2
votes
Accepted
Is RSS generation from MySQL server an ideal method for Facebook-like user feed in a website?
RSS is a specification format for feeds. As you said, it's just a specification of an XML document. Since RSS is a specified format, there are many tools that can digest RSS feeds. It only makes sense ...
2
votes
How to declare the need of polyfills publishing jquery plugin (and specially for webpack users)?
First, document the browsers you support. Below that include a section in your documentation about how to support older browsers. Here you can list the features for which pollyfills are required.
...
2
votes
Accepted
Should one-line functions be avoided in jQuery/JavaScript?
I see your coworker's point. You went from repeating a relatively short jQuery expression to repeating an only-slightly-shorter function call. I think this is in the size range where creating a ...
2
votes
Should one-line functions be avoided in jQuery/JavaScript?
In my experience, creating the function hurts readability and provides no benefit.
This is only because the function is extremely short, and because it doesn't provide abstraction.
If the function ...
2
votes
How to process large image with a minimum time lag
If it were me, I would probably implement it locally on the users machine using a GPU-based toolkit like WebGL. This allows you to do the processing very quickly and in parallel. This solves several ...
2
votes
Implementing heartbeat in terms of best practice
Client heartbeat is bad practice.
There's no scenario explanation in your question, but you have to consider: what happens when the heartbeat misses? What's the server supposed to do?
Basically, in ...
1
vote
Implementing heartbeat in terms of best practice
As with many software projects, the starting point is to disambiguate the requirements.
So that I can know who is connected and who is not
Let's rewrite this in a specific way. It could mean
Which ...
1
vote
When should javascript files be loaded
Is there any inherent problem or speed issuewith loading all of my javascript on startup?
Google has some inspections to check if you're loading a disproportionate amount of Javascript before it's ...
1
vote
Does it make sense to use reflection or to hard-code controller parameter names in JavaScript?
It is harder to read, it is also more dynamic.
The real question: Is it worth it?
On the one hand you will spend more time trying to read this code. If this code becomes the de-facto standard (and ...
1
vote
How to process large image with a minimum time lag
Very similar to Doc Brown's answer:
let the user choose the file using dropzonejs or something similar. Do not upload the file to the server yet;
create a HTML canvas that holds a smaller version of ...
1
vote
Should one-line functions be avoided in jQuery/JavaScript?
It's possible that he is right from a pure performance point of view, although the browser can optimize that function call away (based on information like https://www.codereadability.com/performance-...
1
vote
Should one-line functions be avoided in jQuery/JavaScript?
Based on my experience, I agree with you. The proposed replacement introduces a lot of repitition of the element retrieval logic and the data retrieval logic, both of which might be modified in the ...
1
vote
Accepted
handle file downloads from the server
First improve the naming.
As a user if I see a download button, and the file does not immediately start downloading, i'm lodging a support request.
So that first "download" button is more accurately ...
1
vote
Accepted
Is my approach to dynamically populating web content ok?
I'd add this is as a comment if my user rep would allow it BUT my 2 cents:
Rather than making the user's browser do all of the work of replace on all those sections which will slow down the load time,...
1
vote
Support i18n in existing application?
I almost hate to suggest this given my dislike of regexes, but would a regex search for quoted strings work:
/\v"([^"]|\n)*"
I found this one here - Regex to search double quoted strings on multiple ...
1
vote
I keep bouncing from "god function" to "tiny SRP functions" how do I break this cycle?
In what ways will the code vary in the future? Which code will be easiest to add to?
If you are going to have lots of per-item exceptions, then you don't want a full function for each case (...
1
vote
Visitor pattern. Operating on the nodes of a tree
For completeness, I thought I would post what I actually came up with:
//Traverses the SVG tree and invokes userFnc when ever it encounters
//a Basic Shape node
function shapesTraverser( ...
1
vote
Accepted
Is it a good practice to use jQuery object to load scripts onto page?
Use a formal convention such as require.js. For example, to load jquery-ui:
requirejs.config({
baseUrl: 'js/lib',
paths: {
// the left side is the module ID,
// the right side ...
Community wiki
1
vote
ModelState Validation vs JQuery vs Remote
Technically it is possible to do validation almost anywhere. It is the purpose of the validation that determines where you should place it, and if you want a robust, user friendly site/app, then you ...
1
vote
ModelState Validation vs JQuery vs Remote
Validation can be done in many different ways. Each way has its own drawbacks and benefits.
Frontend validation is very quick. It provides the best user experience, since you can provide immediate ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
jquery × 214javascript × 121
ajax × 27
php × 23
html × 23
web-development × 17
asp.net × 15
css × 14
web-applications × 9
html5 × 8
mysql × 7
c# × 6
design-patterns × 6
mvc × 5
json × 5
front-end × 5
java × 4
programming-practices × 4
frameworks × 4
angularjs × 4
plugins × 4
design × 3
architecture × 3
object-oriented × 3
rest × 3