Data types

 Hi! Today I am going to talk about data types. I hope this will help you with your learning because they are one of the most important things in programming if not the most important.

Data types refer to an extensive system used for declaring variables or functions of different types. The Type of a variable determines how much space it occupies and how the bit pattern stored is interpreted

The data types can be classified as follows :

Types & Description
Basic Types

They are arithmetic types and are further classified into: (a) integer types and (b) floating-point types.

Enumerated types

They are again arithmetic types and they are used to define variables that can only assign certain discrete integer values throughout the program.

The type void

The type specifier void indicates that no value is available.

Derived types

They include (a) Pointer types, (b) Array types, (c) Structure types, (d) Union types and (e) Function types.

The array types and structure types are referred collectively as the aggregate types. The type of a functions specifies the type of the function’s return value.

Integer Types

The following table provides the details of standard integer types with their storage sizes and value ranges −

Type Storage size Value range
char 1 byte -128 to 127 or 0 to 255
unsigned char 1 byte 0 to 255
signed char 1 byte -128 to 127
int 2 or 4 bytes -32,768 to 32,767 or -2,147,483,648 to 2,147,483,647
unsigned int 2 or 4 bytes 0 to 65,535 or 0 to 4,294,967,295
short 2 bytes -32,768 to 32,767
unsigned short 2 bytes 0 to 65,535
long 4 bytes -2,147,483,648 to 2,147,483,647
unsigned long 4 bytes 0 to 4,294,967,295

Floating-Point type

 Type Storage size Value range Precision
float 4 byte 1.2E-38 to 3.4E+38 6 decimal places
double 8 byte 2.3E-308 to 1.7E+308 15 decimal places
long double 10 byte 3.4E-4932 to 1.1E+4932 19 decimal places

Keep on coding! 😉

Starting your C++ training

Hello! Today I want to talk about C++. The main things that I will cover in this tutorial is how to create a new project and how to create your first program.

First of all , in order to learn  C++ you should have installed an IDE, i talked about them in a previous post of mine. To save you the trouble of going back and take a look I’ll tell you what I am talking about. IDE stands for Integrated Development Environment and that’s basically the place where you’ll be writing and compiling your code. For C++ I strongly recommend using Code::Blocks as your IDE.

Good,now let’s suppose you had installed code::blocks and you are ready to go.Open it up and it should look like this :

wordpress codeblocks

Code::Blocks interface

Go ahead and press on the “Create a new project button”,this should open a window where you have to select a template, choose console application

Capture

Selecting template

After you had selected your template press go ,select C++ and name your project. In the left side of the windows you will have a tab that’s called projects.Inside you will find your Workspace where you’ll see the name of your project. Double click it and then go inside sources and double click your main.cpp. The standard template will appear before you and it looks something like this

#include <iostream>

using namespace std;

int main ()
{
cout << “Hello world!” << endl;
return 0;
}

This code will open your console and will open the console and will show the message “Hello world!” or whatever you choose to type between the quotation marks inside. After that you can click on the build menu at the top of your window and click Build and run ,or if you are a person that likes shortcuts more you can press F9,  this will compile and run your program.

I hope you enjoyed it! Keep on coding 😉 !

IDE

As you may already know the abbreviation IDE stands for “Integrated development environment”, but what is and IDE?

An integrated development environment (IDE) is a software suite that consolidates the basic tools developers need to write and test software. Typically, an IDE contains a code editor, a compiler or interpreter and a debugger that the developer accesses through a single graphical user interface. An IDE may be a standalone application, or it may be included as part of one or more existing and compatible applications.

One aim of the IDE is to reduce the configuration necessary to piece together multiple development utilities, instead providing the same set of capabilities as a cohesive unit. Reducing that setup time can increase developer productivity, in cases where learning to use the IDE is faster than manually integrating all of the individual tools. Tighter integration of all development tasks has the potential to improve overall productivity beyond just helping with setup tasks. For example, code can be continuously parsed while it is being edited, providing instant feedback when syntax errors are introduced. That can speed learning a new programming language and its associated libraries.

So, I guess you got the hang of it,but what IDE should you choose?

Well, I got some personal preferences ,for example, when I first started coding I started with C++ ,a procedural programming language, and for that I used Code::Blocks which, in my opinion, had done a really good job due to it’s simplicity and compiling abilities. As for java,there are tons of online integrated development environments but those only compile after you hit compile not while you write your code. When I am coding in java I use their original IDE called Eclipse which does a really great job of compiling while you write and giving you suggestions on how to correct the mistakes you make or on what packages you should import.

