僕はプログラマみたい

PUBLIC_FLAG_#{@journal.pf_int} RSS feed of havarlan's latest journal entries Nov 19th 2009 13:33

こんばんは。 簡単な関数について書くようにします。
Hello. I will try to write about a simple function.

これは簡単な関数です。 関数の後、説明します。
Here's the simple function. After the function, I will explain.
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
public boolean validateString(String str)
{
//First check for null or empty string
if (str == null || str.length() == 0)
return false;

for (int i = 0; i < str.length(); i++)
{

//Check for non-digit characters.
if (!Character.isDigit(str.charAt(i)))
return false;
}

return true;
}
ーーーーーーーーーーーーーーーーーーーーーーーーーー
関数名は「validateString」です。 この関数の返却値はブール値で、関数の引数はストリングです。 ストリングの変数は0点かヌルちがあれば、偽を復帰します。 ストリングの文字配列は字を含有したら、偽も復帰します。 でも、それがそうでなければ、真を復帰します。 

The name of this function is validateString. This function's return value is a boolean, and it's argument is a string. If the string variable is zero or null, false is returned. If the string of characters contain a letter, false is also returned. But, if this is not the case, true is returned.

This function validates a string to make sure it contains only numbers, so it can turn the string into an integer safely.
Nov 19th 2009 13:48 sima

  • 簡単な関数について書くようにします。
  • 簡単な関数について書くようにします書きます

 

  • 関数の後、説明します。
  • 後ほど、説明します。

 
コンピュータ関係の用語は日本でも英語ばかりなので、英語のままでも大体通じるものが多いです。

The name of this function is validateString. This function's return value is a boolean, and it's argument is a string. If the string variable is zero or null, false is returned. If the string of characters contain a letter, false is also returned. But, if this is not the case, true is returned.
関数名は「validateString」です。この関数は、文字列を引数とし、ブール値(真偽値)を返します。もし文字列がnullか若しくは長さ0であれば、falseを返します。また、もし文字列に(数字以外の)文字が含まれていれば、falseを返します。それ以外の場合は、trueを返します。

This function validates a string to make sure it contains only numbers, so it can turn the string into an integer safely.
この関数は、文字列から数値への変換を安全に行うために、文字列に数字だけが含まれているかを確かめます。
Nov 19th 2009 13:58 chikka

  • 簡単な関数について書くようにします。
  • 簡単な関数について書いてみます。 *「書いてみます」にtryの意味が含まってます。 「書いてみようと思います。」もいいです。

 

  • ストリングの文字配列は字を含有したら、偽も復帰します。
  • ストリングの文字配列は字を含んでいたら、偽も復帰します。

 

  • でも、それがそうでなければ、真を復帰します。
  • でも、それがそうでなければ、真を復帰します。

 
プログラムを日本語で書くのは、日本人でも難しいと思うよ。 
私がVBAやSASでプログラムを組んでいた時は、英語で書かなくてはならなくて、if から始まるプログラムがたくさんありました。もうすっかり忘れちゃったけど。
Nov 19th 2009 13:58 taka

  • 簡単な関数について書くようにします。
  • 簡単な関数について書くようにしいてみます。

 

  • この関数の返却値はブール値で、関数の引数はストリングです。
  • この関数の返却値戻り値はブール値(真偽値)で、関数の引数はストリング(文字列)です。

 

  • ストリングの変数は0点かヌルちがあれば、偽を復帰します。
  • ストリングの変数ヌルち無効値あれば、偽を復帰します。

 

  • ストリングの文字配列は字を含有したら、偽も復帰します。
  • ストリングの文字配列(数字以外の)文字含有したら含んでいても、偽復帰します。

 

  • でも、それがそうでなければ、真を復帰します。
  • でも、それがそうでなければ、真を復帰します。

 
I'm also a programmer(using mainly C++). Are you a Java programmer?
I changed some technical words to more major words in Japanese.
Nov 19th 2009 14:03 chikka

Opps, I mistook in my comments.
I wanted to say "プログラムの説明を日本語で書くのは..."
Anyway, you changed your avatar, don't you?
it seems like a last boss of Dragon quest. hehe
Nov 19th 2009 14:13 stealthinu

  • 簡単な関数について書くようにします。
  • 簡単な関数のことについて書ます。

 

  • 関数の後、説明します。
  • 関数の内容(ソース)の後、説明します。

 

  • この関数の返却値はブール値で、関数の引数はストリングです。
  • この関数の返値booleanで、関数の引数は文字列(or String)です。

 

  • ストリングの変数は0点かヌルちがあれば、偽を復帰します。
  • 文字列の変数の長さnullであれば、偽(or false)します。

 

  • ストリングの文字配列は字を含有したら、偽も復帰します。
  • 文字列に数字以外の文字を含有していた場合も、偽(or false)します。(元の英文にはletter以外としか書いていませんが、ソース見るとこちらの説明のほうが良いと思います)

 

  • でも、それがそうでなければ、真を復帰します。
  • でも、それがそうでなければ、真(or true)します。

 
Schimaさんも書かれているように、プログラミング関連の言葉は、無理に日本語に訳さずに使われるほうがわかりやすいですし、良く使われます。
ここでは、boolean String(「文字列」も良く使われる) true/false(「真/偽」も使われる) null integer(「整数」も使われる)あたりが、英語のままのほうが良く使われていると思います。
Nov 19th 2009 18:07 coco

悲しい><
私には英語だろうと日本語だろうと何語だろうと宇宙語みたい。。。
わからな~~~い

Journals Statistics

Latest entry

See more >>

Latest comments

See more >>

Entries by Month