Share via

Declarative vs imperative language

Tes Gam 81 Reputation points
2020-12-27T01:15:24.213+00:00

What is imperative and declarative? Is C# is imperative?

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

Answer accepted by question author

  1. Yaz SHADMEHR 786 Reputation points
    2020-12-27T01:20:29.427+00:00

    C# is imperative.

    Declarative programming is a programming paradigm … that expresses the logic of a computation without describing its control flow.
    Imperative programming is a programming paradigm that uses statements that change a program’s state.

    Declarative Programming is like asking your friend to fix your car. You don’t care how to fix it, that’s up to her.

    Imperative Programming is like your friend calling your father that tells her how to fix your car step by step.

    See more details here

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Dan Stevens 11 Reputation points
    2021-03-11T09:53:21.313+00:00

    Actually it's both imperative and declarative, in that it's possible to use either or both paradigms in the same application. This is especially true since Microsoft introduced features to the language like LINQ and lambda functions.

    Here's a video demonstrating both approaches being used solve a simple problem: https://www.youtube.com/watch?v=htFIXZG3RKM

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

  2. Srikanth Pettem 1 Reputation point
    2021-10-18T02:39:31.723+00:00

    Dear Learner,

    C# is an elegant object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework.

    So, Here I'm concluding for your question - C# is imperative language - As it is more particular about what we need.

    Hope you got my point.

    Regards,
    Srikanth.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.