My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Introduction to Programming

Introduction to Programming

Pratik Dey's photo
Pratik Dey
·Oct 4, 2021·

2 min read

There are only two kinds of languages: the ones people complain about and the ones nobody uses. -Bjarne Stroustrup

Programming can be a very daunting process and learning to program is pain on its own for beginners like you and me. But fear not as I will be sharing my learnings every day here, so you can learn with me too. But before jumping into Code let's clear up our basics.

Types of Language

  1. Procedural

  2. Functional

  3. Object-Oriented

1. Procedural

  • The procedural language specifies a series of well-structured steps and procedures to compose a program.

  • The procedural language contains a systematic order of statements, functions, and commands to complete a task.

2. Functional

  • Functional Programming is all about writing codes in blocks so that the code can be reused without writing it again and again.

3. Object-Oriented

  • Object-Oriented programming revolves around objects.
  • What is an object? Your code + some data = object.

Static vs Dynamic Language

Static

  1. Performs type checking at compile time.
  2. Errors will show at compile time.
  3. Datatypes are declared before using them.
  4. Gives more control to the developer.

Dynamic

  1. Performs type checking at runtime.
  2. Error might not show till the program is run.
  3. Datatypes aren't required to be declared for the variables.
  4. Saves time in writing code but might error at runtime.

Stack and Heap Memory

Stack and Heap memory management is one of the most important concepts in data structures and algorithms(in java).

How do stack and heap memory management work? Let's suppose you have a value of 10 and you want to store that value for future use. So for storing the value of 10 you assign a variable x. Now, we have something like x = 10. In Java, this variable and value are stored in stack and heap memory respectively and when needed we just call for x.

stack and heap.jpg

More about garbage collection and architecture of Java in the next blog