C sharp (C#) Hello world

create a cs file hello-world.cs and add code.

run the file in cmd
C:\Desktop> C:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe hello_word.cs

then a executable will be created called hello_word.exe. That is your program. Run that to run you program.

>Forgetting how to Program

>As a programmer it’s impossible to remember everything you learn. I saw this as being bad but today I see it as being good. Programs, languages, technology change and involve, and if you’re not consistently learning you’re being left behind and if you’re remembering everything you are also being left behind.

Recently PHP had a new update with new syntax and deprecated old ones. Just like your memory, in with the new out with the old. Why hold on to all that useless code or memory? This is why I don’t believe in computer science degrees. What you learned 5 years ago may not be relevant today. I would rather hire someone who consistently learns everyday for the past 2 years compared to someone who has a computer science degree 10 years ago.

Program everyday like you eat everyday, have your daily dose of it. Don’t try to learn everything. At 9, when I started using a computer I didn’t try to learn everything about it. I learned what I needed and that was how to play games. Today I’m not going to try to learn every language like its the end of the world but learn what is needed and it will lead to huge gains in the future without me noticing.

>Learn how to program thru examples

>Learning how the program is like riding a bike. You cannot fully learn it without applying it. After learning various languages I noticed that not everything the languages contains is useful, at least for me at this time. I found this by building my own useful programs or dissecting one. I need examples!

I have found no use for interfaces, I have study it but i have yet to see it in a necessary program. You can learn all kinds of theories but if you dont apply it to real life situations, its a waste just like formal education, half of the crap you learn in school you never use. They teach you things that you “might” use giving you a general knowledge.

>Learn other programming languages

>The first programming language I started learning was PHP then came javascript, python and c++. What I’m amazed is how much better understanding about a language when you study other ones. In reality programming languages are the same the only difference is syntax and couple different features here and there.

You’ll enjoy learning a new language while refreshing general programming skills such as functions, loops, class, switch, if statements as so on. The other benefit is a common technique used in c++ might not be common in other languages. And now you have learned it and you can implement it into your language of choice.

OOP is quite new in PHP compared to c++. The reason PHP added this feature was because OOP made c++ very powerful and easy to maintain, and why not have the same for PHP.

>Keep it Sensitive, Case Sensitive!

>They’re case sensitive operating systems and programming languages, and others that are not. Now do you give in to the medium rules or do you stay congruent no matter what or where you are developing?

This is an easy question. Of course you stay congruent across mediums but the challenge is discipline. Because not being congruent today may not effect you now but it will in the future, like it happened to me.

Recently I transferred my websites from my windows to Linux server. I could not get the sites to work on Linux. After hours of debugging I found that the error lied in the case of the string. Not only did it effect my variables but also the URL. I looked around for a way to change this feature but realize that its a good thing to have. I was practicing a bad habit and needed to brake it now.

Now when you have that thought “Is this case sensitive.” You’ll know what to tell yourself. Keep it Sensitive.

Ways to be congruent:
Defining your variables, folders, files and so on in a standard naming convention. Camel back (camelBack) your variables and capitalize your classes.

Notes:
Case Sensitive => Linux, Unix, Javascript
Case Insensitive => PHP, Windows

>Mind Cloaking

>In my writing I have noticed that I can prof read and re-read and will not find any errors but if I change the background of what I’m reading on, the error becomes evident.

It’s like your mind is auto completing, tricking, cloaking the errors.

There may be a name for this occurrence. It seems similar to those images with a black dot in the middle where if you stare at it long enough a secret image will show or when two colors are next to each other they look like the complete opposite but when apart they’re only different shades of the same color.

This also happens in programming. You may be looking at a bug right in the face but you cannot find it unless you take a break or change the environment.

Internet is like a Candy Store, Open Source is its Candy

The internet is like a candy store and the candy is free. They’re many free stuff online but what makes me excited is the open source, this is high quality free. It may be hard for someone who doesn’t program to understand what I’m talking about. I feel spoiled when I run across an open source software. Seriously, these are unequivocally amazing. From programing languages such as PHP, Python and javascript, to libraries like jQuery and jqPlot to applications such as piwik, to software like blender, to frameworks like CodeIgniter, to operating systems like Ubuntu linux, mail transfer agent like Postfix and the list goes on. There’s so many its hard to use them all. Here is a list of high quality open source projects per category.

>Web Charts – PHP and Javascript

>pChart.net and jqPlot.com are two different libraries that allow you as a web developer create beautiful charts and graphs.

jqPlot is a javascript library that uses jQuery. jqPlot is great because it can pull data directly from multiple mediums such as csv, txt, json and so on. However it sucks because different charts may need different plugin files and you need to make sure the right script is included, but its still simple.

pChart is a PHP libray that uses its GD library. You may need to configure your php depending if this library is installed or not. pChart is a object oriented class that creates an image of a chart on the webpage. The webpage becomes an image which will not let you output any html. The only way you can link to the chart is by using <img> or <iframe> tag. Whats great is that you can create an image that can be save but what sucks is that you may not be able to use AJAX and it takes a huge load on your CPU.

>Example: JSON

>WARNING!! Do not test it in Chrome it will not work. Only live.

JSON: is used for data storage and can be an alternative to XML.

HTML:


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script>
window.onerror = function(a,b,c){alert(a+b+c);} //if error alert
$(document).ready(function(){
//Short hand
$('button').click(function(){
$.getJSON("info.js", function(json) {
alert(json.name[1].first)
});

//Long
$.ajax({
async: false,
url: 'info.js',
dataType:'json',
success: function(json) {
ret = json.name[1].first;
}
});
});
});
</script>

<p>hello</p>
<button>Click Me</button>

JSON (info.js) – everything must have double quotes except numbers. You cannot comment in JSON. It has to look like the example below and it has to be in object/brackets {}


{
"name" : [{"first" : "Britney", "last":"Spears"},
{"first" : "Angelina", "last":"Jolie"}],
"age" : 25
}