Skip to content

Perpetual Enigma

Notes from the Frontiers of Mathematics

  • Home
  • Archives
  • About

Tag: C

Why Do We Need size_t?

January 3, 2015 ~ Prateek Joshi ~ 7 Comments

In statically typed programming languages, datatypes play a very important role. Some of common datatypes are int, float, char, double, etc. Different datatypes have different functionalities and we use them depending on our requirements. In modern C++ code, the type "size_t" is used a lot of instead of int or unsigned int. It appears in … Continue reading Why Do We Need size_t?

The Cost Of Abstraction In Python

November 23, 2014 ~ Prateek Joshi ~ Leave a comment

People who have been coding for years will tell you that abstraction is always a good thing. It makes the system more robust and tolerant to future changes. Recently, I've been working on some Python libraries that wrap C extensions. While working on those libraries, a couple of interesting things came up.This blog post is … Continue reading The Cost Of Abstraction In Python

Why Is Python Slow?

November 8, 2014 ~ Prateek Joshi ~ 3 Comments

When people talk about speed in the world of programming languages, they usually center the discussion around compiled vs interpreted languages. In this post, we will discuss two of the most famous languages on this planet, Python and C. I was recently playing around with this and I made a few pleasant discoveries. So I … Continue reading Why Is Python Slow?

Functors In C++

November 1, 2014November 1, 2014 ~ Prateek Joshi ~ 2 Comments

When you look at the word “functor”, the first thing that comes to mind is that it looks very similar to “function”. The word actually comes from a field called category theory, which is an abstract branch of mathematics. A category basically consists of objects that are linked to each other in certain ways. This … Continue reading Functors In C++

Exploring The Hidden C++ Features

September 27, 2014 ~ Prateek Joshi ~ 2 Comments

People have been using C++ for a long time now and most of us think that we are pretty well versed with it. Interestingly enough, as we spend more time with something, we keep discovering more things about it. I love it when the thing you have been using for so long turns out to … Continue reading Exploring The Hidden C++ Features

What Is Tail Recursion?

August 11, 2014 ~ Prateek Joshi ~ Leave a comment

Programmers deal with recursion all the time. It's actually quite a nice concept, but not a lot of people use it because of the mystery associated with it. To be honest, there's no mystery as such! Sometimes, a problem is too complex to solve because it is too big. If we can break the problem … Continue reading What Is Tail Recursion?

What Is Pointer Casting?

August 2, 2014 ~ Prateek Joshi ~ 2 Comments

We all know how important pointers are in C++. A pointer is basically an object that contains an address to a variable. We can use this address to access the value stored in that variable, and that variable is located somewhere in the memory. It's like how we use an address to locate someone in … Continue reading What Is Pointer Casting?

What’s The Use Of Function Pointers In C++?

July 6, 2014 ~ Prateek Joshi ~ 3 Comments

When we talk about C++ programming, functions and pointers are very important. A function is basically a series of steps packaged into a nice unit. A pointer is an object that refers to a value stored in memory. So why not just combine them and create something really useful! Function pointer is exactly what you think … Continue reading What’s The Use Of Function Pointers In C++?

Using Hash Function In C++ For User-Defined Classes

June 5, 2014November 21, 2014 ~ Prateek Joshi ~ 10 Comments

If you are a programmer, you must have heard the term "hash function". In its most general form, a hash function projects a value from a set with many members to a value from a set with a fixed number of members. We basically convert the input into a different form by applying a transformation function. … Continue reading Using Hash Function In C++ For User-Defined Classes

ifdef and ifndef

February 7, 2014 ~ Prateek Joshi ~ 3 Comments

If you have worked on a large code base before, you would have seen ifdef and ifndef statements a lot of times. In fact, it is a good practice to have them wherever necessary. It just adds more robustness to your code and if you are working in a team, it helps you avoid weird … Continue reading ifdef and ifndef

Posts navigation

Older posts

Number of views

  • 2,721,420 views

Number of countries

210 countries

Enter your email address to follow this blog and receive notifications of new posts by email.

Blog at WordPress.com.
Perpetual Enigma
Blog at WordPress.com.
  • Subscribe Subscribed
    • Perpetual Enigma
    • Join 601 other subscribers
    • Already have a WordPress.com account? Log in now.
    • Perpetual Enigma
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
Loading Comments...