nodejs_NodeJS歷險記

nodejs

by Elliott McNary

埃利奧特·麥克納里(Elliott McNary)

NodeJS歷險記 (Adventures in NodeJS)

I built an app a couple of weeks ago after going through FreeCodeCamp’s Front-End curriculum and wanted to write an update as I head into NodeJS-land. I was finally able to obtain my Front-End certificate, which I am very proud of, but the excitement quickly wore off once I jumped into the backend side of things.

在經歷了FreeCodeCamp的前端課程之后,幾周前,我構建了一個應用程序,并想在進入NodeJS領域時編寫一個更新。 我終于能夠獲得我的驕傲的前端證書,但是當我跳入后端時,興奮很快就消失了。

Learning NodeJS has been incredibly difficult so far. There’s no point in trying to sprinkle it with fairy dust. The move from the front-end of primarily using JQuery and some basic JS techniques, to the backend with plain ol’ Javascript and hundreds of callbacks showed me that I had no clue what I was doing.

到目前為止,學習NodeJS非常困難。 試圖撒上仙塵沒有任何意義。 從主要使用JQuery和一些基本JS技術的前端到使用普通Java腳本和數百個回調的后端,這向我表明我不知道自己在做什么。

NodeJS requires a fundamental understanding of Javascript. I definitely didn’t have that when I started trying to learn it. I had to go back to watching hours of YouTube videos explaining callbacks, the event loop, closures, scope, etc…

NodeJS需要對Java語言有基本的了解。 當我開始嘗試學習它時,我絕對沒有。 我不得不回頭看幾個小時的YouTube視頻,講解回調,事件循環,關閉,作用域等…

I started to get a fair amount of understanding, but would still get lost after tons of callbacks. I was using learnyounode and couldn’t even get past the first problem without looking for a solution.

我開始獲得相當多的了解,但是在大量回調之后仍然會迷失。 我使用的是learningyounode,即使沒有尋找解決方案也無法解決第一個問題。

I started consuming an incredible amount of MEAN Stack tutorials to try and get the basic ideas of using Express for routing and Node. I built no less than 4 different To-Do apps, 2 reddit clones, 1 Twitter clone, and 2 chat apps, before I realized I wasn’t really absorbing what was going on. I definitely wasn’t mindlessly following instructions, but they assumed I knew too much about Javascript.

我開始使用大量的MEAN Stack教程,試圖獲得使用Express進行路由和Node的基本思想。 在我意識到自己并沒有真正吸收正在發生的事情之前,我構建了不少于4種不同的To-Do應用,2個reddit克隆,1個Twitter克隆和2個聊天應用。 我絕對不會盲目地遵循說明,但是他們認為我對Java語言了解太多。

I started watching a series on TheNewBoston’s YouTube channel that really helped me get the fundamentals down. I was going to try and make another reddit clone, until I realized that I should learn with something I care about, the Soundcloud queue app I built.

我開始在TheNewBoston的YouTube頻道上觀看系列節目,這確實幫助我降低了基本面。 我打算嘗試制作另一個Reddit克隆,直到我意識到我應該學習自己關心的東西,即我構建的Soundcloud隊列應用程序。

I stopped watching things and started reading through documentation. I followed getting started tutorials to try and understand the fundamentals a bit more.

我不再看東西,而是開始閱讀文檔。 我按照入門教程進行操作,以嘗試進一步了解基礎知識。

I’ve frequently talked about the feeling of getting something to “click” when programming, and this time I had the same feeling. It’s a time you’ll never forget because your adrenaline is pumping and you can see some light. When I was able to setup my first database with key-value pairs, have events push things to the database, and then send the JSON to a route that I made was incredible. It was late and I was fist pumping around my room like a lunatic.

我經常談論在編程時讓某些東西“點擊”的感覺,而這次我有同樣的感覺。 這是一個您永遠不會忘記的時刻,因為腎上腺素不斷增加,您可以看到一些光線。 當我能夠使用鍵值對設置我的第一個數據庫時,讓事件將事件推送到數據庫,然后將JSON發送到我創建的路由中是不可思議的。 已經很晚了,我拳頭像瘋子一樣在房間里抽水。

