Coding Syntax

Hello, how are you? i’m well fine in this saturday, first i apologize if there is any mistake any help or knowledge would be nice. Resuming from my last article, last time we talk about Coding Variables, specifically Java Variables what a discussion we had last time eih?. Now, on this brightful day we will continue our discussion or talk for the #2 thing which is Coding Syntax. On the next article we’ll have a talk about Coding or Programming Algorithm.

Ok, does any of you recognize the word “Syntax”? well maybe some of you already know Syntax, which is the arrangement of words and phrases to create well-formed sentences in a language. It’s a good answer but we need to more specify it a little bit, in computer science Sytax always refers to the grammar and spelling of a Programming or Coding language, now I have gathered information and make a conclusion that Syntax is:
Syntax of programming language are the set of rules that define the combination of symbols in an exact form that the computer expects and considered to be correctly structured programs in that language itself . The expected form is called Syntax (in Computer Science, don’t get confused with general syntax).

In the definition above you’ll see some sentence like “correctly structured” and “symbol“, what does this means? let’s say it that syntax is a certain layout of words and symbols. for example, if you want to acces a certain web page what would you type in the address bar? let’s pretend that you type , www.webhostingallinone.com what would make you so sure that what you type would go to a web page instead to an email address? it’s because of the “www“(that stands for world wide web) and followed by a website domain “webhostingallinone.com” and because it is considered to be correctly structured to the internet and to a web. Well in programming language it’s just the same, there are rules that are set in place when you obey them you will make some kind of functioning program, but beware if you don’t follow the rules and placement, xO error pops up.

So, what about an example of a Syntax, well what about we use our last discussion as the base. In our last talk we make this Variable: 
int first_number = 10;
There are 4 parts of Syntax that needs to be explained here. First, the int, this part stands for the Integer type of variable, remember the String, Integer and Double we talk last time? Integer are suppose to contain whole number, nothing else. Second, the first_number, this part stands for the name of the variable, a variable name could use word and numbers but the only special character it could contain is ( _ ) an underscores, usually in the Java world variable name front letter are lowercase letter, well they don’t have to but that is usually the kind of accepted and sugested convention(in Java world). Third, value 10″ (don’t mind the quotes), this part of the sytax is use to place the value of the variable, since the variable is int then you can only use whole number only. Then, the last part of the Syntax the “;” a semicolon this special characters will always be at a Syntax, because it is the thing that mark some particular segment is complete for the computer to process. There are exception for what I said that semicolon will always be at a Syntax, that is controle structures they uses curly brackets to make the beginning and the end of a segment. Just imagine coding semicolon as a normal period writing, if we don’t put any period the writing will not be structured and will not be easy to read.

When you enter the coding or programming world, you will likely see syntax as one of the biggest battle to master. But, as you see more and more code and introduced to more and more syntax you will get yourself finally comfortable, but this will not be a short journey it will take a step at a time. Well there is a great great good new for the people that see sytax tough, and for so a goe companies (group of enthusiasts, a.k.a nerd or noob (no offense i’m a noob too but slightly improved)). There is hope for us, now companies have made a tools to do sytax thing in coding, those tools are called IDEs or, Integrated Development Environments, which you can download onto your computer most are free like the Java Eclipse and Netbeans I mention in the last post, you can use it to create programs.  These IDEs have built in syntax checkers (much like the grammar checker in MS Word) that will let you know if your syntax is incorrect or correct, and will even give you hints with what it thinks you meant to put!.

Conclusion 

    •  Syntax is a structured combination of word or symbols

    •  Variable example are Syntax example

    •  Semicolon ended a segment except control structure

Give comment, help you and me grow our knowledge together. Tips, Help and Knowledge would really be appreciated. Thank you, see you on another Article.

😀

Java Variables

Hello, how are you doing? well i am very fine indeed in this fresh morning, first i want to tell you that i’m not the master of Coding because i’m still learning, excuse me if I made mistakes so any helpful knowledge would help. Now we’re going to talk about the base of Programming or Coding, specifically in Java. Program or Codes are based out of Variables, Syntax, Algorithm, etc.. (well that is more or less).

Now i’m going to explain the #1 which is Variables.

Variable

