As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
In various forums and blogs, I see some people promoting HAML and some promoting HTML. What are the advantages and disadvantages of using HAML vs HTML?
I just want to understand what I'm missing out on if I use HAML in favor of HTML (if any).
You are trying to compare Apples to Oranges. Browsers only understand HTML. HAML is just a templating language that gets transformed into HTML (e.g. same final output). If you find the HAML syntax to be easier than HTML then go for it. However IMHO - abstracting away what actual elements you are generating just makes applying CSS and doing JavaScript navigation that much more difficult.
Personally if I wanted to "trim" my HTML, I would put content into tags (depends on your serverside technology)
<!doctype html>
<html>
<head>...</head>
<body>
<x:awesomeListThing data="$foo"/>
<x:foreach data="$bar">
<x:renderBazWidget/>
</x:foreach>
<div>random content that hasn't been "tagified" yet.</div>
</body>
</html>
Then inside any tag's template you'll be able to see the actual HTML structure that is being generated.
On Stackoverflow - HTML has 65k followers. You WILL get an answer, most likely many answers, in a very short amount of time. HAML has 157 followers. Simple math.
The main disadvantage of using HAML over HTML is simply that HTML is just about universal among web developers, where as the HAML community is still a relatively small community. This would undoubtly make finding developers to work on your project in the future a more daunting task.
But if you have the resources, you could argue that to be an advantage. Ensuring you only hired developers that were capable and experience in HAML.
The other major down side I can see is that if you have graphics/web designers working on your templates, separate from your development team, they would also have to be familiar with HAML. As you can imagine there are very few graphics/web designers who capable of it, and few tools to help them.
Google HAML. I am sure, you will get relevant stuff to understand it.
Haml is:
Easy to read and visually expresses your DOM hierarchy
Easy to learn
Ported to other languages
Well-maintained and has a huge community
Popular with designers because it borrows CSS syntax
Almost as fast as plain ERB
Makes many types of error impossible (or very difficult)
See here :
Your attitude to Haml?
When major IDEs (such as Aptana) learn to parse HAML, we can return to the question. Right now I see HTML's superiority in that it's widely supported and understood by common parsers. You get proper syntax colouring and any errors or validation problems get marked instantly. This is not true of HAML.
Additionally, consider web templates. They're usually (X)HTML + CSS, be them ready templates for hire or the designs your designer cuts for you. What are your odds of getting a, say, HAML+SASS template instead of the usual XHTML+CSS?
HAML needs to gain more field and its community needs to grow much more before it's a viable alternative to HTML. Currently most web coders don't even know what HAML is, not to mention writing anything in HAML.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've fooled with many blogging platforms, and develop in Ruby right now...I'm tired of dealing with databases and upgrading applications--so for my personal blog, I'd like to stick with pure html.
Is this a bad idea?
The only dilemma is if I have a lot of entries...
If you were to do something like this (given that you answered 'no' to the previous question), how would you go about formatting it and how would you deal with many entries?
No, it's not a bad idea at all. Reasons to use it:
No need to install a server-side language or anything, or worry about compatibility
Reduces the load on your server
No databases to set up, nothing to debug, just generally lightweight.
Reasons you may not want to:
Duplicated code. If you want to change something about your entire site, it may be difficult to change it in all pages.
But go for it, it's simple and effective. You can name things whatever you want, and backup is as easy as just copying all the files. It works on any kind of server, too.
Have you looked at static blogging platforms like Jekyll?
See minitech's answer, static HTML is good for all the reasons he lists, and also:
improved performance! Servers serve static files REALLY fast, and to well under load
reliability. There's very little to break besides your Apache or nginx.
Without being truly static, I can say that PHP certainly makes a mostly static page highly convenient:
<?php include('/path/to/header.inc'); ?>
<h1>Not much boilerplate</h1>
<p>Considering that only two lines are needed</p>
<?php include('/path/to/footer.inc'); ?>
A number of alternatives can be used. I use one internally that takes advantage of the $_SERVER['PATH_INFO'] variable and parses markdown, with 16 lines of PHP code and PHPMarkdown.
There's nothing particularly wrong with using static HTML for a website, so long as you understand that any site-wide changes will be tedious and slow compared to a dynamic system.
You should read about jeckyl, hyde, octopress and all other static pages generators.
Generally it's not a bad idea and a lot of people are doing this generating their blogs as static pages and adding js commenting via disqus.
Those solutions allows you to pretty quicly change layout, add widgets with latest post etc.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I learned HTML and CSS about 8 months ago, and recently, about 2 months ago I started learning Python and Ruby. I find it much harder/time consuming to understand and be able to put Python and Ruby into practice than it was HTML or CSS.
How is learning/understanding HTML and CSS, and being able to use them different from learning a programming language like Python or Ruby, and being able to put them in practice.
HTML is merely markup. It's more about data and layout in the particular space of browsers and the web. There's not much logic involved. There's nothing like looping or conditional constructs. It helps to know something about HTTP and how browser clients and servers communicate, but that's it.
Python, Ruby, and every other general purpose language out there include those extra complications that involve logic. They span more problem spaces than HTML, so they have to be more flexible and powerful.
HTML and CSS are presentation "languages" - they describe the contents of a document and how it should be presented.
Programming languages like Python, C#, C, C++, Delphi, BASIC, Clojure, etc are different in that they contain logic. You can't do things like branching and iteration in HTML.
HTML is a markup language used to produce documents.
CSS is used to style those documents.
Without Javascript, neither of them remotely resemble a regular procedural programming language like Python or Ruby.
To learn a (regular) real programming language, you need to understand basic programming constructs like variables, ifs, and loops; HTML and CSS have nothing like them.
I may sound strange but for me it was the other way around and HTML was way harder to learn than new programming languages. I learned programming long ago at a time there were no HTML around and grasped basic understanding of a few constructs (conditions, loop, variables, etc). These I found again when learning new languages, so learning new languages became easier and easier.
When I learnt HTML I saw no logic in it. Once you have learn the minimal syntax, all is about keeping in mind a bunch of arbitrary tags and obscure options (and whose behavior change from one browser to another).
I understand that is not the case for most people, probably because HTML is more like a static description of something.
Well, that is not the whole truth. Learning new languages became hard again for me at each change of programming paradigm, say from procedural like C to Object Oriented like Java, to functional like Haskell.
What I'm really saying is that I believe that any change of paradigm (basic assumptions of the domain) is hard. HTML and programming language are really different paradigm (programming arguably more complex as it's about describing changes and HTML describing state). When you go from one paradigm to another you have to learn some basic thruth again and it's hard.
For starters HTML is not a programming language...not by any definition I've ever seen. Let's put it this way...HTML isn't Turing Complete.
HTML is a mark up language. It allows you to associate symantical information with user defined data that can then be interpreted by a web browser for the purpose of displaying the user data.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I think most template engines are hard to use for designers and front end developers leaving you, the programmer with the burden of maintaining them.
And frequently updating the templates after the designer updates the html mockup is a nightmare because your templates are no longer compatible with the original htmls.
I had this problem for very long time, recently I had an idea, but I don't know if I'm not reinventing something or if something better exists.
So, I'm asking if you found better solutions for this problem and if so which one?
Since I've switched to full separation of content from presentation, I've never looked back, and here's why:
Your business logic becomes very clear. Without HTML tags and presentation logic mixed in, the code takes ½ the space and less than ½ the time to maintain. The burden of maintaining the link between code and presentation can be mitigated by specifying a formal interface between the two, even as a text file or a Wiki note, listing all the variables and values presented to/required by the presentation layer.
Frequently updating the templates from designer's changes means that your presentation layer should be sub-divided to various "blocks", such as menu block, page layout block, and content block. On most pages, only the content block is different. When properly divided and implemented using CSS and other modern web techniques, reasonable changes in design will have minimal impact on your presentation code.
CMSes automate this process even further, and are now at the point where even 5-10 page sites can benefit from using a CMS vs. hand-coded HTML from both consistency and ease of support perspectives.
Code security - Smarty is not PHP, so your designers can have a lower level of trust on the site (they can't mess with the underpinnings too much, although they can mangle the presentation to the same effect as a DoS would have, so don't mess with them anyway); if you don't care about security that much, PHPTal and others run almost at "native" speed.
As for my working solutions, I have two recommendations:
Develop a projectwide folder structure and naming convention, and stick to it. Given a name of your business logic file, I should be able to tell you what the presentation files are, and vice versa.
Have an explicit interface spec (again, a text file or a Wiki entry is all you really need) between business logic and presentation. Knowing which vars are available, and how they should be (programmer) / are (designer) formatted, makes both of them very happy when they have to maintain the page a year later.
Yes, but only if they are as close to Native HTML as possible.
Dreamweaver templates (ignoring the editor) basically accomplish this pretty well since they basically markup a plain old HTML (POH™) page with some HTML Comments.
I personally like how some CMS solutions enable me to break my templates into very small pieces. SiteCore does this well through placeholders and renderings which map to usercontrols.
I've also used UserControls heavily in the past to break out common functionality like login, menu, footer links, etc to make it easier to modify or replace functionality in the future. (ASP.NET)
What template-engines are you using? Something like Smarty for PHP?
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
As one of those people that never got around to properly learning design (or having no talent for it), the design seems to be the step always holding me back. It's not a problem for rich-clients, as the standard GUI toolkits provide some acceptable ways to design a good-looking interface, but the web is another story.
Question: Does anyone know of a high-quality framework for designing the interface of web applications? I'm thinking of standard snippets of html for an adequate set of controls (the standard html controls plus maybe navigations, lists, forms) and style sheets to give it an acceptable, modern look. If such a thing existed, it could even support themes in the way wordpress, drupal etc. allow it.
I know of the yahoo yui, but that's mostly javascript, though their grid css is a step in the right direction.
Try the samples on ExtJs.
I find them immensely useful in working out the UI. (trees, panels, modals, etc etc)
I realise this is an old thread but it still comes high up in Google searches so it's worth mentioning that Twitter have recently put out Twitter Bootstrap, a "toolkit for kickstarting CSS for websites, apps, and more" which looks fantastic! » https://github.com/twitter/bootstrap
I'm not sure that what you're looking for exists in the way you're looking for it. However, I've had some luck with places like Open Source Web Design and Open Designs, which have some really slick templates that can be adapted to a web application so they at least don't look like crap.
There are also some commercial offerings, such as Gooey Templates.
Once you're getting closer to launch, you can contact a pro to fix the details for you, or simply build on what you've got.
Edited to add: You might also want to consider learning Blueprint CSS. I've found it helps guide my layouts and helps them look "right", without constraining me to the layout constructed for another purpose.
I'll suggest Google Web Toolkit if you're a Java developer. Examples
I'll also second the suggestion for Ext JS. It's got a vast array of really slick looking UI elements, incredibly well documented code, and a strong community.
You'd probably also find the myriad of Wordpress templates reasonably useful to build on, as Wordpress is at least reasonable at separating content from layout. The also tend to have a modern bloggy feel. Of course teaming up with a talented designer is the ideal way to go in my experience! :)
This will be more than a framework OP originally wanted but I'll suggest having a look at Morfik.
You'll be able to build pretty slick user interfaces with the conventional drag&drop way and with theming support (The homepage itself is built in Morfik). There're numerous other advantages Morfik provides, though let me not drift to off-topic for the subject. You may download the trial and see...
ps. Disclaimer: I'd worked for them.
you can check out this young site, http://guitemplates.com/. The templates are quite clear and modern, and at 20 bucks each they won't break your budget.
We had the same problem so we made our own. CSS UI (http://css-ui.com/), open-source UI framework. The concept is to use pre-defined CSS classes to style any element.
Check out http://jacanasoftware.com. Their templates feature multi level tabs, clean css, it validates, and the CSS won't mess with your controls. I highly recommend them.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I have to choose an online WYSIWYG editor. I'm pending between TinyMCE and Xinha. My application is developed in Asp.Net 3.5. Could you help me with with some pros and cons?
Haven't tried Xihna myself, but I have experience with TinyMCE and FCKeditor. In my company we switched to TinyMce (from FCKeditor) due to the superior support for pasting from word documents and the (relatively easy to work with) plugin architecture which we used to add some custom modules (links browser, simple file browser). TinyMCE also converts the text to xhtml code which is usually better.
I'd recommend FCKEditor over TinyMCE. I've had much better luck with it (better markup, better managers, better extensibility, better speed, better compatibility, etc)
Try SPAW Editor. File Manager is included. Editor is generated from server side code, meaning it's lighter on client side processing.
Of course TinyMCE :)
I found Xinha to be much better and more functional than FCKEditor. If you know PHP and a dab of javascript you can customize the file manager, and there is a lovely set of plugins on offer. I am also impressed with what I have seen of TinyMCE and due to wider adoption you may find it to have more options.
I've never used Xinha, but I can vouch for TinyMCE. It's fast, scales well, and is infinitely customizable. I particularly like the dynamic loading of functionality, which means you only take the performance hit for the stuff you use.
It also includes language-specific compressors to further increase performance (C# is supported, along with PHP, Java and ColdFusion) by GZipping components.
Of course TinyMCE it has more plugins to choose from and its easy to make custom plugins.
It only gives issues with ipad(cause of iframes).