#learnyounode
Explore tagged Tumblr posts
blog-stack-blog · 6 years ago
Text
Learnyounode: Episodul 1
Astazi am inteles ca ceva nu merge in practica. Am cerut ajutor de la Mentor - ma ajutat. Iar eu am inteles o lectie: ca trebuie sa ma starui sa inteleg conditia. Eu mereu nu inteleg ce se are in vedere in o conditie, iar asta este o “slabiciune“, adica eu nu sunt atent la detalii, la ce se are in vedere conditia. Deci din momentul acesta eu am sa ma starui sa inteleg conditia, voi citi de minim 10-15 ori sarcina, si dupa ma voi apuca de practica.
La moment in care scriu postarea data este ora 18:30, eu trebuie sa ma starui sa fac toate task-urile din acest proiect(”learnyounode”) pana maine dimineata la ora 10:30.
Deci acesta a fost postul cu ce am invatat azi, acum la treaba! Ne vedem maine.
0 notes
tea-takasaki · 8 years ago
Text
今からjavascriptを学ぶ(nodeschool編)
この記事はCCS Adventchalender2017  の19日めの記事です。 前日は@NocreateNolifeさんの
CCSアドカレ2017「小学生向けプログラミングに好き勝手言うのと、いくつか紹介」 
でした。
高崎です。 ここ一年では低レイヤーに興味を持ったので、OS作ってみたり色々やったりしましたが、興味のある人がCCSには少ない(2名ぐらいしかいない)のでそういう話はしません……。 ということで、最近Javascriptについて勉強していたので、それについて書いていきます。
Javascriptの歴史
歴史は長くなるしダラダラとした話になるので、知りたい人は各自ググってください。
誕生から現在までの主要な流れは、
動的なwebページを作る言語として生まれ流行した
ブラウザ作ってるような会社とかが共通の規格を作ったけど、その後分裂
動的ページの作成ではFlashにお株奪われたりもした
Ajaxでなんやかんや合って復権
ライブラリとかたくさんできて強くなった
新しく規格が作られて強くなった
今ではサーバーサイドの環境もある
という感じです。
2015年に策定された規格(ECMAscript 6と言ったりするそうです)は多くの新機能が追加されそれまでのjavascriptと比べてかなり進化しました。
ECMAscript 6でクラスとかモジュールとかが入って面白そうだしそろそろjavascriptをちゃんと勉強したい、あわよくばNode.jsでwebアプリケーションを作ってみたいと思い、なにかいいものはないかなと探してたら、ちょうどいいのを見つけたのでそれを紹介します。
nodeschool
NODESCHOOL
Tumblr media
ソフトウェア技術を教えてくれるオープンソースのワークショップ(講座みたいな感じです)ですが、独学でも勉強できます。 よくあることですが、独学でプログラミングの勉強していてわからない時があると聞ける人がいないのでどうにかこうにかしないといけないことがあると思います。 そんな時、nodeschoolでは各地で開催されるイベントに行くとそういうことを質問できるのです!人に聞けるのはいいことです。
nodeschoolの導入
nodeschoolはNode.jsで動くので、まずはNode.jsをインストールしましょう。
Node.jsの公式に行って、LTS版でも最新版でもどちらでもいいのでダウンロードしてインストールします。
そして、npmを使ってnodeschoolのページの各ワークショッパーをインストールして、実行するだけで準備完了です。
各ワークショップ
基礎編
Tumblr media
選択科目
Tumblr media
ここに出したのはほんの一部で他にもたくさんのワークショッパーがあります。
例えば、learnyounodeをやりたいならば、
npm install -g learnyounode
learnyounode
でワークショッパーが起動します。
表示される言語は各国のものがあります(もちろん日本語もあります)が、ものによっては日本語がなかったり、英語しかなかったりするので、そういうのはがんばってください。
実際にやってみた
基礎の一番上にあるjavascriptingを実際にやってみましょう。
javascriptingのワークショッパーをインストールして、実行したところです。
Tumblr media
Introductionを選んでEnterキーで問題が表示されます。
Tumblr media
英語で書いてありますが、皆さんわかると思います(大学生でしょ)��やることとしてはファイルを作ってconsole.log(’hello’)と書き込んで実行しろと言うことなので、解答は以下のようになりますね。
Tumblr media
実行して確認するとこのように表示されます。
Tumblr media
これで一個完了です。このような調子で残り18個やっていく流れです。
答えがどうしてもわからない……という場合もgithubに答えがありますので大丈夫です。(適切な単語で検索すれば出てきます) nodeschoolには、javascriptで関数型プログラミングをするワークショッパーがあったり、reactを学ぶワークショッパーがあったり、色々あるので、javascriptやnodeは知ってるという方も覗いてみてはどうでしょうか?
明日は @_maerQ さんの  「止まるんじゃねえぞ feat. アイカツ! & アイカツスターズ!」の予定です。
1 note · View note
hennevogel · 8 years ago
Link
0 notes
gbianco · 8 years ago
Text
JavaScript Simplicity
Lately, I keep reading articles about how the JavaScript ecosystem has too many libraries, which creates a steep learning curve. A lot seem to be purely dismissive without offering a real solution. Others are pushing projects to address this issue, but never explain how their solution is actually a *good* one. If anything, isn't it counterintuitive to use a tool to address the problem of too many tools? In fact, that idea is what I want to talk about. It is very easy to get caught up in the never-ending spiral of "this tool doesn't do X, so I will get tool Y to fix that". Having an ecosystem with all sorts of tools for almost any problem is a blessing and a curse. It's great to have access to so many good libraries, but a growing list of dependencies often is more work than necessary. Moderation is key. At the core of this issue is the idea that you have to use the latest, greatest, and "sexiest" frameworks in every single project you do. This is a very naive approach to coding, in general. There are plenty of adages and sayings against dependency creep (e.g. "less is more", "keep it simple, stupid"). Basically, only include dependencies that you know will have positive returns on your development time and effort. Don't just blindly use a library because it's new or popular. However, maybe that means it is worth looking into. Just keep in mind that you'll need some time to learn the tool. You may even need to learn the tool just to determine if it helps you. If that's the case, make sure you aren't treating everything like a nail with your new hammer. If you are completely new to the ecosystem, it can be hard to determine a simple set of dependencies that will have those high returns. Below is a list (in order) of basic tools you should start with. I will try to include the name of appropriate "workshoppers" from [NodeSchool](https://nodeschool.io/). A workshopper is a collection of lessons that require you to do a small lab after each lesson. This practice is crucial for actually learning material. 1. JavaScript - It may seem silly for me to include this here. If you take away nothing else from this post, take this: learn the fundamentals of JavaScript before trying to use it. I see so many people making the poor assumption that JavaScript *works* like other languages just because it *looks* like them. This is simply not true. A lot of people skip getting familiar with JavaScript and jump directly into their framework of choice. This accounts for most of the bad JavaScript code out there. I highly recommend reading `JavaScript: The Good Parts` by Douglas Crockford. You don't have to understand every little function that gets listed, but you should be aware how things like scopes and hoisting work. Applicable workshoppers: `javascripting`, `scope-chains-closures`, `js-best-practices` 2. Node.js - Yes, this is different from learning JavaScript. Node is built on top of JS. That means there are plenty of functions, built in libraries, and techniques that are Node specific for you to learn. Applicable workshoppers: `learnyounode`, `how-to-npm`, `stream-adventure` 3. Express - This is by far the most common Node module for setting up REST services. Express allows you to set up basic routes using a fantastic yet simple API. Applicable workshoppers: `expressworks` 4. Mocha and Chai - Mocha is a test runner (so for actually setting up and running the tests). Chai is an assertion library, which means it is used to do the actual checks (e.g. to make sure a return value is a number greater than 0). Just by using these two, you have a very powerful unit testing framework. If you need code coverage, you can set up Istanbul to run with mocha. You don't really have to learn much for Istanbul. 5. Some sort of front end framework (e.g. Angular, React, etc.) - You should have a basic understanding of JavaScript and simple server side code before you start writing frontend code since most of the new ones will use AJAX to make calls to the backend. Personally, I prefer Angular 1.x, and am now learning Vue.js.
0 notes
freecodecampofdespair-blog · 10 years ago
Text
LearnYouNode Challenge 10: HTTP JSON API SERVER
know I kinda gave up on this, but I’ve not given up on FCC. just finished learnyounode exercise 10 and upon seeing the solution provided, I don’t understand why it’s so complicated. Instead of regexing take a look at this:
var http = require('http'); var url = require('url');
var server = http.createServer(function(req, res){
var reqObj = url.parse(req.url, true); var timeHolder = reqObj.query.iso; var time = new Date(timeHolder); var retObj = {};
res.writeHead(200, { 'Content-Type': 'application/json' });
if (reqObj.pathname === '/api/parsetime'){ retObj.hour = time.getHours(); retObj.minute = time.getMinutes(); retObj.second = time.getSeconds(); res.end(JSON.stringify(retObj)); } else if (reqObj.pathname === '/api/unixtime'){  retObj.unixtime = time.getTime();  res.end(JSON.stringify(retObj)); } else { console.log('woops!');}
}); server.listen(process.argv[2]);
2 notes · View notes
thebox193 · 10 years ago
Link
An interesting way to learn node.js
0 notes
randomscameacross-blog · 11 years ago
Text
My Solutions to Node School Tutorials
Node school tutorial, learnyounode is a good starting point to learn node.js. The tutorials are designed in a manner which helps self-learning and I really enjoyed doing them. I worked around 7 hours working on the solutions, refactoring them and learning the basics of the libraries. I have shared my solutions at GitHub hoping it will help someone who is struggling with the solution.
0 notes