Variable are a symbolic name that contains or store information that are going to be referenced and used by the programs, The variable name usually represents what the variable contains. In Java there are 3 types of variable, that is: String, Integer and Double variable, These 3 variable uses different name because it contains different types of Data. The simple explanation is, if you wanna store your name in a variable, the type of variable you use is String. Or, maybe you wanna store you age in the variable, in that case you use Integer. Or even you wanna store how much money you make in a month, that type of data is stored as a Double. Don’t get confused here, you might ask, Why the heck does Java uses three variables instead of just one.Well, good question there, Java is a Strongly Typed Languange. Which means that Typing in Java will be absolute certainity that the information you stored in the variables are in a “certain way”.. so it will be very specific, it will give you error if the stored information does not match the type it suppose to be.

String variable

Just like I say before, if you wanna store your name in a variable which is a String, the informations that is stored would be like this, “Rafif Santika”, a String would make any data treated like an old plain English languange, a String would represents data as a Words (or specifically a Letter). It may come in your life as a programmer, that you would add two sentences or two Strings together. So, what does it means to add two sentences or two Strings together? You see, if you have 2 Strings variable, one of them contains the data “42” and the other one “3”, if you add them together what would you get? if you say “45” , then Great!!.

You’re Wrong!. Remember when I say “a String would make any data treated like an old plain English languange”, it happens to any data that is stored whether it’s a word or a letter or even a number, so the right anwer is “423”. Just imagine if the two Strings contains “Hello” and “World!”

what would happen to them if we add two of them? hopefully your natural instinct would say “Hello World!”(Haha!). The same thing happen to “42” and “3”.. Java behaves or treats the data differently because the different Type of variable.

Integer variable

Moving on to the Integer. Last time we say that if you want to store you age in a variable we use Integer, well that is because, Integer must contains data that is a number that doesn’t contain decimal in it, it would be a whole number like, 4 and 2 and 20 and 3 (that is a secret code about me, can you guess what those number means?) or maybe -4 and -1 and -20 and -3 (that is also a secret code), alll of the number I said up there, it all considered by Java as an Integer. So you need Integer variable to store them, so if you add an Integer to another like this: 42 + 3 it will make a result of 45 (not like how the String works) so if you do this:

(This will be written in Java languange, you could write this in Java Eclipse or Netbeans)

public static void main(String[] args) {

int first_number, second_number, answer; /*first we started with empty Variable*/

first_number = 10; /*then we fill the Variable*/
second_number = 15; /*then we fill the Variable*/
answer = first_number + second_number ; /*last we calculate them*/

System.out.println(“Addition Total = ” + answer ); /*then we output them to the world*/

}

The output result should be

Addition Total = 25;

if your output result is like that, Then you have Suceeded.

Double variable

Last thing, the Double variable. like we also say upthere, if you want to store how much money you make in a month, you uses the Double variable. Let’s just say you make $35.5 a month (it’s just an example) and you want to put it in your Code or Program, well you must know that you need to put it into somekind of variable right? what would you do? and then you wonder “let’s try and put it into the Integer variable” and you put it into the Integer variable, Great!! it’s Wrong!! you’ll get an error then you say “what is wrong? i put it into a variable, i mean it contains numbers right? and Integer are suppose to deal with number” well you’re right about one thing, Integer contains number data, But!! it has to be a specific whole number like 1,2,3… and it cannot contain another kind of data, well it’s right that there is a number you put that, but it contains another data type which is a $(dollar sign) and it contains decimal with two digits of accuracy. “then what am i suppose to do??” well you put it in a Double variable. for example(you could also write this in Java Eclipse and Netbeans) :

public static void main(String[] args) {

double first_number, second_number, answer; /*first we started with empty Variable*/

first_number = 20.5; /*then we fill the Variable*/
second_number = 20.8; /*then we fill the Variable*/
answer = first_number + second_number ; /*last we calculate them*/

System.out.println(“Addition Total = ” + answer ); /*then we output them to the world*/

}

The output result should be

Addition Total = 41.3;

if your output result is like that, Then you have Suceeded at double variable.

Conclusion

  • Java is a Strongly Typed Languange
  • There are 3 types of Java variables
  • Store your name in a String variable (store any word or letter)
  • Store your age in an Integer variable (store any kind of whole number)
  • Store how much money you have in Double variable (store any kind of special number, like decimal, or any symbols like $)

Give comment, help you and me grow our knowledge together. Tips, Counsel and Knowledge would really be appreciated. Thank you, see you on another Article.

😀

Experience and Steps to Begin Coding

 Morning!, Afternoon!, Evening! depending on when you read this post. You see, there is plenty ways or place for you to learn about code stuff, when I say plenty I mean A lot! A lot!. Now i’m going to tell you a story about how I  get myself to the world of Coding or Computer Programming.

