Java and Me.


I’ll write about Java before telling a story about the auto-stock-trader. I’ve developed the program in Java.



↓ 日本語版。


What is Java?


Java is one of the famous programming languages. It’s said that Java is a descendant of C++. If they were animals, C++ would be a restive bull, whereas Java would be a tamed one. Java’s icon is coffee mark. If you like coffee, I’m sure you feel close to Java. (Actually, I drink a lot of coffee every day.) In addition, Java also has its character called Duke but I don’t like him very much...


Enormous number of programs are written in Java. I think ordinary people see Java programs on their smart phones. It seems that a lot of mobile applications are written in Java and I often see reference books for app development by using Java. If you want to create an app, I recommend you to study Java. But I’ve never write an app for smart phone...


Aside from that, most of you have seen a notice on the task bar. That informs you Java update is available. Some people get angry with the notice because it pops up repeatedly. In more detail, that Java means Java visual machine, JVM. It’s one of the characteristics of Java that a program written in Java isn’t able to work without JVM. It’s like a stage for Java. Java won’t begin to dance without the stage. (You might want to update Java when you receive the message.)


Why has Java adopted such a complicated system? Because it enables Java to run any environment, such as Linux, Windows Mac OS and so on. Since JVM offsets the difference in environment, programmers release from it. (But it cannot remove the problem from programming completely.) It’s described as “Write once, run anywhere.”


My explanation of Java is not sufficient. You can find a large number of information on the Internet. Anyways, if you get interested in Java, I’m glad.




My Java history.

I started to study Java when I was a first-year high school student. And I also started programing at the same time. It means Java is like my native programming tongue. I don’t remenber why I chose Java. I borrowed a book at the public library in my hometown. It has a relatively small number of pages and a lot of illustrations. So it looked easy. I started to read the book and but I gave up studying Java...


I think that book omits complicated but important explanations needed for understanding and advertises that Java is easy to learn with it. (Not just programming, I sometimes see such books in other fields.) I couldn’t distinguish things and I thought Java was really difficult and quitted studying.


When I was a second-year student at high school, I resolved to study programming again. I studied other programming languages: Python 2 and CASLⅡ, and basic mechanism of computer. CASLⅡ is a simplified assembly language developed for Fundamental Information Technology Engineer Examination in Japan. So there is no computer architecture corresponds to the language. CASLⅡis simple but various essences of computer is concentrated in the language. It’s worth learning.


I met wonderful books so that I didn’t give up studying these languages. After that, I challenged myself to Java again. Eventually I didn’t give up maybe because I had gained knowledge and minimal sense of programming through studying Python 2, CASLⅡ and computer mechanism.


I wrote computer program in Java until the end of my third year in high school. I’ll mention them later. After I failed the university entrance exam, I stopped writing and prepared for the exam.


After entering the university, the time went by without programming. (My major was biotechnology. Few students were familiar with programming.) When I was a fourth-year student, I started to research and wrote a graduate thesis. I got bored while writing the thesis and began to write a program again for fun. I’ll also mention in the next section.


That’s the end of my Java experience.




Computer programs I’ve developed.

When I was a child, my mother didn’t give me pocket money. My friends bought something with money given by their parents. But I didn’t have any money. So the only thing I could do was just looking at them. I thought I had to earn money for myself to change the situation. To do so, I developed several programs. It was not for sale. Finally I couldn’t earn enough money but it was fun. (Maybe it’s right that I blame failing the entrance exam on them... But of course, other than them, there are several reasons I think.)


Twitter bot(2nd ~ 3rd year at high school)

It collects 200 tweet of a user who posts a tweet including (@bot_name) and replies the tweet; “Your X-th highest number of characters you’ve tweeted is “Y”.


I started twitter when I was a 2nd year at high school to post affiliate advertisements on Twitter. I created a lot of accounts and used a web service to follow and tweet advertisements automatically. But at the end, my accounts were suspended. I realized my accounts needed something unique so that I developed the program.


A tool for resale (3rd year at high school)

It compares market prices of products on Amazon with those of the same products on Rakuten which is a Japanese e-commerce. And if the price on Rakuten is cheaper than on Amazon, It stores the information about the product and finally it outputs the result in HTML format.


I developed this program when I did resale. I looked for cheaper products on Rakuten and sold them on Amazon. But to do so, I had to spend a lot of time sitting in front of a P.C. for searching. I thought it wasn’t the thing human did. So I wrote a program to look for the products instead of me. In addition, the program inputs the result in HTML for affiliate advertisements. I don’t remember exactly but maybe it can compare tens of thousands of products in a few day automatically.


A tool for increasing my blog traffic (3rd year at high school)

It visits other’s blog automatically and leaves its access in the visit history. It can visit tens of thousands of websites in a day.


Though I updated a blog once a few month, its page views were more than a ten thousand. But I had a vague feeling of guilt so I quitted using the program.


The auto-stock-trader (4th year at university~)

I wrote a program to log on to a website of a brokerage and to gather stock prices.




Studying Java.

As I didn’t have enough money, I borrowed books at the library many times. I’ve read so many books that I don’t remember which is which.


Entering the university, I’ve bought a book for Java. (I introduced the book in my previous post but I omitted it in this article since the book is written in Japanese.) In this book, object-oriented programming is explained well. This concept is one of the obstacles for Java beginner. In brief, object-oriented programming means a concept to reflect the world in which we live in a programming code. In this book, it’s explained from the point of view of programmers who cooperate with a lot of colleagues to write a huge program. I think most books don’t focus on this viewpoint and explain the importance of this concept just from individual.


How can we develop a huge program including billions lines of code which is easy to maintain by tens of thousands of developers efficiently and correctly? One of the solutions is object-oriented programming. Until now, humans had written a program for the convenient of computers. So we had made mistakes. From now on, we would write codes for the convenient of humans. It means that we would reflect the world in which we live in a programming code.


Though it’s an extreme case. If you had a trouble understanding the object-oriented programming, this point of view would help you understand the concept. (I heard that Google manages approximately two billions lines of code.)


In my experience, the most efficient way to learn Java is thinking, gathering necessary information for myself and trying to write codes in my own way.