Question:
Some computer programming basics?
anonymous
2009-03-07 12:02:38 UTC
Next year in school, I'm taking a computer programming class. I am 99.9% sure it is on Java.
I was wondering what some computer programming basics are. What should I be expecting/need to know going into next year?
I know a few kids in the class that could help me out later on, but I don't want to go into this as the class idiot because I'm pretty smart otherwise. haha
(Btw, if you're gonna use like "computer lingo" just tell me what it means)
Four answers:
Nick C
2009-03-07 12:54:00 UTC
If you are going to be studying Java, then will probably get ahead of the class if you understand what is know as Object Oriented Programming, or OPP.



Imagine if you were designing a program to keep track of students in a new school. Each student has a name, a schedule, a grade record, a disciplinary record, and an administrative record. The school is small and it only has 100 students now....but its becoming very popular. All students are also first year students, but they will probably continue to study there for a few years. What would be the best way to create a program that can...grow? We can't add students directly into the program because there could be more of them...would you go back to the code and add all these students?



So we create a general student. Let's call this the Students class. In this class, we will define containers for a student's information (grades, records, schedule) - these containers are called instance variables. We will also create function to add and remove students, these are class functions. The students will also have functions of his own...to add classes, change grades, etc - these are instance methods. The records, schedule, and grades will also need classes. Let's go ahead and create the Records class, Schedules class, and Grades class.



When you create a variable, you are initializing an instance of a class.

This instance is called an object. The object can have functions that can either modify or access information about an object. These functions, when talking about OPP, are referred to as Mutator and Accessor methods. In our example, changeClass or addGrade, would be mutator methods. Accessors would be getName or viewSchedule. The variables that are specific to an instance of an object are called instance variables. Keep in mind that you can have multiple instances of a class, or objects, yet they will all share the same class. The variables and functions that are shared by all instances of a class are called class variables and class functions. In our student example, a variable like school name would be considered a class variable because it would be shared by all instances and no instance would have an individual school.



Variables can also be private or public. Information like students grades or SSNs should be kept in private variables that could only be modified by a legitimate methods defined within that object. This is to ensure that the variables will be kept protected from other functions that might want to change or view the variables. Public variables on the other hand can be viewed and modified externally. Variables can also be defined as constants, so that once defined, the value can't be changed. In our example, a public constant would be an ideal variable to store the school name. Functions can also be made private or public. A private function can only be called from the instance. In our example, no piece of code should be allowed to modify the grades of X students except the student itself.



Well, that's a head start :)
?
2016-09-09 02:28:57 UTC
These languages are on PC. First begin with Visual Basic, it is particularly convenient, then you'll be able to be trained C# and C++, they extra complicated. I presently use Visual Studio .NET 2008, it is a very well variant (the trendy variant up to now) of Visual Studio.
The Sand Reckoner
2009-03-07 12:22:16 UTC
I think the best thing to do would be to google it. There are many sites that give good introduction to programming.
SeeYouLater_Zee
2009-03-07 12:08:47 UTC
If you would like to "think in Java" see this free 3rd edition by its author Bruce Eckel, "Thinking in Java". Solid basics covered as well.

http://www.mindviewinc.com/Books/


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...