It all started in the late 2014, at that time I was at grade 5. It was a suny day, I was playing games at my laptop just like a typical gaming kid, enjoying the one day holiday i had. Then my dad gave me one game that was created by my dad’s friend, it was a simple bug shooting airplane game which was a lot of fun, I even made a review for it on Youtube. Back to the topic, Fortunately my dad and my dad’s friend was a programmer so he (My dad) said to me “Hey, you like playing that game. Well you can make one too!” since that time I got my atention to programming or coding, so I started wondering “How, how can i make games?”. Not long after that my question is answered, my dad gave me a book Called “Javascript for kids” well it was appropriate for a kid of my age.

That book was a book teaching basic to adept Javascript for kids or even average adults, it has 3 parts and 17 chapters, it begins with simple coding like 2 + 2 = 4 and something like that, as you move through the book chapters it gets more and more complex coding. So, I started learning every single thing that was written in the book, at the first I had some trouble with the algorithym and the syntax but as the Chapters move I also began to Level Up I could say, my syntax, my algorithym and my knowledge grows more and more. I learn how to make basic simple games of treasure map until I finally get to make Snake game, remember that game ohh what a classic game. I finally finish making the game and as I finish making it, I also finish my Learning on that book. It took me about 6 months to finish that book and as I finish my book I also get to the next grade which is grade 6.

After that, I started my research on Coding. I watch videos about it, I read programmers biography and one of the biography I read is Bill Gates, the founder of  Microsoft.
Here is one of the video i watch on Youtube that was made by Code.org

 
Video on Youtube by Code.org

 That video make my spirit even higher. You see, in that video they say “You don’t need to be a genius to write codes!” So there is an equal chance for everyone to learn code and SUCEED, it just depends on your passion and your desire. After that I started to take learning on Code.org (By the way it’s free for everyone) taking my skill to a higher level, in Code.org I start learning on the Hour of code it’s very unique type of  learning that i never see before, it even had courses for 3rd grade, wait it might be 2nd grade. In Code.org I learn so much, much more at that time. My knowledge improve, my syntax improve and my algorithym is improved.

But, I learn at Code.org for not too long it’s about 3 month and I didn’t finish the learnings (Don’t you do that OK!) So, yea I quit it but not because any unreasonable things, it’s because I found another place to learn Coding or Programming, I found Khanacademy.org, Khanacademy doesn’t just contains coding but it contains everything else from math to history. I prefer Khanacademy more because, it has Coding Interface that makes you really are writing it yourself, at Khanacademy I learn Javascript, HTML and CSS Well mostly I learn Javascript, but the other 2 code are just to make my knowledge grow plus its a basic need in the world of Coding, like to make web page and stuff like that. And just like before I Level Up once more, it makes me get used to write code. I have made a couple of game at Khanacademy, wait, no it’s actually about 1. Now let me tell you, if  you’re ever stuck about anything in there, you have plenty of nice people you can ask about the problem solving.

 It takes me about a year now, to learn at KA and yet I still need to learn more because I need to master it. So, until now at grade 7 I still learn at KA, but!! besides learning at KA now I learn much more complicated coding at JAVA, i’m using Java EE Eclipse to write my code. Because I want to focus on making game, so I watch videos on Youtube on how to make games in java, now i am writing PONG games which is halfly done, and I will finished it and makes improvements soon.

So, that’s my story about how I get to the world of Coding. Well maybe our experience and our story is different, but we have one similarity, we LEARN. Everything that I metioned up there is about how I learn, learn and learn!. Well learning on how to code will not be just a moment or two, it takes a lot of hour until you mastered it, so I am very grateful that i learn coding since I was just a boy so I can have a lot of times to Learn. That’s all of the story that I can tell you, hope you get something from our talk, and I recommend that you check the book and those 2 places. But in the end you need to pick one.Bye and see you next time!

Do you have any other experiences? Give comment and share it with other people!

Introduction

Helloo, This is my first article for this blog, in this blog i will discuss about Coding, especially Java and Javascript. Inside this blog, I will write about Coding in the technic nor theory. The purpose of this blog is to improve yours and my Coding skills, we learn together.

I hope this first article could tell you how I plan for the future of this blog and improve my coding skills because i’m still learning too. I hope throughout this blog I could give people knowledge and I hope through every single post I could be better and better.