Skip to main content

Questions tagged [declarative]

Filter by
Sorted by
Tagged with
5 votes
2 answers
868 views

Can all business logic be decomposed as a (declarative) state diagram on simple crud operations and conditionals?

This seems an extreme question probably but I'm wondering anyhow: Can all business logic be decomposed as a (declarative) state diagram on simple crud operations and conditionals? Already a lot of ...
0 votes
2 answers
512 views

Should default values be explicitly stated in configuration files for libraries or frameworks?

In one of the projects I work for, we have just added karma to run unit tests. When reviewing the MR of a coworker, I noticed the karma.conf.js (the configuration file) has 120 lines, which seems to ...
0 votes
1 answer
159 views

Determine execution order based on declarative definition?

We want to create a DSL in Scala where you can declaratively list the ingredients that a product consist of. These ingredients can consist of for example "Create product a", "Create product b", "Send ...
2 votes
1 answer
724 views

For Object Oriented Programming purists, are @annotations heresy?

Philosophical Question: An issue that occurred to me is that especially when using frameworks like Spring or Hibernate ( which are everywhere in industry), we have annotate everything. This is ...
1 vote
2 answers
460 views

Declarative parser for JSON and DOM

I am parsing many JSONs and DOMs in PHP. The problem is that the my knowledge about the structure of the JSON/DOM is mixed with code. For example, suppose that I have few sources of first and last ...
28 votes
9 answers
7k views

Declarative programming vs. Imperative programming

I feel very comfortable with Imperative programming. I never have trouble expressing algorithmically what I want the computer to do once I figured out what is it that I want it to do. But when it ...
2 votes
2 answers
2k views

Is recursion a declarative approach to solve the problems?

I have noticed many problems in algorithms textbook are solved by recursion (divide and conquer, backtracking,...) As I tried to enhance my skills in writing them, I have noticed, I just need to ...
2 votes
5 answers
2k views

Is imperative style programming (say with Java/C) more error prone than something more declarative [closed]

I know programmers tend to get defensive with their paradigms and tools that they use. But in your experience, with the most generic, typical pieces of code that you see with Java or C++ or C, is the ...
3 votes
1 answer
129 views

In a declarative language, specifically in the context of modelling, can we make a clear distinction between code and data?

For declarative languages, specifically (but not limited to) in the field of modelling, it's not obvious to me whether code can be considered to be separate from data. This line of reasoning may only ...