Adventure From Java To Ruby——急转直下还是三思后行

这本书并不如其人在IBM开发网上的短文有技术含量,因为此书主要是给管理者看的,也是显摆他的白水漂流和单车下山的爱好。

这是台湾的友人blog:

http://ihower.idv.tw/blog/archives/1451#more-1451


[img]http://pragmaticprogrammer.com/images/fr_j2r_medium.jpg[/img]


From Java to Ruby

這本書是 Developer 買來說服 Manager 使用 Ruby 的書,或是自己說服自己。作者也是 Beyond Java 的作者,不過很有趣出版社換成 The Pragmatic Programmers 了哩。剛好最近常有非技術背景的人問我為什麼要從PHP換成用 Ruby。老實說,我的理由主要出自對 Ruby 的好感,喜歡它渾然自成的風格,先進簡潔又不會太難懂,也驚嘆 Ruby on Rails 的漂亮架構。不過為了說服更多人,作者寫了這本書,方便我們跟別人解釋的時候多掰一點… :p

作者自己開始採用 Ruby 作為專案開發的理由是 1.人,許多作者尊敬的程式設計師開始投靠Ruby,包括Java圈中有名的framework開發者 2. Java過多複雜的框架逐漸造成生產力限制 3.RoR爆炸性成長,以往作者只有看過Java和C++誕生時有這樣的榮景 4.Ruby很快樂,重拾作者初學Java時的熱情 5.RoR開始成熟了,作者相信可以滿足客戶作為商用。

當然這本書也會告訴你 Java 哪裡限制,哪裡 Ruby 更適合,哪裡 Java 適合,哪裡 Ruby還不成熟。Java complexity 在增加,Availability在降低,Competition 在日漸增加(如PHP,LAMP,Ruby)。這個時代 Productivity 就是王道,作者認為 RoR就是催化劑,幫助Ruby跨過市場觀望的鴻溝,未來 Ruby 將不只只有這一個 Framework。本書的一個中心問題就是 如何調整更換程式語言的風險? Java風險在增加,而 Ruby在下降,所以趁早擁抱ruby吧。

本書主要依照採用新語言的 Process 來編排,分成三個階段(資料收集,有限部署,廣泛部署),各兩個步驟。1.確認痛苦 2.建立報償 3.建立Pilot 4.有限部署 5.整合 6. Ramp up

至此第一章 Induction 結束。以下隨便摘錄重點。

Pain

* 在採用Ruby之前,你先要確定你現在有什麼 Pain。
* Java的poor productivity來自C++的遺產及過多的架構。
* Martin Fowler (寫 P of EAA那位) 認為Java的非必要複雜性不可接受的太高。

Establishing Your Reward

* 從下載次數,願景,書籍可以觀察 Ruby 的成長。
* Ruby 的基石就是 Productivity (生產力),不管是短程或長程來看。
* Java 的風險目前因為佔優勢的市場地位而比較低,但是專案風險卻因為開發時間和複雜度在增加。
* Java 是 infrastructure 語言不適用在許多應用程式。

Pilot

* 任何有效的 Pilot 都需要把現有的技術跟政治現實納入考量
* learning 和 selling 的目標常不一致。挑難的部份用Ruby,可以學比較多,但又怕失敗。挑簡單的用Ruby,學到比較少,但比較容易成功。以下分五個導入情境 :
* 典型法,重點放學習,在高技術風險的地方導入 Ruby
* 比較法,同一案同時採用 Java 跟 Ruby 實作,同時比較優缺。
* 特洛依法,在低風險案採用Ruby,逐漸獲得成功。
* 賭上你的生意法,風險最大報酬最高,適合新公司,如 37signals,利用更好的 dynamic 跟 productive 的程式語言來對抗大公司,小蝦米對抗大鯨魚出奇才能致勝。
* 拯救法,把用 Java 失敗的案子給 Ruby 做。

On an Island

* Ruby 不只是 scripting 語言,在 integration, data munging, web development 和 rapid development 都很有辦法。
* Ruby on Rails 有和 PHP 或 Visual Basic 一樣的快速度,而且又比 Java 乾淨。
* Ruby middleware 支援 database integration, security, messaging, communications, XML, web services 等

Bridges

* Ruby 提供跟別的程式語言很好的整合,尤其是 Java。
* JRuby逐漸成熟,可以在 JVM 上跑 Ruby。
* Ruby framework 偏好簡潔的XML和web services實作。

Ramping Up

* 廣泛部署對Ruby還很新,deployment 策略常比類似的 java project 還先進。

