Declarative programming is a paradigm of expressing the logic of a computer program or computation without explicit describing its control flow.
Questions tagged [declarative]
365 questions
193
votes
18 answers
What is declarative programming?
I keep hearing this term tossed around in several different contexts. What is it?

Brian G
- 53,704
- 58
- 125
- 140
61
votes
10 answers
Very simple, terse and easy GUI programming “frameworks”
Please list GUI programming libraries, toolkits, frameworks which allow to write GUI apps quickly. I mean in such a way, that
GUI is described entirely in a human-readable (and human-writable) plain text file (code)
code is terse (1 or 2 lines of…

sastanin
- 40,473
- 13
- 103
- 130
57
votes
5 answers
WPF without XAML
Architecturally, I think WPF is pretty amazing. In general, I'm a big fan of the underlying rendering/animation inner workings. The flexibility of the templating and styling set up is pretty impressive.
But I loathe XAML - I feel like it complicates…

J Trana
- 2,150
- 2
- 20
- 32
55
votes
14 answers
suggestions for declarative GUI programming in Java
I wonder if there are any suggestions for declarative GUI programming in Java. (I abhor visual-based GUI creator/editor software, but am getting a little tired of manually instantiating JPanels and Boxes and JLabels and JLists etc.)
That's my…

Jason S
- 184,598
- 164
- 608
- 970
50
votes
3 answers
SQLAlchemy: a better way for update with declarative?
Let's say I have a user table in declarative mode:
class User(Base):
__tablename__ = 'user'
id = Column(u'id', Integer(), primary_key=True)
name = Column(u'name', String(50))
When I know user's id without object loaded into session, I…

Hadrien
- 1,479
- 2
- 14
- 18
32
votes
8 answers
Is there a declarative way to transform Array to Dictionary?
I want to get from this array of strings
let entries = ["x=5", "y=7", "z=10"]
to this
let keyValuePairs = ["x" : "5", "y" : "7", "z" : "10"]
I tried to use map but the problem seems to be that a key - value pair in a dictionary is not a distinct…

Earl Grey
- 7,426
- 6
- 39
- 59
30
votes
3 answers
SQLAlchemy update if unique key exists
I've got a class:
class Tag(Base, TimestampMixin):
"""Tags"""
__tablename__ = 'tags'
__table_args__ = {'mysql_engine' : 'InnoDB', 'mysql_charset' : 'utf8' }
id = Column(Integer(11), autoincrement = True, primary_key = True)
tag…

Nemoden
- 8,816
- 6
- 41
- 65
28
votes
1 answer
Dynamic Class Creation in SQLAlchemy
We have a need to create SQLAlchemy classes to access multiple external data sources that will increase in number over time. We use the declarative base for our core ORM models and I know we can manually specify new ORM classes using the…

PlaidFan
- 797
- 11
- 20
27
votes
5 answers
SwiftUI: ObservableObject does not persist its State over being redrawn
Problem
In Order to achieve a clean look and feel of the App's code, I create ViewModels for every View that contains logic.
A normal ViewModel looks a bit like this:
class SomeViewModel: ObservableObject {
@Published var state = 1
//…

KonDeichmann
- 878
- 1
- 8
- 21
25
votes
1 answer
How to put extras_require in setup.cfg
setuptools 30.3.0 introduced declarative package config, allowing us to put most of the options we used to pass directly to setuptools.setup in setup.cfg files. For example, given following setup.cfg:
[metadata]
name = hello-world
description =…

kojiro
- 74,557
- 19
- 143
- 201
21
votes
3 answers
How to create a single table using SqlAlchemy declarative_base
To create the User table I have to use drop_all and then create_all methods. But these two functions re-initiate an entire database. I wonder if there is a way to create the User table without erasing (or dropping) any existing tables in a…

alphanumeric
- 17,967
- 64
- 244
- 392
19
votes
3 answers
SQLAlchemy - order_by on relationship for join table
I'm using declarative SQLAlchemy and I have three models: Role, Permission, and RolePermission. In my Role model, I have the following:
class Role(Base):
name = Column(u'NAME', VARCHAR(50), nullable=False, unique=True)
permissionLinks =…

Sarah Vessels
- 30,930
- 33
- 155
- 222
19
votes
4 answers
problem assigning declarative values in asp:hyperlink. error: this is not scriptlet. will output as plain text
I am trying to do this:
But am getting the error:
this…

Peter
- 5,251
- 16
- 63
- 98
16
votes
4 answers
Simplest jQuery validation rules example
The following HTML form successfully utilizes jQuery's form validation, displaying "This field is required" to the right of the form field if left blank, and "Please enter at least 2 characters" if fewer than 2 characters were entered. However,…

Dexygen
- 12,287
- 13
- 80
- 147
16
votes
4 answers
Dynamically add HTML to ASP.NET page
Could someone please advise what the "correct" method is for adding HTML content to an ASP.NET page dynamically?
I am aware of the following declarative method.
//Declaration
<%= MyMethodCall() %>
//And in the code behind.
protected String…

Maxim Gershkovich
- 45,951
- 44
- 147
- 243