87

If you don't know whether you need server-side code, you probably don’t* *Caveat: Server-side code is essential for security, when you want to internally control access to content, data, or functionality. (It does not necessarily need to be your server, see last paragraph.) Ask yourself what problem using server-side technologies would solve. If you can’t ...


56

Read about static site generators. These allow you to create a site in a programmatic manner (using templates, data, etc), and not by hand-crafting HTML. The result is a set of static HTML and CSS that does not require any backend. https://www.staticgen.com/ lists and ranks a number of such open-source generators; closed-source offerings likely exist, too.


36

Wow, this is a simple question, which a huge array of possible answers. The more explicit part of your question asks whether it is more scalable to interface with your database directly or through a web service. That answer is simple: query the database directly. Going through the web service adds a whole bunch of latency that is completely unnecessary for ...


33

Unfortunately there is little you can do. I think you have the answers on your last paragraph. As far as making claims on your web site about other sources - put an app signature on your site, explain than some "less than desirable" sites are listing your apps and it should only be downloaded from <here> or <here>. Do not name or provide any ...


32

Since what you're being asked to do is provide input for your client to write an appropriate proposal to the other client (owner-of-the-nightmare-code) for any work on that code, I'm going to go out on a limb and say that you're not going to be doing any thorough testing or refactoring or anything along those lines at this point. You probably have a very ...


26

It's duty and responsibility of both The basic problems with security tend to have something to do with comfort and overconfidence (e.g. security through obscurity). If you know a way to cover a security hole, do it, there's no such thing as "too much security". ...it's not that hard For example, the Joomla! project team places an empty index.html file on ...


25

The short answer is that the page's client-side Javascript code detects when you get "too close" to the bottom of the page, and asks the server for more data when that happens. Without getting too technical, they are not reloading the entire web page. Instead the Javascript code on that page is requesting more data from the server, then when it receives the ...


20

One big key to understanding what is happening: It is possible, via Javascript, to set the URL in the addressbar without actually redirecting the user. To see this in action, paste the below code into a supported browser's console. Notice that it changes your address bar to http://programmers.stackexchange.com/yay.html. history.pushState(null,null,'/yay....


17

This is is called a subdomain. Subdomains can be routed via the cname entry to a different server so that when the user types in foo.bar.com, the nameserver for bar.com is examined, which reveals the IP address for the foo subdomain.


16

Use JPEG for images with gradients (like photographs) and PNGs for images with flat colors and straight lines (like screenshots). Use GIF only if you need animations for some reason. Don't use BMP. JPEG is lossy, so you get artifacts if you try to use it on screenshots. PNG is lossless, so it looks great with screenshots, but the filesizes get really big ...


15

The warranty is kind of misleading, actually, because it's not issued to the purchaser of the certificate -- it's issued to the users of the site. So say you give your credit card details to a website that's verified by a CA that offers a warranty and the (fraudulent) site takes money from you, then you can use the warranty to claim back the money you lost. ...


14

I was reading about gzip program and I found the official website of the gzip software. No, you didn't. You found the website that used to be the official website back when the original authors were still the maintainers. Now, GNU Gzip is maintained by different people, and the website is https://www.gnu.org/software/gzip/ . First of all the site looks ...


13

For websites that need to be highly scalable such as social networks like facebook, whats the best way to design the website? Measure. I would think the... Bad policy. Actual measurement is required.


13

Nested Tables Aren't Necessarily Bad There are things you can do with nested tables that you can't with CSS and <div>s, especially with regard to re-sizable width layouts. Tables may be old fashioned, but they are more versatile and work equally well on every browser. I personally prefer CSS where it works equally well on every browser and use ...


13

No particular reason at all. It's as arbitrary as "your password may not be longer than 8 characters". It's programmers or product owners that don't know what they are doing. There can be some legacy reason for this, when the authentication system is linked to some credential system that has had certain limitations for historical reasons (something like a ...


12

I'm sorry, but your answer is incorrect. The main reason to use a sub domain would be to maximize parallel downloads, and you could take it a step further if said sub domain was cookie free. From Yahoo's Best Practices for Speeding Up Your Web Site: Split Components Across Domains Splitting components allows you to maximize parallel downloads. Make ...


11

Beware of the Iceberg Syndrome! With an iceberg, the vast majority of it is located under the water, with just a small percentage being visible. Likewise with a website, the vast majority of it is hidden out of view from the user. Changing the site from nested tables to CSS/DIV's will take a considerable amount of time and effort, none of which will be ...


11

Of course not. The factory pattern is useful if you need to encapsulate create-time polymorphism from consumers, that is, you want to provide a transparent point from which new instances of a polymorphic type are created. If the type in question is not polymorphic, the factory pattern is pointless. If a single point of creation doesn't make sense, neither ...


11

The proxy option is the easiest one to implement. You don't have any custom development to do, the only thing to do is to set up a proxy. It's also straightforward: there is no additional code to maintain, and if the API changes, you have no changes to make on your side. A proxy would be a preferred choice: If you need to ship working software fast. This ...


10

It means that they no longer test the site in IE6 and, when it inevitably breaks, they will not make fixing it a priority.


9

Scalablility is not a function of specific implementation strategies but rather of designing your application architecture so that the data access layer can evolve without massive refactoring and rewriting. An important technique in building a system that scales is to understand your high-level data access requirements and build an interface contract around ...


9

Call them and ask them why they aren't using your website. There might be any number of reasons: maybe they have been too busy, are going bankrupt or they really don't know what to do with it. There might have been a disconnect between what they expected you to do and what you thought they wanted done. Discuss it and new work from them might follow or else ...


9

This is basic security. Since HTTP is stateless, even if a user is logged in, the browser still needs to effectively re-authenticate for every single page load (otherwise the server has no way of knowing that this particular user is logged in). The usual ways to do this are via a special cookie, or by including some token in each rendered page (e.g. as a ...


8

I'm pretty sure not many users disable JavaScript. Instead, Flash is the one which doesn't even come built-in with browsers and requires a plugin. That's the new way of making interactive websites. You could look into HTML5, and using the canvas object to create the animations. For the animation, I guess you could use canvas (not very easy for entire ...


8

You pre-calculate the data once in a while (24 hours f.e.) - and cache the result (this can range from a special optimized table to a file cache). No-one will count the amount of books and notice there are only 1800 instead of 2200, it is for indication only and it doesn't have to accurate all the time.


8

We discussed this behavior once among our developers and came to the conclusion that the only valid reason for this could be, to conserve the consistency of the posts. Consider the Stack Exchange sites for example. Sometimes I come across a comment saying: What did you mean by x However, when I read the question 10 times, I don't see x anymore. This ...


6

Why not use GitHub, BitBucket or SourceForge ?


6

It first breaks it into tokens using a lexer. In an expression like 3 + 5, the tokens are 3, +, and 5. Those tokens are fed into a parser, which knows the context and the relationships between all the tokens, and can call the appropriate functions. For example, when the parser encounters the expression 3 + 5, it sees the + token and looks up in a table ...


6

What many high traffic sites do is deploy using a web farm. The general workflow is like this: Take half of the servers off the farm Update these servers and test Put servers back in farm and take remaining servers off the farm Update these servers and test Put remaining servers back in farm If this is no possible, I suggest creating two sites on your ...


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