From there I started to gain some confidence and kept pushing myself. I worked on finding, sorting, and incrementing my existing documents in MongoDB. I realized I wanted a live feed so I started looking into Socket.io.

從那開始,我開始獲得一些信心,并不斷地推動自己。 我致力于在MongoDB中查找,排序和增加現有文檔。 我意識到我想要直播,所以我開始研究Socket.io。

I think the problem with the tutorials I was consuming before, was that I never really learned why I was doing things. I was always just doing them and not really thinking about it. It’s incredibly important to know why you’re doing what you’re doing.

我認為我以前使用的教程的問題在于,我從來沒有真正了解過為什么要做事情。 我一直只是在做它們而沒有真正考慮它。 要知道為什么要做什么,這非常重要。

Instead of googling something that started with “How do I…”, I started searching for the why and trying to figure out what’s actually going on. My searches started to look more like “What is a refresh token in OAuth?” or “What does serialize and deserialize do in Passport.js?”.

我沒有去搜索以“我如何……”開頭的內容,而是開始尋找原因并試圖弄清實際情況。 我的搜索開始看起來更像“什么是OAuth中的刷新令牌?” 或“在Passport.js中序列化和反序列化做什么?”。

When I made that switch I really started to learn.

當我做出切換時,我真的開始學習了。

It’s also very important to keep pushing yourself. If you have something that you want to make, build it. There is always a way to do something, it’s just up to you to figure out (unless of course it’s an API limitation or something…then you just need to get a bit hack-y :). If you don’t know how to authenticate users, try to learn. If you don’t know how to create an RESTful API, learn! It’ll take a ton of time, but once it clicks you’ll be ecstatic.

不斷自我推銷也很重要。 如果您有想要制作的東西,請構建它。 總是有一種方法可以完成某件事,這取決于您自己決定(除非它是API限制之類的東西,否則……您只需要稍微加點子就可以了:)。 如果您不知道如何認證用戶,請嘗試學習。 如果您不知道如何創建RESTful API,請學習! 這將花費大量時間,但是一旦點擊,您就會欣喜若狂。

I was so in the zone last Sunday I was working until 5am when the Seahawks started playing here in Melbourne. It was a 14 hour coding-binge. I’ve really never had that much enjoyment and focus with anything before. It was a crazy feeling.

上周日,我一直在該區域工作,直到海鷹隊在墨爾本開始比賽的凌晨5點為止。 這是一個14個小時的編碼過程。 我以前從未真正享受過如此多的樂趣和關注。 這是一種瘋狂的感覺。

I’ve finally figured out (well sort of) how to deploy this with Heroku and it’s live. There is now a feed showing the songs that are being queued on the site, as well as a live artist feed in the top right showing the artists being searched now across the site. I have also implemented a Top 10 ranking for the Top 10 songs queued all time (well, since launching the feature).

我終于弄清楚了(如何進行)如何在Heroku中部署它,并且它是實時的。 現在有一個提要,顯示正在網站上排隊的歌曲,右上角還有一個現場藝術家提要,顯示了現在正在站點上搜索的藝術家。 我還為所有一直排隊的前10首歌曲實現了前10名的排名(自啟動此功能以來)。

The Random 20 is still there for all of those who use it to find new music. And thanks to a suggestion on my last post, I’ve enabled users to log in with their SoundCloud accounts and like songs.

對于所有使用它來查找新音樂的人來說,Random 20仍然存在。 多虧了我在上一篇文章中的建議,我使用戶能夠使用他們的SoundCloud帳戶和喜歡的歌曲登錄。

Learning Node and Javascript properly is going to be a long journey, but I have patience. Three months ago I didn’t even know what a variable was.

正確學習Node和Javascript將會很漫長,但是我有耐心。 三個月前,我什至不知道變量是什么。

You can follow my adventure on Twitter as well.

您也可以在Twitter上關注我的冒險經歷。

