Tag Info

Hot answers tagged

11

First thing : A pure JS code in a separate file will be cached, reducing the amount of data transfered on each request. Unless you have a very small, page specific JS code, you shouldn't inline it. Other valid reasons are already pointed in Mike's answer. If you have to pass some values from the server to the JS, what you can do instead of injecting JSP ...


7

There are two primary reasons: Separation of concerns - by having the code in a separate file it is separate from the HTML and may be changed without touching the HTML file. If used in multiple places it allows for a single place to make the change. DRY - Don't Repeat Yourself By having it in a separate file you don't have to repeat the code in several ...


4

Other answers have focused on what is client-side and server-side programming: what languages are mostly used, what tasks have to be accomplished, etc. This is absolutely right, but I miss a bit of focus on what are the differences between both types of programming, in the context of web programming. Let me try to address that. Security and permissions ...


3

@Mike and @X.L.Ant's answer already provide some excellent points. I can provide one other point that hasn't been mentioned yet. Ease of Editing & Tool Use - All kinds of things work better when you put your JS in a separate file. Here are some examples: JSHint/JSLint and other static code analysis tools Code beautification like JSBeautify Code ...


3

You need to do it from time to time in development to check that it works correctly and isn't adding any additional bugs. It shouldn't be a step that you're using just in your release process, because that should be happening post-testing. You shouldn't be doing it for every small change you make, but from time to time you should absolutely be checking ...


3

Welcome to the deep, dark recesses of the Concurrency Jungle! This is where many app developers fear to tread--and fear it for good reason. @kdgregory gets it exactly right: This is not one problem, but a very large, very sticky class of problems. Most hard concurrency problems are addressable at scale, with sufficient effort and investment. None, however, ...


2

One approach is to create 2 web sites. One's your normal everyday site: http://www.example.com The other is a copy of the everyday site, except you modify the CSS and make whatever other changes are needed to support your mobile users. By convention, you have your server folks set that up with the address http://m.example.com. Now for the clever bit: ...


2

Without knowing more specifics, it's hard to identify actual problems with your approach. However, based on my experience facing the same issue in the past, I think the biggest thing you can do (aside from hiring a full time front-end developer who specializes in UI design) is to remember that less is more. Take a look at the UI elements that most modern, ...


2

Yes, it can be used. The others have mentioned various approaches. Here is my own approach. The advantage is that it is totally portable and self-contained, all the picked libraries only depend on ANSI C. Setting it up only requires the Linux Kernel and a C compiler (And the obvious stuff like Busybox, bash, etc) (or Windows and a compiler), no extra ...


2

No - there is no harm in using an AWS Elastic Compute Cloud (EC2) instance for your development platform. But you will have to learn some extra skills that you wouldn't need when developing on a local machine how to use AWS Identity and Access Management (IAM), how to use AWS billing (if you exceed the one year free micro instance), and how to use SSH. ...


1

I'd follow the YAGNI approach for this (You Aint Gonna Need It). If you don't need a CDN right now, keep it all on your server. There's no need to carry extra expense and complication for something you don't even know you'll need for sure. Just be sure to code the site and set up the database with the notion that you may do a migration someday in the ...


1

There is no user interface diagram in the set of UML diagrams (up to and including UML 2.5 beta 2) and the engineering best practices vary. The key search terms would be made of: user interface wireframe mockup prototyping UML behavior diagram Some relevant results (unordered): Agile Modeling: User Interface (UI) Prototypes: An Agile Introduction User ...


1

To keep the wording simple let's pretend we mostly cafe about translating text. There are two big decisions to make: Should we decouple the pieces of text visible to the user from the code that uses them (e.g., load them from separate files), so that we can easily swap between different translations? Should we pay someone to actually translate all of these ...


1

This is a very interesting question and I am very interested in what others think as well. I have been using sass for a while now and for the most part I tend not to use the @extend functionality at all. In the case of float left or right everywhere I would probably just make a class .float-left and just add it to the markup that needs to be floated or ...


1

Would it be possible to use an update log approach? That is, instead of directly updating the resource, code would simply write an update entry in a table/queue/whatever-makes-sense and a periodic task (or some other mechanism) applies the updates to the resource. Now you only have lock contention on the log, which should be significantly less than ...


1

It is important to do this in development only if you are not 100% certain that the script-mangling step doesn't introduce errors. Personally, I think using a tool that you can't be 100% certain of to transform your entire code base is unprofessional and you should never do it, but I recognize that getting the job done in the real world sometimes requires ...


1

Firstly ensure that your view logic and domain logic are separate, you can search for "Model View Controller PHP" on Google for more information about this. Once your view is separated from your logic it becomes a simple case of including a different view for mobile devices. There are many libraries for detecting if the client is a mobile browser such as ...


1

Resist the urge to pre-optimize. You say that for most page views only a 3 out of 12 User entity properties are used. Even if 30 properties were used that's still pretty lightweight. I wouldn't spend too much time worrying about performance losses due to unused data being pushed around. It's much more economical in terms of dev effort (read: time and ...


1

There is not such thing as only enterprise web application. In the enterprise world you typically have a full enterprise system, where the web part is pretty small compared to the whole system. There are many systems underneath the web that perform batch processing, queue messaging, enterprise integration, gateways and many more. Event at the top there might ...



Only top voted, non community-wiki answers of a minimum length are eligible