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?

C#
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.
10,279 questions
0 comments No comments
{count} votes

Accepted answer
  1. YASER SHADMEHR 781 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

    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

    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.

    0 comments No comments