ðäž»èŠãªããã°ã©ãã³ã°èšèªã®ãšã³ããªãŒãã€ã³ããç¥ãããã§ã
ããã°ã©ãã³ã°èšèªã®ãšã³ããªãŒãã€ã³ãã¯ãããã°ã©ã ãå®è¡ãéå§ããå Žæãæããèšèªã«ãã£ãŠç°ãªã圢åŒããããŸããããã€ãã®äž»èŠãªèšèªã®ãšã³ããªãŒãã€ã³ãã以äžã«ç€ºããŸãïŒ
Python: Pythonã§ã¯ç¹å®ã®ãšã³ããªãŒãã€ã³ãé¢æ°ïŒmainãªã©ïŒãå¿ é ã§ã¯ãããŸããã
ã¹ã¯ãªããã®æäžéšããé ã«å®è¡ãããŸãããif __name__ == "__main__": ã䜿ãããšã§ãã¹ã¯ãªãããçŽæ¥å®è¡ãããæã ãç¹å®ã®ã³ãŒããå®è¡ãããããã«å¶åŸ¡ã§ããŸãã
def main():
print("Hello, World!")
if __name__ == "__main__":
main()
Java: Javaã§ã¯mainã¡ãœããããšã³ããªãŒãã€ã³ããšããŠäœ¿çšãããŸãã
ãã®ã¡ãœããã¯public static voidã§ãããæååã®é åãåŒæ°ãšããŠåãåããŸãã
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
C/C++: Cããã³C++ã§ã¯ãmainé¢æ°ãããã°ã©ã ã®éå§ç¹ã§ãã
åŒæ°ãšããŠint argc, char *argv[]ãåãåãããšãã§ããŸãã
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello, World!\n");
return 0;
}
JavaScript (Node.jsã®å Žå): JavaScriptã«ã¯ç¹å®ã®ãšã³ããªãŒãã€ã³ãã®æŠå¿µã¯ãããŸãã
ããNode.jsã§ã¯ã¹ã¯ãªãããã¡ã€ã«ã®æäžéšããå®è¡ãå§ãŸããŸãããã ããã¢ãžã¥ãŒã«ãé¢æ°ã䜿ã£ãŠã³ãŒãã®æ§é ãå¶åŸ¡ããããšãäžè¬çã§ãã
function main() {
console.log("Hello, World!");
}
main();
ãšã³ããªãŒãã€ã³ãã®å®çŸ©ãæããŠãã ãã
ãšã³ããªãŒãã€ã³ãïŒentry pointïŒãšã¯ãããã°ã©ã ãã¢ããªã±ãŒã·ã§ã³ãå®è¡ãéå§ããå Žæãããªãã¡ããã°ã©ã ã®å®è¡ãå§ãŸãæåã®ã³ãŒãã®éšåãæããŸãããã®éšåããããã°ã©ã ã®ãã¹ãŠã®æ©èœãçŽæ¥çãŸãã¯éæ¥çã«åŒã³åºãããããã°ã©ã ã®ãããŒãéå§ãããŸãã
ãšã³ããªãŒãã€ã³ãã®å ·äœçãªå®çŸ©ã圢åŒã¯ã䜿çšãããããã°ã©ãã³ã°èšèªããã©ãããã©ãŒã ã«ãã£ãŠç°ãªããŸããããšãã°ãCèšèªãC++ã§ã¯mainé¢æ°ããšã³ããªãŒãã€ã³ãã§ãããJavaã§ã¯public static void main(String[] args)ã¡ãœããããã®åœ¹å²ãæãããŸããPythonã®ãããªã¹ã¯ãªããèšèªã§ã¯ç¹å®ã®é¢æ°ãæ瀺çã«ãšã³ããªãŒãã€ã³ããšããŠæå®ããå¿ èŠã¯ãªããã¹ã¯ãªããã®æäžéšããå®è¡ãå§ãŸããŸãããif __name__ == "__main__": ãããã¯ã䜿ã£ãŠç¹å®ã®ã³ãŒãããšã³ããªãŒãã€ã³ããšããŠæ©èœãããããšãã§ããŸãã
ãšã³ããªãŒãã€ã³ãã¯ãããã°ã©ã ãã©ã®ããã«ããŠéå§ãããããå®çŸ©ãããããããã°ã©ã ã®æ§é ãåäœãç解ããäžã§éåžžã«éèŠãªæŠå¿µã§ãã
ç¹å®ã®ãšã³ããªãŒãã€ã³ãããªãèšèªãæããŠãã ãã
ç¹å®ã®ãšã³ããªãŒãã€ã³ããæããªãããã°ã©ãã³ã°èšèªã¯ãäž»ã«ã¹ã¯ãªããèšèªã®ã«ããŽãªã«å±ããŸãããããã®èšèªã¯ãããã°ã©ã ãåäžã®ã¹ã¯ãªãããšããŠæžãããäžããäžãžãšé çªã«å®è¡ããããããç¹å®ã®ãmainãé¢æ°ãé¡äŒŒã®ãšã³ããªãŒãã€ã³ããå¿ ãããæããªãããšãç¹åŸŽã§ãã以äžã¯ããã®ãããªèšèªã®äŸã§ãïŒ
Python: Pythonã§ã¯ãã¹ã¯ãªããããã®ãŸãŸå®è¡ãããŸãããã ããif __name__ == "__main__": ã䜿çšããŠãã¹ã¯ãªãããçŽæ¥å®è¡ãããéã«ã®ã¿ç¹å®ã®ã³ãŒããå®è¡ãããããã«èšå®ããããšãã§ããŸãããããã¯ãšã³ããªãŒãã€ã³ããå®çŸ©ããããã®äžè¬çãªæ £ç¿ã§ãã
Perl: PerlããŸãã¹ã¯ãªããèšèªã§ããããã¡ã€ã«ã®æåã®è¡ããé ã«ã³ãŒããå®è¡ãããŸããç¹å®ã®ãšã³ããªãŒãã€ã³ãé¢æ°ã¯å¿ èŠãããŸããã
Bash (ã·ã§ã«ã¹ã¯ãªãã): Bashã¹ã¯ãªããã¯ããã¡ã€ã«å ã®æåã®è¡ããå®è¡ãéå§ãããŸããç¹å®ã®ãšã³ããªãŒãã€ã³ããèšå®ããæšæºçãªæ¹æ³ã¯ãããŸããã
PHP: PHPã¯äž»ã«WebãµãŒããŒã§åäœããã¹ã¯ãªããèšèªã§ãPHPãã¡ã€ã«ããµãŒããŒã«ãã£ãŠåŒã³åºããããšããã¡ã€ã«ã®äžéšããã³ãŒããå®è¡ãããŸããäžè¬çã«ã¯ãç¹å®ã®ãšã³ããªãŒãã€ã³ãé¢æ°ã¯å¿ èŠãããŸããã
ãããã®èšèªã¯ãç¹å®ã®é¢æ°ããéå§ç¹ããšããŠèšå®ããã®ã§ã¯ãªããã¹ã¯ãªããå šäœãé£ç¶ããŠå®è¡ããããšããæ§è³ªãæã£ãŠããŸãããã ããããã°ã©ã ã®èšèšãå¿ èŠã«å¿ããŠããšã³ããªãŒãã€ã³ãã®ããã«æ©èœããã³ãŒããããã¯ãèªãå®çŸ©ããããšãå¯èœã§ãã
æåãªã©ã€ãã©ãªã¯ç¬èªã®ãšã³ããªãŒãã€ã³ããæã£ãŠããããšããããŸããïŒ
äžè¬çã«ãã©ã€ãã©ãªèªäœã«ç¬èªã®ãšã³ããªãŒãã€ã³ããããããã§ã¯ãããŸãããã©ã€ãã©ãªã¯ãåå©çšå¯èœãªã³ãŒããé¢æ°ã®éåã§ãããã¢ããªã±ãŒã·ã§ã³ãä»ã®ããã°ã©ã ããããã®æ©èœãå¿
èŠã«å¿ããŠåŒã³åºãããã«èšèšãããŠããŸããã©ã€ãã©ãªã¯åºæ¬çã«ã¯åŒã³åºãå
ã®ããã°ã©ã ã®äžéšãšããŠåäœããç¬ç«ãããšã³ããªãŒãã€ã³ããæãããã¢ããªã±ãŒã·ã§ã³ã®èµ·åæãç¹å®ã®æ©èœã®å®è¡æã«ãã®ã³ãŒããå®è¡ãããããã«ãªããŸãã
ãã ããç¹å®ã®ãã¬ãŒã ã¯ãŒã¯ã倧èŠæš¡ãªã©ã€ãã©ãªã§ã¯ãããèªäœã§å®è¡å¯èœãªéšåãå«ãŸããŠããããšããããŸãããããã¯éåžžããã¹ãããã¢ã³ã¹ãã¬ãŒã·ã§ã³ãããŒã«ã®å®è¡ãªã©ç¹å®ã®ç®çã®ããã«å«ãŸãããã®ã§ããäŸãã°ã以äžã®ãããªã±ãŒã¹ãèããããŸãïŒ
DjangoïŒPythonã®Webãã¬ãŒã ã¯ãŒã¯ïŒ: Djangoã¯ãmanage.py ãšããã¹ã¯ãªãããéããŠãã¬ãŒã ã¯ãŒã¯ãæäœããããã®ã³ãã³ãã©ã€ã³ããŒã«ãæäŸããŠããŸãããã®ã¹ã¯ãªããã¯Djangoã¢ããªã±ãŒã·ã§ã³ã®ãšã³ããªãŒãã€ã³ãã®åœ¹å²ãæãããããŒã¿ããŒã¹ã®ãã€ã°ã¬ãŒã·ã§ã³ããµãŒããŒã®èµ·åããã¹ãã®å®è¡ãªã©ãè¡ãããšãã§ããŸãã
Node.jsã®ã©ã€ãã©ãª: äžéšã®Node.jsã®ã©ã€ãã©ãªïŒããšãã°ãã³ãã³ãã©ã€ã³ããŒã«ãæäŸãããã®ïŒã¯ãèªèº«ã®å®è¡å¯èœãªã¹ã¯ãªãããæã£ãŠããããšããããŸããããã«ãããã°ããŒãã«ã«ã€ã³ã¹ããŒã«ãããåŸãã³ãã³ãã©ã€ã³ããçŽæ¥å®è¡ããããšãå¯èœã§ãã
JUnitïŒJavaã®ãã¹ããã¬ãŒã ã¯ãŒã¯ïŒ: JUnitã¯ããã¹ãã©ã³ããŒãéããŠãã¹ãã±ãŒã¹ãå®è¡ããæ©èœãæäŸããŸããããã¯ã¢ããªã±ãŒã·ã§ã³ã®ç¹å®ã®ãšã³ããªãŒãã€ã³ãã§ã¯ãªããã®ã®ããã¹ãå®è¡ã®éå§ç¹ãšããŠæ©èœããŸãã
ãããã®äŸã¯ãã©ã€ãã©ãªããã¬ãŒã ã¯ãŒã¯ãç¬èªã®ãšã³ããªãŒãã€ã³ããæã€ããšããããšããç¹ã瀺ããŠããŸãããããã¯äžè¬çã«ã©ã€ãã©ãªå šäœãç¬ç«ããŠå®è¡å¯èœã§ãããšããæå³ã§ã¯ãªããç¹å®ã®æ©èœãç®çã«å¯ŸããŠå©çšãããå Žåãå€ãã§ãã
ãé¡ãèŽããŸã