Difference between revisions of "Tips For ESL Students"

From CompSciWiki
Jump to: navigation, search
(first trial edit)
(Starting: fixed double-quotation marks)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{1010Topic | Introduction=Every programming language has a unique syntax and structure. This section will introduce you to the anatomy of a Java program.|Overview=In this section, you will learn about the basic building blocks that make up a Java program. You do not need to understand everything that is covered in this section. The point of this section is to give you a basic understanding of how a Java program is structured. Topics, such as methods and variables, will be covered in later sections. |Chapter_TOC=[[Editing Tips For ESL Students]]}}
+
{{1010Topic | Introduction=This appendix will offer some thoughts on how the ESL students learn Comp1010 when they first start studying Computer Science.|Overview=In this appendix, you will learn how to use English to learn Comp1010 and what is the fastest way to be comfortable with writing program in English. |Chapter_TOC=[[Editing Tips For ESL Students]]}}
  
=A Simple Example of a Java Program=
+
=Starting=
  
<pre>
+
ESL students face many difficulties when learning how to program in English, such as misunderstanding concepts and learning to be comfortable with thinking logically in a computer language. In this appendix, I will apply the "''why, what, how, and when''" to learning a computer language in English.
public class JavaProgram
+
{
+
  public static void main(String args[])
+
  {
+
    System.out.println("This is what a Java program looks like");
+
  }
+
}
+
</pre>
+
  
=Classes=
+
=Why use English to learn COMP1010=
The first line is called the class header. A class groups together the components of an object. Do not worry about what an object is right now; they will be covered in COMP1020. For now, just think of a class as a container for the rest of your code. After the class header, we write an opening curly brace (<code>{</code>), followed by some methods or variables, and then a closing curly brace (<code>}</code>). When you create a new program, you will first declare a class. The rest of your code will then be contained inside of the two braces.
+
If we always translate all the concepts of computer language into our own language, we will have difficulty in understanding the meanings of them. For example, if we translate a concept “'''roll back'''” into Chinese, we can find out that there are four different meanings in dictionary. Hence, the misunderstanding of concepts of computer language will tend to serious confusion and influence us continuing our study. Another advantage of learning computer language in English is that you will adapt to programming thought faster than using your own language. Therefore, the best way is to start your programming learning in English.
  
In the above example, JavaProgram is the name of the class. When you save a Java file it must be named ''classname''.java (where ''classname'' is the name of the class). In the example, we would save the file as JavaProgram.java
 
  
 +
=What we need=
 +
In order to precisely realize the syntax, grammar, and meaning of concepts, I highly recommend you to have two tool books. One is '''English to English computer dictionary''', another is '''English dictionary of computer abbreviation'''. These two dictionaries will be the best friends for you to start learning programming. Contrarily, if you use the dictionaries in other languages, you will miss the deep meaning of the concepts of computer language.
 +
Another important thing is that you need to reinstall your computer operation system and even all of application software such as Microsoft Office to '''English version'''. It will help you avoid learning programming in your own language.
  
=Methods and the Main Method=
 
A method is a block of code that performs a certain task. To declare a method, we write a method header followed by an opening curly brace, some code called the method body, followed by a closing curly brace.
 
  
Below is an example of a method. This method performs the task of printing a message to the screen and returning <code>1</code> to the caller.
+
=How to learn=
<pre>
+
public int printMessage(String message)
+
{
+
  System.out.println(message);
+
  
  return 1;
+
Before going to class, you need to pre-read the textbook so that you can catch up with the progress in class activity. When you have questions, do not hesitate to ask your professor or classmates. Of cause, talking to English students is your first choice. Computer language is a language therefore you need to practice every day. The best way to do so is to avoid finishing your homework in one day. One more suggestion I have is read a book, '''"Computer Essentials”,''' published by McGraw-Hill. This is an elementary reading material for the students who are newly involved in programming.  
}
+
</pre>
+
Now, we will explain the components of a method header.
+
*Scope: The keyword ''public'' allows other classes to call our method. Alternatively, we could have used the keyword ''private'' to deny other classes access to our method.
+
*Return type: When our method completes it can return data to the caller (the statement that called our method). We must declare the type of data that our method returns. In the ''printMessage'' method, we used the keyword ''int'' to declare that our method returns data of type integer. If we do not want our method to return anything we can use the keyword ''void''.
+
*Name: We must give our method a unique name. The name of the method shown above is ''printMessage''.
+
*Parameters: We can pass data to a method. The data that we pass to a method are called parameters. Parameters are declared inside of round brackets. Each parameter must have a type and a name (just like when we declare a variable). If we do not want to have any parameters, we just put a set of round brackets with nothing inside.
+
  
== The Main Method ==
 
  
The main method header has the following form:
+
=When to learn=
 +
No matter when you study programming, you should insist on using English to learn programming. For example, when you look for some helps from website, you should go English website first instead of the website in your own language.
  
<pre>
+
=Conclusion=  
public static void main(String args[])
+
Learn programming in English not only gives you a clear understanding of the concept, syntax and grammar, but also offers you how to adapt the western peoples’ thought since all foundations of computer language are based on this kind of thought. After you insist on using English to study programming in couple months, you will see that you have find the way to learn programming.
{
+
   
+
}
+
</pre>
+
 
+
The main method is a special method in Java, and every Java program must have one. This is because the program starts running on the first line of the main method.
+
 
