Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6073483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:16:32+00:00 2026-05-23T10:16:32+00:00

I have been trying to make a decision which approach to take to build

  • 0

I have been trying to make a decision which approach to take to build UIs: programmatic or declarative. I am using JavaScript and web technologies. In some projects like ExtJS and YUI they have taken a programmatic approach:

var container = new Ext.Container({
    style: 'padding: 4px;',
    items: [
        new Button({text: 'hello'})
    ]
});

container.render(document.body);

Programmatic approach may be a necessity when you need to create view components dynamically(?). It can also be easier to program, at least it feels that for me since I’m used to APIs and code assistants.

However, some technologies like XUL (used for Firefox and Thunderbird UI) are based on declarative approach:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<window id="vbox example" title="Example 3...."
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <vbox>
    <button id="yes" label="Yes"/>
    <button id="no" label="No"/>
    <button id="maybe" label="Maybe"/>
  </vbox>
</window>

There is also a JavaScript GUI framework called AmpleSDK that takes the declarative approach. So, I am left with two choices to choose from, for my JavaScript based application.

Flex also supports declarative UIs, as well as programmatic ones. WFP and Silverlight seem to be focusing on XAML. Also, Open Laszlo seems to use the declarative approach.

Then I see jQuery UI being programmatic, and Dojo Toolkit being something in between the two approaches.

I have a few questions in my mind:

1) Can dynamic (components added in run-time) UIs be implemented solely in declarative manner?

2) Would it make sense to support both approaches, so that one could use declarative style for most of the part and if needed, use programmatic style?

3) Which one you prefer and why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:16:33+00:00Added an answer on May 23, 2026 at 10:16 am

    1) Yes, you can always do something like: elem.innerHTML = “<content>”; Most languages support something similar.

    2) From what I’ve seen most languages support both. My guess is in the end, one variety is just transformed into the other. By not supporting one or the other, the language would limit itself. (I don’t want to use xyz, I can’t write UI declaratively/programmatically).

    3) I personally like the declarative, it tends to get things done in fewer lines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to make a page which combines web.py and JavaScript, and
I have been trying to make custom radio buttons using HTML, CSS, and JavaScript.
I have been trying to make an init script using start-stop-daemon. I am stuck
I have been trying to make graphs using the igraph library in c. I
I have been trying to make radio buttons without the dot which toggles. I
I have been trying to make a function in Haskell to take a ByteString
Using MVC 2 I have been trying to make this record store project. Creating
I have been trying to make an asteroids clone using openGL and have gotten
I have been trying to make a simple web service and have been following
I have been trying to make a stored procedure which autodeletes temporary tables. CREATE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.