翻譯自: https://www.freecodecamp.org/news/adventures-in-nodejs-d3d1f85a9d3e/

nodejs

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/396345.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/396345.shtml
英文地址,請注明出處:http://en.pswp.cn/news/396345.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

pytdx 獲取板塊指數_能否增加一個通過股票代碼,板塊指數代碼獲得中文名稱的接口?...

T0002/hq_cache/shex.tnfT0002/hq_cache/szex.tnf這個解碼就是。/***************************************************股票代碼列表和股票名稱T0002/hq_cache/shex.tnfT0002/hq_cache/szex.tnf***************************************************/struct TdxSymbolMap {cha…

靈動標簽調用友情鏈接

1、文字形式[e:loop{select * from [!db.pre!]enewslink where checked1 and classid1 order by myorder,20,24,0}] <li><a href"<?$bqr[lurl]?>" title"<?$bqr[lname]?>" target"_blank"><?$bqr[lname]?>&…

4-----Scrapy框架中選擇器的用法

Scrapy提取數據有自己的一套機制&#xff0c;被稱作選擇器&#xff08;selectors&#xff09;,通過特定的Xpath或者CSS表達式來選擇HTML文件的某個部分Xpath是專門在XML文件中選擇節點的語言&#xff0c;也可以用在HTML上。CSS是一門將HTML文檔樣式化語言&#xff0c;選擇器由它…

【原】Jenkins持續集成環境搭建之創建java項目的job【centos6.5 java maven git 項目】...

一、構建一個maven項目在jenkins主頁上&#xff0c;左側&#xff0c;選擇“新建”&#xff0c;然后填寫項目名稱&#xff0c;選擇“構建一個maven項目”二、Git配置保存之后&#xff0c;進入詳細配置頁面&#xff1a;這里的源碼管理&#xff1a;選擇git&#xff0c;輸入代碼的g…

linux修改java內存大小_Linux 和 windows修改java虛擬機內存大小

1、Java內存區域劃分&#xff1a; 運行時的數據區:方法區和堆(各個線程共享的內存區域)&#xff0c;程序計數器、Java虛擬機棧和本地方法棧(線程私有的) 程序計數器&#xff1a;當前線程所執行字節碼的行號指示器&#xff0c;字節碼解釋器就是通過改變計算器的值來選取下一條需…

html制作彩虹_制作彩虹

html制作彩虹by Gil Fewster吉爾弗斯特(Gil Fewster) 制作彩虹 (Making rainbows) This is a story about curiosity. It’s also about what happens when you stick a needle into your eye. If you happen to be eating a handful of grapes right this moment, maybe come…

python3 set_python3.x 基礎三:set集合

| clear(...) 清空一個集合| Remove all elements from this set.>>>set1.clear()>>>set1set()| copy(...) 影子復制&#xff0c;指向同一個內存地址| Return a shallow copy of a set. |>>> list1[3, 2, 1, 1, 2, 3, 4, 5]>>>…

Linux內核分析作業第八周

進程的切換和系統的一般執行過程 一、進程調度的時機 中斷處理過程&#xff08;包括時鐘中斷、I/O中斷、系統調用和異常&#xff09;中&#xff0c;直接調用schedule()&#xff0c;或者返回用戶態時根據need_resched標記調用schedule()&#xff1b; 內核線程可以直接調用sched…

iOS--數據存儲NSUserDefaults

2019獨角獸企業重金招聘Python工程師標準>>> 今天去面試&#xff0c;被問道NSUserDefaults的存取并手寫出來&#xff0c;一時想不起來&#xff0c;回來之后看看之前的筆記&#xff0c;稍作一些整理 NSUserDefaults是一個單例&#xff0c;在整個程序中只有一個實例對…

巨人肩膀_如何站在巨人的肩膀上

巨人肩膀“If I have seen further than others, it is by standing on the shoulders of giants.” — Isaac Newton“如果我能比其他人看到更多&#xff0c;那就是站在巨人的肩膀上。” —艾薩克牛頓 In 1676, Isaac Newton spoke of the great thinkers who came before him…

mysql 觸發器定義變量_MySQL 函數存儲過程觸發器定義簡單示例

1.變量提示NEW 是新值-- OLD 是舊值INSERT 只有NEW ----UPDATE有NEW和OLD ---DELETE只有OLD2.準備測試表(userinfo、userinfolog)use test;create table userinfo(userid int,username varchar(10),userbirthday date);create table userinfolog(logtime datetime,loginfo varc…

[EOJ439] 強制在線

Description 見EOJ439 Solution 先考慮不強制在線怎么做。 按詢問區間右端點排序&#xff0c;從左往右掃&#xff0c;維護所有后綴的答案。 如果掃到 \(a[i]\)&#xff0c;那么讓統計個數的 \(cnt[a[i]]\). 如果\(cnt[a[i]]<a[i]\)&#xff0c;那么在當前的右端點固定的情況…

大數據 就業 缺口_中國AI&大數據就業趨勢報告:平均月薪超2萬,缺口650萬人...

2019世界人工智能大會開幕式上&#xff0c;特斯拉公司聯合創始人兼首席執行官Elon Musk 和中國企業家俱樂部主席、聯合國數字合作高級別小組聯合主席馬云進行了一場“雙馬”對話。談到人工智能話題時&#xff0c;馬斯克認為&#xff0c;“未來的科技發展變化將超越我們的能力”…

Android pm 命令詳解

一、pm命令介紹與包名信息查詢 1.pm命令介紹 pm工具為包管理&#xff08;package manager&#xff09;的簡稱 可以使用pm工具來執行應用的安裝和查詢應用寶的信息、系統權限、控制應用 pm工具是Android開發與測試過程中必不可少的工具&#xff0c;shell命令格式如下&#xff1a…

開源 非開源_開源為善

開源 非開源by Michael D. Johnson邁克爾約翰遜(Michael D.Johnson) 開源為善 (Open Source for Good) We’ve spent two years coding for a cause, one nonprofit at a time. And now Free Code Camp’s pushing ahead to help organizations at scale.我們花了兩年的時間為…

mysql5.6熱升級_Mysql5.6主從熱備配置

數據庫是應用系統的核心&#xff0c;為了保證數據庫的安全采用主從熱備是很常見的方法&#xff0c;也就是主數據庫DDL、DML都將被同步到從數據庫。一、 實驗環境操作系統&#xff1a;windowsserver 2008 R2數據庫&#xff1a;mysql-advanced-5.6.21-winx64二、 準備工作1、…

InfluxDB(官方使用說明)

安裝InfluxDB OSS 此頁面提供有關安裝&#xff0c;啟動和配置InfluxDB的說明。 InfluxDB OSS安裝要求 root為了成功完成&#xff0c;需要安裝InfluxDB軟件包或具有管理員權限。 InfluxDB OSS網絡端口 InfluxDB默認使用以下網絡端口&#xff1a; TCP端口8086用于通過InfluxDB的H…

incc與oracle連接_Oracle 連接和會話的區別

連接并不是會話的同義詞&#xff0c;發現這一點時很多人都很詫異。在大多數人眼里&#xff0c;它們都是一樣的&#xff0c;但事實上并不一定如此。在一條連接上可以建立0個、一個或多個會話。各個會話是單獨而且獨立的&#xff0c;即使它們共享同一條數據庫物理連接也是如此。一…

CodeForces 176B Word Cut(DP)

題意&#xff1a;給你a串和b串&#xff0c;你能切k次&#xff0c;每次切完將尾部分放在頭的前面&#xff0c;問有多少種方案切k次從a串變為b串 思路&#xff1a;令dp[i][0]為砍了i次變成b串的方案數&#xff0c;dp[i][1]為砍了i次變成非b串的方案數&#xff0c;然后預處理一下前…

如何將React App轉換為React Native

I have been working on a lot of mobile projects lately?—?including Cordova, PhoneGap, React Native, some Ionic and Swift?—?but I have to say, React Native is by far the best experience in mobile development I have had so far. It has great, web-like d…