+
The main method must be declared inside of a class. After the header of the main method (and all other Java methods), we write opening and closing curly braces (just like when we define a class).
+
 
+
The meaning of '''static''' will be discussed in a later chapter.
+
 
+
 
+
=Statements=
+
An instruction in Java is called a statement. A statement is a single line of code that performs a task. All statements must end with a semicolon. In the first example program, the following statement prints "This is what a Java program looks like" to the screen:
+
<pre>
+
System.out.println("This is what a Java program looks like");
+
</pre>
+
 
+
 
+
=Packages and the import Statement=
+
A package is used to group a set of classes together. When you create a new class it will be placed in the default package. However, you cannot access classes outside of your package without importing them, such as the classes that come with Java. The import statement will allow you to use classes that are in another package.
+
 
+
 
+
The general syntax of an import statement is:
+
<pre>
+
import example.package.class;
+
</pre>
+
 
+
Where ''example.package'' is the name of the package you want to import, and ''class'' is a class within that package.
+
 
+
 
+
This is an example of how to import a specific class.
+
<pre>
+
import javax.swing.JOptionPane;
+
</pre>
+
Here we import the JOptionPane class which is part of the javax.swing package. Now our program will be able to use JOptionPane.
+
 
+
 
+
We can specify that we want to include all the classes of a package by using the <code>*</code> symbol as demonstrated below.
+
<pre>
+
import javax.swing.*
+
</pre>
+
 
+
This will import all classes from the '''javax.swing''' package.
+
 
+
import statements should be placed at the very beginning of the file (above the class header).
+
 
+
 
+
=Case Sensitivity=
+
Java is a case sensitive programming language. This means that it distinguishes between letters that are typed in upper case and letters that are typed in lower case. For example, if you type '''Main''', this is not the same as typing '''main'''.
+
 
+
 
+
=Naming Guidelines=
+
How you name your classes, variables, and methods is largely a matter of convention. Here we will discuss some of these conventions.
+
 
+
==Class Naming==
+
A class name should be a noun that starts with a capital letter. The first letter of each word should also be capitalized.
+
<pre>
+
public class Tetris
+
</pre>
+
<pre>
+
public class DayPlanner
+
</pre>
+
 
+
==Method Naming==
+
A [[Calling Methods|method]] name should be a verb phrase that indicates what the method does. The first letter of each word (except the first word) should be capitalized.
+
<pre>
+
public void rotate()
+
</pre>
+
<pre>
+
public int getCurrentPosition()
+
</pre>
+
 
+
==Constant Naming==
+
A [[Named Constants|constant]] name should be a noun phrase with all capital letters with an underscore between words.
+
<pre>
+
public static final double PI = 3.14159265l;
+
</pre>
+
<pre>
+
public static final int MELTING_POINT = 0;
+
</pre>
+
 
+
==Variable Naming==
+
A [[Variables and Literals|variable]] name should be a noun phrase. The first letter of each word after the first should be capitalized.
+
<pre>
+
int day;
+
</pre>
+
<pre>
+
String firstName;
+
</pre>
+
<pre>
+
double distanceToTheMoon;
+
</pre>
+

Latest revision as of 17:03, 25 January 2008

COMP 1010 Home > Editing Tips For ESL Students


Introduction

This appendix will offer some thoughts on how the ESL students learn Comp1010 when they first start studying Computer Science.

   

{{{Body}}}

Starting

ESL students face many difficulties when learning how to program in English, such as misunderstanding concepts and learning to be comfortable with thinking logically in a computer language. In this appendix, I will apply the "why, what, how, and when" to learning a computer language in English.

Why use English to learn COMP1010

If we always translate all the concepts of computer language into our own language, we will have difficulty in understanding the meanings of them. For example, if we translate a concept “roll back” into Chinese, we can find out that there are four different meanings in dictionary. Hence, the misunderstanding of concepts of computer language will tend to serious confusion and influence us continuing our study. Another advantage of learning computer language in English is that you will adapt to programming thought faster than using your own language. Therefore, the best way is to start your programming learning in English.


What we need

In order to precisely realize the syntax, grammar, and meaning of concepts, I highly recommend you to have two tool books. One is English to English computer dictionary, another is English dictionary of computer abbreviation. These two dictionaries will be the best friends for you to start learning programming. Contrarily, if you use the dictionaries in other languages, you will miss the deep meaning of the concepts of computer language. Another important thing is that you need to reinstall your computer operation system and even all of application software such as Microsoft Office to English version. It will help you avoid learning programming in your own language.


How to learn

Before going to class, you need to pre-read the textbook so that you can catch up with the progress in class activity. When you have questions, do not hesitate to ask your professor or classmates. Of cause, talking to English students is your first choice. Computer language is a language therefore you need to practice every day. The best way to do so is to avoid finishing your homework in one day. One more suggestion I have is read a book, "Computer Essentials”, published by McGraw-Hill. This is an elementary reading material for the students who are newly involved in programming.


When to learn

No matter when you study programming, you should insist on using English to learn programming. For example, when you look for some helps from website, you should go English website first instead of the website in your own language.

Conclusion

Learn programming in English not only gives you a clear understanding of the concept, syntax and grammar, but also offers you how to adapt the western peoples’ thought since all foundations of computer language are based on this kind of thought. After you insist on using English to study programming in couple months, you will see that you have find the way to learn programming.