我也曾對架構師的力量一無所知

{"type":"doc","content":[{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"是不是覺得這個標題似曾相識?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"沒錯,就是致敬韓寒的那篇《"},{"type":"link","attrs":{"href":"https://mp.weixin.qq.com/s?__biz=MjM5ODA0NTc4MA==&mid=2652754514&idx=1&sn=af27dd501723b39257c8cdf4cd152fb1&scene=21#wechat_redirect","title":null},"content":[{"type":"text","marks":[{"type":"italic"}],"text":"我也曾對那種力量一無所知"}],"marks":[{"type":"strong"}]},{"type":"text","text":"》。全文主旨就是業餘玩家自嗨可以,但千萬別狂妄到企圖挑釁專業選手。否則,下場就和當初的 "},{"type":"text","marks":[{"type":"strong"}],"text":"松江新區·奧沙利文·韓寒"},{"type":"text","text":" 一樣,在潘曉婷面前只有開球的份兒。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"雖說我和韓寒同年,但也算是“看着他長大”的。韓寒成名於新概念作文,而後不斷開掛,在作家、賽車手、導演等多個角色上都遊刃有餘且扮演的相當成功,如此色彩斑斕的人生一直讓我豔羨不已。而我,一介碼農,初時隨波逐流,醒時已亦步亦趨在架構之路上,艱苦非常。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"因爲,架構師的力量,我也曾一無所知。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"代碼執念"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"每個程序員對美的代碼的認知不盡相同,但大多有個共識,那就是,架構師設定的各種條條框框簡直是"},{"type":"text","marks":[{"type":"strong"}],"text":"對美的褻瀆"},{"type":"text","text":"!"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"其實,你可能對架構師的執念一無所知!"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"表面看到的"},{"type":"text","text":":架構師成天沒事找事,發佈代碼規範,設定評審標準。執着於代碼的潔癖,分層的固化、API的標準化、中間件的抽象化..."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"實際發生的"},{"type":"text","text":":光禿禿(沒註釋)的形似被混淆過(兒戲的命名|對不齊的段落...)的千行代碼,事務的註解可能在每一層都出現過,邏輯代碼散落在Business/Service/Dao各層,只是因爲不喜歡Hibernate所以選擇MyBatis,只是因爲谷歌腦殘粉所以選擇Gson/Guava..."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"隨心所欲的代碼會帶來維護的困難和各種技術債,不統一的技術框架會引入更多的學習切換成本和升級優化成本,評審口徑不一致會導致團隊聚焦散亂各自爲戰...架構師作爲團隊的一個高攻厚血型英雄,着實操碎了心。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"架構師的執念,就是盡最大努力,在低位面減少技術熵增,高位面尋求技術突破"},{"type":"text","text":"。"}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":""}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"通過規範指定的標準都是"},{"type":"text","marks":[{"type":"strong"}],"text":"低位面"},{"type":"text","text":",不需要你在低位面上浪費任何時間扯犢子。而高位面一定是無法給出規範標準的,任你創新和發揮。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"”"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"同樣是打印Hello World,就是有人會多渲染個ASCII字符畫,讓控制檯輸出不那麼冷冰冰。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/b4/b4617050988f9ec8b1db2b2c530d7653.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/e3/e3d3b40a968a4634b93a58a1cce9bf33.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"第一次看到架構師寫出下面這種條件表達式的"},{"type":"text","marks":[{"type":"strong"}],"text":"非常規"},{"type":"text","text":"寫法時,"}]},{"type":"codeblock","attrs":{"lang":"java"},"content":[{"type":"text","text":"if ( 1 == iCount ) {}\nif ( null != response && \"SUCC\".equals(response.getCode()) {}"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"年幼無知的我曾經“嗤”出了聲:“寫個等式都要顛三倒四,整噱頭博眼球麼?” 直到我寫出瞭如下錯誤,"}]},{"type":"codeblock","attrs":{"lang":"java"},"content":[{"type":"text","text":"if ( iCount = 1 ) {}   //漏了等號,永遠爲真\nif ( response != null && response.getCode().equals(\"SUCC\")) {} //少寫判空導致的空指針異常"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這種代碼的反差猶如龍門客棧的老闆娘"},{"type":"text","marks":[{"type":"strong"}],"text":"金鑲玉"},{"type":"text","text":",看似風騷潑辣殺人越貨,實則純粹坦蕩至情至性。"}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/0b/0b1a59ed8cf7e87e3b46c15f6be2f2e9.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","marks":[{"type":"italic"},{"type":"size","attrs":{"size":9}}],"text":"張曼玉版金鑲玉"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"當你傻傻的寫乘/除2的N次方時可還記得騷氣的位運算...騷氣的try-with-resource...騷氣的Lambda...騷氣的動態字節碼...比比皆是。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這麼些年我總結下來,架構師對代碼的執念就是八個字:"},{"type":"text","marks":[{"type":"strong"}],"text":"穩中帶騷,騷中求穩"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"用 "},{"type":"text","marks":[{"type":"strong"}],"text":"Python之禪"},{"type":"text","text":" 收個尾:"}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/94/940bf8b9b534e198f2d1d3943062a6cb.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"造物主思維"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"只活在IDE裏寫代碼,是成不了架構師的。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"某個風和日麗的下午,公司裏一個小夥伴到我面前說:他申請在一個月內重寫消息網關係統(承載短信、微信、郵件、App推送四大渠道),原因是目前的系統太難用了。我的第一反應是 "},{"type":"text","marks":[{"type":"strong"}],"text":"“WOC,我一直盼望的那個救世主終於出現了麼?!”"},{"type":"text","text":" 其實吧,那個消息網關係統曾經是我和架構組兄弟花不少力氣設計的,本身並沒有什麼大問題,最多就是隨着消息數量的指數級上升,需要做一些性能優化,比如 "},{"type":"text","marks":[{"type":"italic"},{"type":"strong"}],"text":"分庫分表"},{"type":"text","text":" 和 "},{"type":"text","marks":[{"type":"italic"},{"type":"strong"}],"text":"數據歸檔"},{"type":"text","text":" 就能解決大部分問題,而這些升級所需的擴展性在設計初期就考慮過。我生怕表現出對這位“救世主”的質疑而顯得不禮貌,就小心翼翼的試探了兩個問題:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“如何平衡上游業務的洪峯和下游消息通道的最大承載,最大化單位時間內的吞吐量?”"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"——"},{"type":"text","marks":[{"type":"strong"}],"text":"微服務體系的流量控制"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“個人交易消息和全局活動消息,如何存儲和查詢?”"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"——"},{"type":"text","marks":[{"type":"strong"}],"text":"時間和空間的抉擇"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"結果我得到的回覆只是線程池、異步化和緩存的泛泛之談,離真正的落地還差的很遠。除了上面2個問題,還有同步異步、時效、延遲、通道隔離、信息補償、環境開關等的實現同樣很重要。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"造物思維就是從0到1需要的思維,這個1可不簡單,它必須包含進化到100所需要的一切基礎鋪墊"},{"type":"text","text":"。女媧摶tuán土造人只存在於神話中, 而架構師就是可以從0到1創造系統的“上帝”,"},{"type":"codeinline","content":[{"type":"text","text":"只是翻船事故時有發生而已"}]},{"type":"text","text":"。不要輕視任何從0到1的創造性活動,這裏所包含的知識或技能體量遠超你的想象。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"爲了解釋這個過程,"},{"type":"text","marks":[{"type":"strong"}],"text":"請你單從數學的角度,告訴我 (0, 1) 這個開區間之中到底有多少個數"},{"type":"text","text":"?"}]},{"type":"bulletedlist","content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果是無窮,那麼二進制的計算機如何運算這無窮的數字呢?有同學回答,計算機是使用離散的浮點數來表示這些小數的。是沒錯,而本質上,浮點數在座標軸上也就只是很密集的點而已,根本就不是連續的線。"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"既然全是點,更加疑惑了,計算機怎麼畫線呢?到這裏就可以結束了,因爲顯示器的像素本就是人肉眼無法識別的小格子,足夠密集的點足以呈現出線的效果。"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"繼續刨根問底,那得了解下什麼是定點數了,纔可以讓密集的那些點更加的密集。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"希望你能靜下心來讀讀這篇浮點數,"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"讀完你至少可以瞭解“取值範圍”和“可表示的個數”之間、浮點數和定點數之間的區別等等。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https://mp.weixin.qq.com/s?__biz=MzA5ODA5Mzk3MA==&mid=2647566409&idx=1&sn=649aa335e1ba15ef17a62a4f3bbebe73&scene=21#wechat_redirect","title":null},"content":[{"type":"text","text":" 《格物致知-Floating Point》"}],"marks":[{"type":"strong"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我想我應該從一個理科男的角度,說明白了創造需要的是什麼:"},{"type":"text","marks":[{"type":"strong"}],"text":"足夠密集的知識點和它們之間的連接"},{"type":"text","text":"。也有人把它包裝成了“"},{"type":"text","marks":[{"type":"italic"},{"type":"strong"}],"text":"知識體系"},{"type":"text","text":"”,說到底,一個意思。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"創造本身已然不容易,如何創造更加五花八門。"},{"type":"text","marks":[{"type":"strong"}],"text":"架構選型其實就是選擇如何創造"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"同樣是索引化的數據存儲,Kafka是索引文件和數據文件分離,MySQL InnoDB卻是索引和數據在同一個ibd文件裏。都說多線程吞吐量高響應快,Redis卻選擇了單線程模型("},{"type":"codeinline","content":[{"type":"text","text":"Redis6已經加入了多線程實現,主要用於處理網絡IO上。命令的執行依然是主線程串行執行"}]},{"type":"text","text":")。孰對孰錯?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"所以"},{"type":"text","marks":[{"type":"strong"}],"text":"創造從來都不是千篇一律,也不是一成不變,而是量體裁衣"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"高明的架構師心裏藏有無數的架構設計方案,但對於不同的場景,他會選擇最合適的那個來實現。因爲"},{"type":"text","marks":[{"type":"strong"}],"text":"架構更像一種藝術而不是科學"},{"type":"text","text":"。你只看結論的話,或許最終方案並不怎麼出色,甚至很普通。但是它是經過N個方案PK勝出的The One,對其他你以爲更好的方案所面臨的未知,你可能一無所知。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"面對未知的勇氣"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我有深海恐懼症,許多人都有。因爲面對黑不見底的海水,我們充滿了對未知的恐懼。"}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/ed/ede95dbb74a95d6cfbde7733d45ba0af.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","marks":[{"type":"italic"},{"type":"size","attrs":{"size":9}}],"text":"百度有時也挺人性的"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"IT行業的未知每天都在發生着,經常讓我們手忙腳亂。何謂\""},{"type":"text","marks":[{"type":"strong"}],"text":"未知"},{"type":"text","text":"\"?它可以是詭異的生產故障,可以是全新的技術,也可以是模糊的未來業務形態, 而架構師的核心職責之一就是"},{"type":"text","marks":[{"type":"strong"}],"text":"從容的解決未知"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"就,對大家來說一樣都是未知,憑啥架構師就有勇氣從容應對?傻孩子,架構師的身後哪裏還有人?不得死撐哇!當然我是在開玩笑。許多詭異的生產問題有重啓大法,但讓習慣了SSH編程的你,使用Reactive來實現一套響應式服務端系統,這種未知領域你會如何應對?連產品經理都看不清的未來業務形態,你又會如何設計系統的擴展性呢?"}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"草木皆兵"}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"問:你這一生碰到過的最嚴重的生產事故是什麼?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"答:抱歉,從未碰到過。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"你會如何評價此人?架構師生而從容,不僅是做到泰山崩於前而色不變,更是因爲嚴重的事故甚至細微的事故苗頭都早已被扼殺在搖籃之中。"},{"type":"text","marks":[{"type":"strong"}],"text":"海恩法則"},{"type":"text","text":"指出:每一起嚴重事故的背後,必然有 29 起輕微事故和 300 起未遂先兆以及 1000 起事故隱患。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"幾年前有段時間我開車總覺得方向盤有點鬆動,一直沒當回事,覺得可能車老了或者自己平時方向打太緊了。某天預約做保養,車店老闆小馬哥把我車開走沒10分鐘,就給我來一電話:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“你的轉向柱可能出問題了,方向盤有點鬆,你之前有發現麼?”"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“"},{"type":"text","marks":[{"type":"italic"}],"text":"我知道的,可能車老了吧,也沒當回事。"},{"type":"text","text":"”"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“你小子,轉向問題很嚇人的,我都不敢開了,到店裏馬上幫你檢查看看。”"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"後來結果你們也想得到,真的是轉向柱斷裂!幸好在事態嚴重之前,小馬哥憑藉專業素養髮覺了這個隱患。所以這"},{"type":"text","marks":[{"type":"strong"}],"text":"到底是是我的無知無畏還是小馬哥的小題大做"},{"type":"text","text":"?開車的同學都知道車的制動、轉向是性命攸關的大事,但是你自問對 車跑偏、剎車異響、剎車發抖、轉向沉重 都足夠警覺麼?其實,架構師在評審會上表現出的“"},{"type":"text","marks":[{"type":"strong"}],"text":"草木皆兵"},{"type":"text","text":"”亦是一種執念,他所看到的“"},{"type":"text","marks":[{"type":"strong"}],"text":"屍橫遍野"},{"type":"text","text":"”,你可能一無所知。"}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"知道自己不知道"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"給你100W讓你實現一個數據庫,這活敢接麼?就說這活本身,先別忙嫌錢多錢少。把你所有的與數據庫相關的知識拿出來,你看看能湊出下面哪些模塊出來?"}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/39/39e011031421734b555fb77e819c7dd5.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"先搞清楚“知道自己不知道”的是什麼,纔有辦法將未知變已知。"},{"type":"text","marks":[{"type":"strong"}],"text":"解決未知就是不斷的轉化已知的過程"},{"type":"text","text":"。這也是爲什麼競品軟件都在造輪子,但是側重點迥然不同,就是已知不同。這個“已知”可以是商業產品、開源產品,也可以是論文報告,還可以是業務、技術痛點,不一而足。"},{"type":"text","marks":[{"type":"italic"}],"text":"RocketMQ"},{"type":"text","text":"當初參照了Kafka,在犧牲了部分性能的情況下優化了投遞時效、消息順序、消息軌跡等;"},{"type":"text","marks":[{"type":"italic"}],"text":"TiDB"},{"type":"text","text":" 是基於 "},{"type":"text","marks":[{"type":"italic"}],"text":"Google Spanner / F1"},{"type":"text","text":" 論文實現的開源分佈式 NewSQL 數據庫;開源調用鏈如Skywalking、Pinpoint都是基於 "},{"type":"text","marks":[{"type":"italic"}],"text":"Google Dapper"},{"type":"text","text":"  論文實現的;界面簡潔、容量大、搜索強的 "},{"type":"text","marks":[{"type":"italic"}],"text":"Gmail"},{"type":"text","text":" 橫空出世,面對衆多傳統郵箱的狙擊,依然成爲人們最愛的郵箱品牌,順便激活了半死不活的 "},{"type":"text","marks":[{"type":"italic"}],"text":"javascript"},{"type":"text","text":" ..."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"未知? 不過爾爾。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"架構師的天賦"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"只有天才的程序員,沒有天才的架構師。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"架構師靠的不是天賦,而是勤勉,要靠大量時間進行實戰操練和經驗積累。身邊水貨架構師這麼多,也是因爲國內的技術氛圍略顯浮躁,留給架構師成長的那點可憐的時間和空間,時刻被公司項目擠壓着,拔苗助長,不得不水。熱門吵架題目“"},{"type":"text","marks":[{"type":"strong"}],"text":"架構師要不要寫代碼"},{"type":"text","text":"”,理性點的人會把架構師做個分類,摘出個比如 "},{"type":"text","marks":[{"type":"italic"}],"text":"業務架構師"},{"type":"text","text":",說可以不用寫代碼。但是他不可能從石頭縫裏蹦出來,若沒有對業務浸淫多年的歷練(編碼只是一個歷練維度),如何能設計出合理的業務架構來?所以別再問這種傻X問題了,何苦給自己的偷懶找藉口還如此冠冕堂皇?寧願換個題目討論,"},{"type":"text","marks":[{"type":"strong"}],"text":"“架構師的門檻是寫多少行代碼”"},{"type":"text","text":"。"}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"技術密度"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"程序員起步階段的技術能力,通常是“蜂窩”狀的,也就是存在大量的"},{"type":"text","marks":[{"type":"strong"}],"text":"技術空洞"},{"type":"text","text":",而這些空洞需要通過勤勞的採蜜,累積一點一滴的“"},{"type":"text","marks":[{"type":"strong"}],"text":"蜂蜜"},{"type":"text","text":"”來填滿。科學愛好者都知道中子星的密度堪比黑洞,類比將地球壓縮成中子星,直徑只有22米,普通的原子都沒辦法在中子星附近停留,會被撕碎、經過引力坍塌後進一步壓縮。架構師就擅長這種吸收並壓縮知識的套路。硬要我給架構師的天賦定一個指標的話,那就是"},{"type":"text","marks":[{"type":"strong"}],"text":"技術密度的高低"},{"type":"text","text":"。初二物理都學過 "},{"type":"text","marks":[{"type":"italic"},{"type":"strong"}],"text":"密度 = 質量 / 體積"},{"type":"text","text":"。對應到代碼,同樣質量的一個功能,你寫一頁,架構師寥寥幾行,這就是高技術密度的直觀體現。"}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/00/009bad8c1a5f55eca06687bebfc3d257.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"有效練習"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"再來,假如已經部分交付如上圖的一個“"},{"type":"text","marks":[{"type":"strong"}],"text":"蜂巢"},{"type":"text","text":"”系統,現在需要你實現更多的“"},{"type":"text","marks":[{"type":"strong"}],"text":"六角蜂室"},{"type":"text","text":"”以擴充這個蜂巢。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這個工作乍看起來像不像重複勞動?"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"其實不然。"},{"type":"text","marks":[{"type":"strong"}],"text":"首先爲什麼選擇六邊形?"},{"type":"text","text":" 不是圓形不是三角形不是正方形?經測量,六邊形蜂室的所有鈍角都是109°28′,所有銳角都是70°32′。曾有法國數學家研究過,如果要消耗最少的蜂蠟,製成更少間隙、更大容積和更堅固的容器,就只有這個角度的六邊形。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"其次蜂巢是倒掛的,爲何液態的蜂蜜不會流出?"},{"type":"text","text":" 因爲蜂蜜本身含水量不到18%,流動性比水要低得多,但低流動性不代表不流動。所以蜂巢要保持9~14度左右的傾斜,進一步防止蜂蜜流出。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"實際結果是,你的“蜂室”交付了,但是"},{"type":"text","marks":[{"type":"strong"}],"text":"你對角度,一無所知"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我生來覺得自己是個愚人,即使學習成績一直算優秀,也會全歸於自己的勤勉。因爲身邊的天才好像真的不需要努力。我能成爲架構師,也是走上程序員這條不歸路的不得已之選。架構師之路漫長且艱難,而今我也只是摸到些許門路,大多時候對於自己的“不知道”依然惶惶不可終日。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"你是否也曾對架構師的力量不屑一顧過?不管是立志成爲架構師或已然成爲架構師,都請謙虛並努力起來。誰也不敢妄言自己掌握了架構的終極力量,因爲"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#FF7021","name":"orange"}},{"type":"strong"}],"text":"架構之路越走越無知,一如人生路。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#FF7021","name":"orange"}},{"type":"strong"}],"text":"尊重架構師的力量,一如尊重未來的你。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章