Tag Info

Hot answers tagged

113

Update: this answer seems to be pretty popular so I took some time to clean it up a little bit, add some new info and clarify some things that I thought was not clear enough. Most of your concerns are really a matter of opinion and personal preference but I'll try to answer as objectively as I can: Native vs. Compiled Write JavaScript in vanilla ...


92

Because saving HTTP requests is of little use when you achieve it by breaking caching. If the stylesheets and scripts are served separately, they can be cached very well and amortized over many, many requests to wildly different pages. If they're mushed in the same HTML page, they have to be re-transmitted with every. Single. Request. This page's HTML, for ...


89

Free Functionality Properly using <label>s means you can click the label to enter the text field. Many browsers will add logical default functionality to many tags per the official specification, meaning you can use less JavaScript plugins and write less code than a site made entirely out of <div>s and <span>s. Accessibility Related to ...


79

Specification says UNIQUE HTML 4.01 specification says ID must be document-wide unique. HTML 5 specification says the same thing but in other words. It says that ID must be unique in its home subtree which is basically the document if we read the definition of it. Avoid duplication But since HTML renderers are very forgiving when it comes to HTML ...


74

HTML and CSS are difficult to interview for a few reasons: They are too basic, compared, for example, to a programming language, They depend very much on the context of the job. Examples: If you create Google scale, hugely fast and optimized websites, the people you interview for the job cannot ignore what CSS sprites are. If you create XHTML W3C valid ...


74

I believe you are looking at the problem the wrong way - you are missing a great opportunity of teaching the juniors how to write better code. If you habitually re-write their code, you might give your juniors the impression that you don't value their work, which will lower their morale, and not help them code better the next time. A better approach, I ...


68

You should build a house first, then paint it. An HTML document can stand on its own, even though it may look dull. A CSS style sheet cannot; it is nothing displayable (except as code) but instructions for display. It’s a different issue that during painting, you may wish to do changes to the house. With real houses that’s usually not feasible, but in ...


59

Last summer, I read the complete HTML5 specification, and every previous HTML specification (even the abandoned ones), and all CSS specs I could find, and a lot of XML specs. Since I love semantically rich hypertext documents, let me give you the idea behind the relevant HTML semantics in HTML5. Before HTML5 Before HTML5, i and b were indeed deprecated. ...


53

As Doval says, they are not deprecated. They still exist but should be used differently from what many people where used to before HTML5. It's about 'semantic' html. It should describe 'what' it is, instead of how it should look. The browser or theoretically any other display medium (say a reading app for the blind) should be able to decide how exactly ...


52

This is a fascinating question. The other answers here are all speculative, and in some cases flat-out incorrect. Instead of writing my opinion here, I actually did some research and found original sources that discuss why delete and put are not part of the HTML5 form standard. As it turns out, these methods were included in several, early HTML5 drafts (!), ...


51

HTML5 is not a single integrated thing. It's a collection of extensions to HTML, some of which are widely-implemented and can be used safely, some of which no-one implements yet, and a whole lot in-between. If you try to treat HTML5 as a coherent single development platform and ‘learn it all’ you will have a really difficult time. Instead what you need to ...


50

No, this is not a good practice. You should use already semantic, meaningful tags -- perhaps <em> in this case -- and apply CSS styles to achieve your design requirements.


42

If I were to start a new HTML5 project from scratch right now I would probably do something like this: Download and use the HTML5 Boilerplate. This will give you a fresh page with most of the important things initialized and ready for testing. Also includes some nice debugging features you should be using along with firebug Look over Dive in to HTML5 to ...


32

You don't have to learn JavaScript and HTML to create web applications. But you will. If you really want to write webapps in mostly Java, have a look at the Google Web Toolkit, which does vast amounts of Java to JS, and can satisfy a good chunk of the code needed for a webapp. Django is a similar framework for Python. And if you really want to avoid ...


32

There is no way to avoid that. They are coupled because they interact with each other. If your javascript intends on doing any kind of DOM manipulation, then it needs a way to reference the DOM. There are various conventions for it. The Level 2 DOM API provides the getElementById, getElementByTagName, and getElementsByName methods. To this day these are ...


31

Not anytime soon. The era of WYSIWYG editors is long over (like the dinosaurs) but companies continue to pump it out. I remember the days of using Dreamweaver and having dozens of spacer.gif images to put the layout in the same way. Software like this is fool's gold - it's meant to appeal to people who want something quick and dirty (tomorrow as opposed ...


31

The true story is that b and i were first obsoleted, deprecated, cursed, and anatematized as “presentational” in various HTML5 drafts (broadly speaking), but then they realized that these tags are widely used and also generated by many authoring programs. Instead of simply allowing them, they developed contrived new “semantic” definitions for them, to be ...


29

Because making best guesses is the right thing to do, from a browser-maker's perspective. Consider the situation: ideally, the HTML you receive is completely correct and to spec. That's great. But the interesting part is what happens when the HTML is not correct; since we're dealing with input from a source that we have no influence on, really, we have to be ...


29

I have said this before and will say it again "working code is more valuable than pretty code". If you change code the chances are high that you will change its behavior, if this is tested code then you have just invalidated all the testing effort, and will need to repeat the tests. By all means encourage your juniors to write clean understandable code, ...


28

Former Designer here, turned Dev, and I used to piss and moan about Web Controls too. Honestly, its MUCH cheaper for a designer to adjust their practices than for a .NET Developer to delve into a custom impelmentation of a GridView because the designer INSISTED that each TD have a 'rel' tag (or whatever). As MainMa very wisely pointed out, the decision to ...


27

The reason is simple: At the time of the first graphical browsers, NCSA Mosiac and later Netscape Navigator, almost all HTML was written by hand. The browser authors (Netscape was built by ex-Mosaic folks) recognized quickly that refusing to render incorrect HTML would be held against them by the users, and voila!


26

Today, in our work as in our life, it is more important know how to find information rather than know the information itself. I mean that a good developer is a person able to find documentation, network, and that share with an open mind. I am an experienced .NET developer and, believe me, for every project I work on I have to learn new things about the ...


25

Nope, sorry. Even if you could, users could just submit the form to your site using some other tool. The golden rule here is: Never trust user input. Be sure to validate everything on the server side (in php) and look up any important values from your database instead of trusting whatever came from the user.


23

I would recommend reading How Did We Get Here?. Mark Pilgrim gives an excellent and brief history of HTML up to HTML5. Essentially though, my understanding is that many webpages don't even take advantage of the "X" of XHTML because they don't specify the proper MIME type for it.


23

I have used this technique exclusively for a web application we're working on. My backend is hosted on Google App Engine using the Java SDK, and my frontend uses HTML, CSS, and JavaScript (with jQuery). The project is a smaller one with just myself and a Web designer, and we both feel that this method has helped us work a lot faster and get something to ...


22

I think the problem is that you are comparing cleanly written server side templating to badly written ad-hoc client side HTML generation. Of course the cleanly written code is easier to read, maintain, and trace. You call the client side code "mounds of HTML", but of course it's the same HTML wherever it's generated. The "mound" is really the big lump ...


21

Adobe already did it with Adobe Air, and Mozilla too with Prism . Google also tried to bridge the gap between desktop and web with Google Gears. But in general, web technologies are not suited for many types of desktop applications, here some reasons why: No immediately available full hardware access. No low level system access. No easily available ...


21

The key part of OP's post is the following line. 1st year (freshman) students who don't necessarily have any programming knowledge or know how the web works. I've worked with similar students and I've learned a few lessons, hopefully these can help. Keeping that in mind, I have some other suggestions for Iain. 1. What is the Goal for the course? You ...



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