I’d say that another amazing IDE is Visual Studio. It is an IDE where you can code in a lot of programming languages ,for example: Javascript, Python, Visual C#,Visual C++, and Visual F#. I am using it mostly for C# which is a good way for anyone to start OOP since it is a clean language that’s quite easy to comprehend. The only downside is that Visual Studio is a paid IDE, if you want to use an IDE for c# i strongly recommend their original IDE from microsoft.

I hope that this article helped you decide what IDE you want to use.

Download links:

Keep on coding! I hope you enjoyed it !

Object Oriented Programming vs Procedural Programming

Hello there!

While I was writing my last post I was trying to think about the first step in learning programming. First I thought it was about starting with an easy programming language, then I thought I should tell you about the basics but in the end I decided that the first step is to decide what kind of programming you want to learn, but in order to decide this you have to know the differences between them and in this post I am going to try and help you pick one,or both, who know.
There are several alternative approaches to the programming process and the most important approaches are procedural programming and object-oriented programming.

Programming Paradigms

First of all, let’s clarify what programming is. Programming is a creative process carried out by programmers to instruct a computer on how to do a task. A program is a set of instructions that tells a computer what to do in order to come up with a solution to a particular problem that the programmer chose to solve. There are a number of alternative approaches to the programming process, referred to as programming paradigms.

Different paradigms represent fundamentally different approaches to building solutions to specific types of problems using programming. Most programming languages fall under one paradigm, but some languages have elements of multiple paradigms. Two of the most important programming paradigms are the procedural paradigm and the object-oriented paradigm.

Procedural Programming

Procedural programming uses a list of instructions to tell the computer what to do step-by-step. Procedural programming relies on….well..procedures, also known as routines or subroutines. A procedure contains a series of computational steps to be carried out.  Procedural programming languages are also known as top-down languages.

Procedural programming is intuitive in the sense that it is very similar to how you would expect a program to work. If you want a computer to do something, you should provide step-by-step instructions on how to do it. It is, therefore, no surprise that most of the early programming languages are all procedural. Examples of procedural languages include Fortran, COBOL, C, C++, which have been around since the 1960s and 70s.

Object-Oriented Programming

Object-oriented programming, or OOP, is an approach to problem-solving where all computations are carried out using objects. An object is a component of a program that knows how to perform certain actions and how to interact with other elements of the program. Objects are the basic units of object-oriented programming. A simple example of an object would be a person. Logically, you would expect a person to have a name. This would be considered a property of the person. You would also expect a person to be able to do something, such as walking. This would be considered a method of the person.

A method in object-oriented programming is like a procedure in procedural programming. The key difference here is that the method is part of an object. In object-oriented programming, you organize your code by creating objects, and then you can give those objects properties and you can make them do certain things.

A key aspect of object-oriented programming is the use of classes. A class is a blueprint of an object. You can think of a class as a concept and the object as the embodiment of that concept. So, let’s say you want to use a person in your program. You want to be able to describe the person and have the person do something. A class called ‘person’ would provide a blueprint for what a person looks like and what a person can do. Examples of object-oriented languages include C#, Java, Perl and Python.

Conclusion

Well, with all that being said I think it’s time for a personal opinion. In my opinion starting with procedural programming is a good choice because it gives you the basics and it helps you to get used to programming and “thinking in code”. I myself started with procedural programming and now I am able to do both but I prefer combining them because there are times when you simply need both of them.

I strongly recommend starting with the procedural programming in order to get used to coding but it’s only a matter of preference.

I hope this helped you decide which type of programming you’re going to start learning first. If you have any questions feel free to ask me.

Keep on coding!

The beginning of the journey

Hello!

My name is Racovita Alexandru and I am a teen from Romania. You’re probably curious about why I decided to start this blog. Well, since i started programming a year ago I encountered various problems and of course looked for solutions and found them but two days ago i was having troubles with a database and of course,  I first went to Stackoverflow because that’s pretty much the best site to look for solutions regarding any programming language and I had to “scavenge” for hours and hours in order to solve my problem. That gave me the idea, I knew I had to start a blog where I can help beginners and more advances programmers/developers so they don’t have to go through the nerve wrecking process to find out how to solve something. On this blog I intend to write about both, the basics and the more advanced things and also try to discuss various topics on programming. I am open for suggestions on what topics I should write about and if there is something I could improve just let me know and it will be done. Feel free to ask me any questions and I’ll be more than happy to try and answer them for you !

Keep on coding!