Risk

最後一章談風險,包括技術上和政治上的。


http://railscn.com/viewtopic.php?t=1922
CCF大数据与计算智能大赛-面向电信行业存量用户的智能套餐个性化匹配模型联通赛-复赛第二名-【多分类,embedding】.zip项目工程资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松复刻,拿到资料包后可轻松复现出一样的项目,本人系统开发经验充足(全领域),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(如有)等。答辩评审平均分达到96分,放心下载使用!可轻松复现,设计报告也可借鉴此项目,该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的。 【提供帮助】:有任何使用问题欢迎随时与我联系,我会及时解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 下载后请首先打开README文件(如有),项目工程可直接复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用。
以下是一个简单的Java文字游戏,代码约为300行: ```java import java.util.Scanner; public class TextAdventureGame { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String name; int age; System.out.println("Welcome to the Text Adventure Game!"); System.out.print("Please enter your name: "); name = sc.nextLine(); System.out.print("Please enter your age: "); age = sc.nextInt(); sc.nextLine(); // consume the remaining newline character System.out.println("Hello " + name + "! You are " + age + " years old."); System.out.println("You wake up in a dark room with no memory of how you got there."); System.out.println("You see two doors, one on your left and one on your right."); System.out.print("Which door do you choose? (left/right): "); String doorChoice = sc.nextLine(); if (doorChoice.equalsIgnoreCase("left")) { System.out.println("You open the door on the left and see a long hallway."); System.out.println("Do you want to go down the hallway? (yes/no): "); String hallwayChoice = sc.nextLine(); if (hallwayChoice.equalsIgnoreCase("yes")) { System.out.println("You walk down the hallway and see a treasure chest at the end."); System.out.println("You open the chest and find a map that leads to hidden treasure!"); System.out.println("Congratulations! You win the game!"); } else { System.out.println("You decide not to go down the hallway and go back to the room."); System.out.println("You see the other door and decide to try that one instead."); System.out.println("You open the door on the right and see a staircase going up."); System.out.println("Do you want to go up the stairs? (yes/no): "); String stairsChoice = sc.nextLine(); if (stairsChoice.equalsIgnoreCase("yes")) { System.out.println("You climb up the stairs and find yourself on the roof of a castle."); System.out.println("You see a rope hanging down from the roof."); System.out.println("Do you want to climb down the rope? (yes/no): "); String ropeChoice = sc.nextLine(); if (ropeChoice.equalsIgnoreCase("yes")) { System.out.println("You climb down the rope and escape from the castle!"); System.out.println("Congratulations! You win the game!"); } else { System.out.println("You decide not to climb down the rope and go back to the room."); System.out.println("You see the other door and decide to try that one instead."); System.out.println("You open the door on the left and see a long hallway."); System.out.println("You walk down the hallway and suddenly a trapdoor opens below you!"); System.out.println("You fall into a pit and die. Game over!"); } } else { System.out.println("You decide not to go up the stairs and go back to the room."); System.out.println("You see the other door and decide to try that one instead."); System.out.println("You open the door on the left and see a long hallway."); System.out.println("You walk down the hallway and suddenly a trapdoor opens below you!"); System.out.println("You fall into a pit and die. Game over!"); } } } else { System.out.println("You open the door on the right and see a staircase going up."); System.out.println("Do you want to go up the stairs? (yes/no): "); String stairsChoice = sc.nextLine(); if (stairsChoice.equalsIgnoreCase("yes")) { System.out.println("You climb up the stairs and find yourself on the roof of a castle."); System.out.println("You see a rope hanging down from the roof."); System.out.println("Do you want to climb down the rope? (yes/no): "); String ropeChoice = sc.nextLine(); if (ropeChoice.equalsIgnoreCase("yes")) { System.out.println("You climb down the rope and escape from the castle!"); System.out.println("Congratulations! You win the game!"); } else { System.out.println("You decide not to climb down the rope and go back to the room."); System.out.println("You see the other door and decide to try that one instead."); System.out.println("You open the door on the left and see a long hallway."); System.out.println("You walk down the hallway and suddenly a trapdoor opens below you!"); System.out.println("You fall into a pit and die. Game over!"); } } else { System.out.println("You decide not to go up the stairs and go back to the room."); System.out.println("You see the other door and decide to try that one instead."); System.out.println("You open the door on the left and see a long hallway."); System.out.println("You walk down the hallway and suddenly a trapdoor opens below you!"); System.out.println("You fall into a pit and die. Game over!"); } } } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值