https://github.com/ossu/computer-science
So, it’s the beginning of my #365DaysOfOSSU. First and foremost:
What is OSSU?
OSSU is short for Open Source Society University. It’s a self taught Computer Science curriculum which is a complete education in computer science using online materials. It’s not merely for career training or professional development. It’s for those who want a proper, well-rounded grounding in concepts fundamental to all computing disciplines, and for those who have the discipline, will, and (most importantly!) good habits to obtain this education largely on their own, but with support from a worldwide community of fellow learners.
I joined OSSU almost two months back but I’ve not really been consistent with the curriculum. Every day I’m always coming up with excuses to skip it and just yesterday, I decided it was time to stop skipping and start doing. I started the #365DaysOffOSSU challenge for myself, which will see me attempt and study the OSSU curriculum every day and put up writings on my progress and what I’ve been able to learn for that day.
What did I learn on Day 1?
So, I decided not to start from scratch (the very beginning of the curriculum) because I still understand everything I studied then, I just decided to continue with the curriculum.
Today, I studied more on: C’s data types, Boolean Expressions, Conditionals & Loops.
Data Types:
Data Types are one of the core of any programming language. They provide ways to effectively store data to be used by our software. Presently there are not much data types in the C language, although the language also provides ways to quickly and easily build data types for our own specific use. The data types I was able to look into are:
Integer: So, if you’ve had any form of interaction with programming, you will have heard of integer, which stores numbers, digits. An integer can only take 4 bytes (32 bits). Now, because we have both positive number (1, 8, 3212) and negative numbers (-1, -8, -3212), the size that the integer can take has been divided into two, 2 bytes (2³¹)for the negative side and 2 bytes (2³¹-1) for the positive side.
Char: This is a data type that is used to store a single character. It only takes up 1 byte (8 bits) of memory.
Float: Just like integer, this also is used to store digits, but it only stores decimal digits. It also only takes up 4 bytes of memory space and is prone to precision problems when dealing with larger float set.
Double: Double is a type of float that doubles (just like the name implies) the memory space of a floating point number to 8 bytes (64 bits), this, to a large extent helps solve the precision problem a float has.
=> Unsigned: I would not say specifically that this is a data type, but it works closely with data types by doubling their memory space. For example, marking integer as unsigned deletes the negative part of the integer type and increases the space of the positive side to 4 bytes, instead of the 2 bytes it gets to work with without unsigned.
Boolean Expressions:
I also studied boolean expressions. This, to the best of my knowledge, are expressions that evaluate to either true or false. They are basically divided into two:
Logical Operators: AND(&&) (both sides have to evaluate to true before this can pass), OR(||) (either of both sides just has to evaluate to true before this can pass), and NOT(!) (opposite of the evaluation. if it evaluates true, this becomes not true which is equals false).
Relational Operators: Less than (<), Less than or equal to (<=), Greater than (>), Greater than or equal to (>=), Equality (==), Inequality (!=).
Conditionals:
This helps your software becomes a little conscious and makes very minute decisions for itself.
if: works more like if — this — then — that.
if () {
}
else if () {
}
else {
}
switch: works like if.
switch (x)
{
case 1:
printf("one !\n);
break;
default:
printf("Blast off!"\n);
}
Ternary: a more shorter form of the if/else block
int x = (expr) ? 1 : 2;
Loops:
Want to repeat a block of code more than once? Rather than having to copy and paste the code block for every repetition, loops come into play. Also, loops are even more important for programs where you might not even know how much repetition you need to make before hand.
for loops:
for (instantiation; condition; counter) {
}
while loops:
while (expr) {
}
do…while loops:
do {
} while (expr);
That’s all for today. I started some assignments today but was not able to finish them off. I will be working towards that tomorrow before diving bak into the studies.