Javaã使ãã¡ãªããã¯ããã¾ããï¼ãã¯ããããã¯ãã¡ããããã«æ±ºã¾ã£ã¦ã¾ãï¼
/.Jに聞け:Javaを使うメリットは? | スラッシュドット・ジャパン デベロッパー
ããããã¾ãããï¼ãWebã¢ããªã«éã£ã¦ãã ã¨ããããä¸ãã¦ããã¡ãªãããç¾ä»£çãããªããªã...
å人çã«ã¯å°æ°ç²¾éãã¼ã ãä½ãã¦ãªããªãJavaã¯ããªãæããªé¸æã ã¨æã£ã¦ãã¾ãã
â» Java使ã£ã¦ãã¡ã³ãã¼ãã¹ãã«ãä½ãã®ã§ã¯ãªããLLç³»ã§é«å質ãªãã®ãä½ãã®ã«ã¹ãã«ãå¿ è¦ã§ãä¾ãã¹ãã«ããã£ã¦ãå¤äººæ°éçºã«ã¯ãã¾ãåããªããã¨ããæå³
ã¨ããããã§ãèªåãæãLLç³»è¨èªã§ã¯ãªããJavaã§Webã¢ããªãéçºããã¡ãªãããæ¸ãã¦ã¿ã¾ãã
éçåã¥ãè¨èª
Haskellã¨ãOCamlã¨ãScalaã¨ãããã®è¾ºã®è¶ å¼·åãªåä»ãè¨èªããè¦ãã¨å¼±ãã§ãããå¤ãã®LLã¨éãéçåä»ããªäºãç¹å¾´ã§ãã
ããã¯åã¨ããã¡ã¿æ å ±ãè¨èªä»æ§ã«æ確ã«åãè¾¼ãã§ããã¨ãããã¨ã§ãã以ä¸ã®ã¡ãªãããããã¾ãã
- 人éãèªã¿ããã
- ã³ã³ãã¥ã¼ã¿ãèªã¿ããã
åçåä»ãã ã¨ä½ãå ¥ã£ã¦ããä¸æã®ãªãã¸ã§ã¯ããããã¾ãã
ã¡ã½ããã®å¼æ°ã«å ¥ãå¤ãããªã¼ãã ã ã£ãããéã«æ»ãå¤ãintã ã£ãããªãã¸ã§ã¯ãã ã£ããã
åãã¤ã³ã¿ã¼ãã§ã¼ã¹ã«å®ç¾©ãããã¨ã§ããã®è¾ºãã¯é常ã«èªã¿ããããªãã¾ããææ§ãªæ¸ãæ¹ãããã°ãã³ã³ãã¤ã©ãææãã¾ããã
åæã®Javaã ã¨è¨äºã§ä¸ãããã¦ããã¡ãªããã«ããéãããã£ã¹ããå¢ãã¦çµå±åå®å ¨ãããªãã±ã¼ã¹ãå¤ã æãã¾ããããJava5以éã¯Genericsãããã®ã§ãã»ã¼ãã£ã¹ãã«åºããããã¨ã¯ç¡ãã§ãããã
ä»ã«ãJavadocãæ¸ãã¨ãã«åæ å ±ãè¨è¼ãã¦ãªãã¦ãèªåçã«å ¥ãã¦ãããã¨ããå°å³ã«ä¾¿å©ãªæ©è½ãããã¾ãã
ããã©ã¼ãã³ã¹ãä»ãå ããããªãã¾ãããJITãåªç§ãªãåã®æãç¡ãã決å®å·®ã«ãªããªããããã§ããããã以å¤ã®ã¡ãªããã«æ³¨ç®ãã¦ã¿ã¾ããã
IDEãå¼·å
EclipseãNetBeans, IntelliJã¨è¨ã£ãIDEãçµæ§å¼·åã éçåä»ã¨ãããã¨ããã£ã¦ããªãã¡ã¯ã¿ãªã³ã°æ©è½ãå¼·åã«ãµãã¼ããã¦ãããã³ã¼ãã¢ã·ã¹ããç´ æ©ããã¤æ£ç¢ºã«åä½ãã¾ãã
ãªãã¡ã¯ã¿ãªã³ã°æ©è½ãå®å¿ãã¦ä½¿ããã¨ããã©ã¤ï¼ã¨ã©ã¼ã®éçºããããããªãã®ã§éçºã¹ãã¼ããã°ãã¨ã¢ãããã¾ããã
gitãsvnã¨ãã£ããã¼ã¸ã§ã³ç®¡çãGlassFishãJettyãªã©ã®ã¢ããªã±ã¼ã·ã§ã³ã³ã³ãããantãmavenãgradleã¨ãã£ããã«ããã¼ã«ã¨ã®é£æº/çµ±åãããããªã
IDEã¨ã¢ããªã±ã¼ã·ã§ã³ã³ã³ãããé£æºãã¦ããããããã¤ããã°ãã³ã³ãã¤ã«ãå¿ è¦ã¨ããç¹ãã»ã¼æèãããã¨ã¯ãªããã¨æãã¾ãã
IDEãªãã¦å«ã ï¼ vimãemacsã使ãããï¼ãã£ã¦äººãå± ãã§ããããã©ãçµ±ä¸ããç°å¢ããµã¯ã£ã¨ä½ããã®ã¯éçºç¾å ´ã«ã¯æç¨ãªãã¨ã ã¨æãã¾ãã
éç解æãå¼·å
Javaã¯éçåä»ãè¨èªãªã®ã§ã³ã³ãã¥ã¼ã¿ãèªã¿ãããã¨ããç¹å¾´ã¨ãé·å¹´éçºã®ç¬¬ä¸ç·ã§å©ç¨ããã¦ãããã¨ãããã¦ã¢ã«ãããã¯ãªç 究ã«ä½¿ããããã¨ãå¤ãã¨ããçç±ã§éç解æãã¼ã«ãè±å¯ã§ãã
ã³ã¼ãå質ãä¿ã¡ãã³ã¼ãã¬ãã¥ã¼ã®ã³ã¹ããæ¸ãããã¨ãåºæ¥ãã®ã§ã¨ããããå ¥ãã¨ããã»ããè¯ãã¬ãã«ã®ä»çµã¿ã§ãããªããªããã³ã¼ãã®ç¶ºéºãã¯ä¸é·æçãªçç£æ§ã®ããã«å¿ é ãªè¦ç´ ã ããã§ãã
ã¨ã¯ãããã¬ãã¥ã¼ããã¡ãã¨ããã®ã¯ã³ã¹ãçã«è¾ãã¦ãã£ã¦ãªããã£ã¦ã±ã¼ã¹ã¯çµæ§ããããããªãã§ããããï¼
Javaã ã¨FindbugãPMDãã¯ããæ§ã ãªè§£æãã¼ã«ãæã£ã¦ãã¦ãæä½éã®ã³ã¼ãå質ãä¿ã¤ã®ãé常ã«ç°¡åã§ããã³ã¼ãã¯ãã¼ã³ãå½åè¦ç´ãã¹ãå±éºãªä»£å ¥ãªã©ã¬ãã¥ã¼ãã§ãã¯ã·ã¼ãã§è¦ã¤ããç¨åº¦ã®ãã¨ã¯è¦ã¤ãã¦ããã¾ãã
ã¾ããVeracodeã¨ãã®åç¨è£½åã ã¨ã»ãã¥ãªãã£è¦³ç¹ã§ãéç解æãè¡ãSQLã¤ã³ã¸ã§ã¯ã·ã§ã³ãXSS, CSRFã®çãçãæ¤åºãã¦ããã¾ãã
ãã¡ãããRubyãPHPã«ããããã£ããã®ã¯æãã¾ãããä¸æ¥ã®é·ãããJavaã®ã¬ãã«ã¾ã§ã¯éãã¦ããªãèªèã§ãã
ã³ã¼ãã£ã³ã°è¦ç´ã®æ¹è¨ãå°ãªã
Javaã¯å ¨é¢çã«Sunæ代ã®ã³ã¼ãã£ã³ã°è¦ç´ããã¼ã¹ã¨ãããã®ã使ããã¦ãã¦ã³ã¼ãã£ã³ã°è¦ç´ã«é¢ãã¦Javaã¨ã³ã¸ãã¢å ¨å¡ãããç¨åº¦å ±éã®èªèãæã£ã¦ãã¾ãã
ãã®ãããã¢ã¸ã¥ã¼ã«ãã¨ã«CamelCaseã ã£ããSNAKEã ã£ããããªãã§ãããã¡ããå®å ¨ã«æ¹è¨ã¨ããããããããã®è¦ç´ãç¡ãããã§ã¯ããã¾ãããã ããªãå°ããã®ã§ãå³å¯ãªã«ã¼ã«ç¡ãã¦ãããç¨åº¦çµ±ä¸ã§ããå®ææ¦äºãèµ·ãã«ããã§ãã
ãããªãã«é«ãçç£æ§
ããã©ãããè¨èªãåé·ãªè¨èªã¨ãã¦è©å¤ãªJavaã§ãããããã¾ã§çç£æ§ã®æªãè¨èªã§ã¯ããã¾ããã
ãªãã¸ã§ã¯ãæåè¨èªã¨ãã¦ã®åºæ¬çãªæ©è½ã¯æãã¦ãããæ¨æºã¯ã©ã¹ã©ã¤ãã©ãªãã©ãã©ãå¼·åããã¦ãã¾ãã ä¾ãã°ãå è¨äºã§è¨åãããã¦ãããã¡ãªããã§ãã
- ãã£ã¹ã(1.5以éã¯Genericsãããã®ã§é常ä¸è¦)
- æ£è¦è¡¨ç¾(1.4ããã§ãã)
- é£æ³é åå¦ç
- æååãã©ã¼ããã(1.5ããã§ãã)
ã¨é£æ³é åããªãã©ã«ãããªãã®ã§å°ãåé·ãªãã¨ãããããä»ã¯æ®ã£ã¦ãã¾ããã
å ãã¦1.7ã§ã¯Filesã§ãã¡ã¤ã«å¦çãç°¡åã«ãªãã1.8ããã¯å¾ æã®é¢æ°ãªãã¸ã§ã¯ãã¨StreamAPIãåæ¨è«ãããã¦æ¥ä»å¨ãã®ã©ã¤ãã©ãªæ¹ä¿®ãå ¥ãã¾ãã
ãã®è¾ºãå°å ¥ãããã°ãè¨èªæ©è½ã¨ãã¦ã大ããLLç³»ã¨è¦å£ããããã¨ã¯ãªãã§ãããã ã¾ãããªãã¬ã¯ã·ã§ã³ãAPTã§åºæ¬çãªã¡ã¿ããã°ã©ãã³ã°ãè¡ããã¨ãå¯è½ã§ãã
å ãã¦ãJavaEEãSpringã使ãã°ãWebã¢ããªã±ã¼ã·ã§ã³ãçµãã®ã¯ãã»ã©é£ããç¡ããã¨æãã¾ãã
é«ãä¸ä½äºæ
Javaã¯è¨èªã¨ãã¦ã®å®å®æ§ãé常ã«é«ãã§ãã
ãã¼ã¸ã§ã³ã¢ããã«ããéäºæã®è¨èªä»æ§ã®å¤æ´ãå ¥ããã¨ã¯ã»ã¼ç¡ãããªãã«ãããããªãã¦ãçµæ§ãã®ã¾ã¾åããã¨ã¯å¤ãã§ãã ä¸æ¹ãLLã§Webã§ãã使ãããPHPãRubyã¯çµæ§ã²ã©ãã§ãï¼ç´è¿ã®ãã¼ã¸ã§ã³ã¢ããã¯æ¯è¼çãã·ã§ããï¼ãå½ããåã®ããã«APIçãçµ±å»åããã¾ãã
èªåãã¡ã®æ¸ããã³ã¼ãã ãã§ã¯ãªããFWãã©ã¤ãã©ãªãå½±é¿ãåããå ´åããããããããã¨ã¯ä¸ãããªããªãã¾ãã ãªãä¸ããªããã°ãããã¨ãè¨ããããã§ãããä¸ã®ä¸ã«ã¯ã»ãã¥ãªãã£ã¢ãããã¼ãã¨ãããã®ãæãã¾ããé©åº¦ã«ææ°åããªãã¨è´å½çãªã»ãã¥ãªãã£ãæ¾ç½®ãããã¨ã«ãªã£ã¦ãã¾ãã¾ãã
ãããã£ãç¹ã¯ã4,5年以ä¸ã®éç¨ã«ã¯é常ã«éè¦ã§ãã
ã¢ãã¿ãªã³ã°ã®ãããã
.NETç³»ããããããã§ãããJMXã«ãããªã³ã©ã¤ã³ç£è¦ãã¹ã¬ãããã³ããã¡ã¢ãªãã³ããGCãã°ã¨ãã£ããªã½ã¼ã¹ã¢ãã¿ãªã³ã°ãé害調æ»ã®ããã®ä»çµã¿ãé常ã«å¼·åã§ãã
ãããã¡ã¤ã©ãVisualVMãJava Mission Controlãªã©å¼·åãªãã®ãããã©ã«ãã§ã¤ãã¦ãã¾ãã
æè¿ã ã¨FlightRecorderãENdoSnipeãªã©éç¨æã«ä½è² è·ã§ãããã¡ã¤ã©ç´ã®æ å ±ãåå¾ã§ãããã®ãããã¾ããGCã®ã¿ã¤ãã³ã°ãããããã¡ã½ããã¾ã§åããã§ã®ãåé¡çºçæã®åãåããããã¶ã楽ã«ãªãã¾ãã
LLã§ã使ããNew Relicã¨ããç»å ´ãã¦ãããJavaã ãã®ç¹å¾´ã§ã¯ãªãã§ãããããããå«ããéç¨ãã¦ãã¦ã®èç©ã¯ã¾ã åã£ã¦ãã¨æãã¾ãã
ã¾ã¨ã
è²ã æ¸ãã¾ããããä¸è¨ã®ï¼ç¹ã«ã¡ãªãããéç´ã§ããã¨æãã¾ã
- è¨èªæ©è½ãéçºç°å¢ã«ããã³ã¼ãå質ãçç£æ§ã®åºä¸ãããããããã人ã®ç¢ºä¿ãæ¯è¼ç容æ
- è¨èªã®å®å®æ§ãã¢ãã¿ãªã³ã°ãªã©éç¨æã«é½åã®è¯ãé¨åãå¤ã
å¥æ®µJavaãæé«ã®è¨èªã ã¨ã¯ã¡ã£ã¨ãæãã¾ãããScalaã¨ãRubyã¨ãã®æ¹ãæ®éã«å¥½ãã§ãã
Javaã®ãã¡ãªãããå¤ããããScalaãRubyã»ã©ã®çç£æ§ã¯ãªãã§ãããHaskellã»ã©ã®å®å ¨æ§ãããã¾ãããC++ã®ãããªããã©ã¼ãã³ã¹ããªãã§ãã ã¡ã¢ãªãããé£ãã¾ãããã¤ã³ã¡ã¢ãªã»ãã·ã§ã³ã¬ããªã±ã¼ã·ã§ã³ã使ããªãå°æ´GCã«ã¯æ°ãã¤ããã°ãªãã¾ããããã©ã³ãµè¨å®ãã¹ãã£ããã¼ã«ããå¿ è¦ãããã®ãé¢åã§ãã
ã¨ã¯ãããä»äºã§ä¸é·æçã«ä½¿ããªããå ã«ä¸ããï¼ã¤ã®ã¡ãªããã¯æ¨ã¦ããããã®ãªã®ã§ãå人çã«ã¯ã¾ã ã¾ã Javaã¨ããé¸æè¢ãããããã ãªï½ãã¨æã£ã¦ãã¾ãã
ããã§ã¯Happy Hacking!
åè:
ã¡ãã£ã¨ã ã追è¨
æ³å以ä¸ã«ãã¯ãããã£ã¦ã³ã£ãããªä»æ¥ãã®ããã§ãã
ã§ãã³ã¡ã³ãã¨ãè¦ã¦ã¦ãã¡ãã£ã¨è£è¶³ããæ¹ããããªãã¨æãããã¨ããã£ãã®ã§å°ã追è¨ãã¾ãã
ããã¯Javaãããªãã¦JVMã®ç¹å¾´
é害æ å ±ãã¢ãã¿ãªã³ã°ç³»ã¨ãã¯ããã§ãããã ããç§ãå人çã«ã¯Scalaæ¼ãã§ãããã ãJVMã®æ©è½ã使ãããã¨ãããJavaã®ç¹å¾´ãªã®ã§ãã¡ãªãããã¦è©ä¾¡é ç®ã«ã¯å ¥ããã¨æãã¾ãã
éã«ãRubyãScalaãGroovyãè¨èªã®å®å®æ§/éç解æãã¼ã«ã®å質ã¨ããç¹ã§ã¯ã¾ã Javaã«åãã§ãªãã¨æãã¦ãã®ã§ãåç´ç½®ãæãã§ãããã®ãããªãããªãã¨ã
ãã®ã¡ãªããã¯â¯â¯è¨èªä½¿ã£ãã»ããå¾ãããã
ãããããããªãã§ããå°ãªãã¨ãJavaã常ã«æé©è§£ã«ãªãããã§ã¯æ±ºãã¦ç¡ãã§ãã å½ããåã§ããé©æé©æããã¾ããææã¡ã®æï¼äººãã¢ããéãæéï¼ã«ãã£ã¦ãåãã·ã¹ãã è¦ä»¶ã§ãå¤ããã§ãããã
C#ãªããã¯è¨èªçã«ã¯åãæ¹åã§ãã¤Javaããæ©è½çãªã®ã§ã代æ¿åè£ã¨ãã¦ã¯ææåã§ããã ãã ãå人çã«ã¯Windowsãµã¼ãã®é©åãªéç¨ãã¦ãã¦ãæã£ã¦ç¡ãã®ã§ãWebç³»ã¨ãã«ã¯æ¡ç¨ããããªãã§ããã¨ã¯ãããæµ·å¤ã§ã¯ä¸è¬çã§ãããAzureãåºãã®ã§å½å ã§ãè¯ãé¸æã«ãªãããã§ããã
ãã®ä¸ã§ããã®è¨äºèªä½ããJava使ãã¡ãªããã¯ããã®ï¼ãã¨ããåã対ããåçãªã®ã§ãé ããªããªå¦å®ãï¼ãããå¤ãæ å ±ã§ï¼ãã¦ã»ãããªããªããã¨ããæå³ãªã®ã§è¨è¼ããã¡ãªãããä»ã®è¨èªã§åãããªããã¨ããæå³ã§ã¯å ¨ãç¡ãã§ãã
è¨èªæ¯ãã¦ã¼ã¹ã±ã¼ã¹æ¯ã«æ¡ç¨ãå¤æããããã®æ§ã ãªç¹å¾´ãããã®ã§ãä»è¨èªã§ä¼¼ããããªè¦³ç¹ã®è¨äºãæ¸ãã¦ã¿ããã§ãããå¥ã®äººãæ¸ããããããªè¨èªãç°å¢ã®è¨äºãè¦ã¦ã¿ããã§ããã¼ã