Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #31571 > unrolled thread

What do I do to be able to fully understand and then at some point write code like the following URL?

Started byjustaguy <lichunshen84@gmail.com>
First post2016-10-13 18:49 -0700
Last post2016-10-19 10:11 -0700
Articles 13 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  What do I do to be able to fully understand and then at some point write code like the following URL? justaguy <lichunshen84@gmail.com> - 2016-10-13 18:49 -0700
    Re: What do I do to be able to fully understand and then at some point write code like the following URL? sail0r <sail0r@example.com> - 2016-10-13 22:59 -0400
      Re: What do I do to be able to fully understand and then at some point write code like the following URL? justaguy <lichunshen84@gmail.com> - 2016-10-14 15:27 -0700
        Re: What do I do to be able to fully understand and then at some point write code like the following URL? justaguy <lichunshen84@gmail.com> - 2016-10-14 15:30 -0700
          Re: What do I do to be able to fully understand and then at some point write code like the following URL? Ram Tobolski <ramtob@gmail.com> - 2016-10-15 12:06 -0700
            Re: What do I do to be able to fully understand and then at some point write code like the following URL? justaguy <lichunshen84@gmail.com> - 2016-10-15 15:20 -0700
              Re: What do I do to be able to fully understand and then at some point write code like the following URL? Ram Tobolski <ramtob@gmail.com> - 2016-10-16 02:31 -0700
                Re: What do I do to be able to fully understand and then at some point write code like the following URL? justaguy <lichunshen84@gmail.com> - 2016-10-16 13:36 -0700
                  Re: What do I do to be able to fully understand and then at some point write code like the following URL? Ram Tobolski <ramtob@gmail.com> - 2016-10-17 03:09 -0700
                    Re: What do I do to be able to fully understand and then at some point write code like the following URL? justaguy <lichunshen84@gmail.com> - 2016-10-17 14:33 -0700
                      Re: What do I do to be able to fully understand and then at some point write code like the following URL? Ram Tobolski <ramtob@gmail.com> - 2016-10-18 11:17 -0700
                        Re: What do I do to be able to fully understand and then at some point write code like the following URL? justaguy <lichunshen84@gmail.com> - 2016-10-18 16:55 -0700
                          Re: What do I do to be able to fully understand and then at some point write code like the following URL? Ram Tobolski <ramtob@gmail.com> - 2016-10-19 10:11 -0700

#31571 — What do I do to be able to fully understand and then at some point write code like the following URL?

Fromjustaguy <lichunshen84@gmail.com>
Date2016-10-13 18:49 -0700
SubjectWhat do I do to be able to fully understand and then at some point write code like the following URL?
Message-ID<ebb7f34e-2a0c-4d60-b16c-c637791d1459@googlegroups.com>
Other than advanced JavaScript books, that is, free resources...
https://github.com/k9/globe-viewer/blob/master/app/js/controller.js

Thanks.

[toc] | [next] | [standalone]


#31572

Fromsail0r <sail0r@example.com>
Date2016-10-13 22:59 -0400
Message-ID<201610132259376253-sail0r@examplecom>
In reply to#31571
I wouldn't say that code was necessarily "advanced", however it is 
quite contemporary.
I'd suggest you check out this ES6 tutorial to get your head around 
classes and let variables: http://ccoenraets.github.io/es6-tutorial/

On 2016-10-14 01:49:38 +0000, justaguy said:

> Other than advanced JavaScript books, that is, free resources...
> https://github.com/k9/globe-viewer/blob/master/app/js/controller.js
> 
> Thanks.

[toc] | [prev] | [next] | [standalone]


#31575

Fromjustaguy <lichunshen84@gmail.com>
Date2016-10-14 15:27 -0700
Message-ID<5fa26877-c140-42b5-abf1-389213fa5844@googlegroups.com>
In reply to#31572
On Thursday, October 13, 2016 at 11:05:11 PM UTC-4, sail0r wrote:
> I wouldn't say that code was necessarily "advanced", however it is 
> quite contemporary.
> I'd suggest you check out this ES6 tutorial to get your head around 
> classes and let variables: http://ccoenraets.github.io/es6-tutorial/
> 
> On 2016-10-14 01:49:38 +0000, justaguy said:
> 
> > Other than advanced JavaScript books, that is, free resources...
> > https://github.com/k9/globe-viewer/blob/master/app/js/controller.js
> > 
> > Thanks.

Thanks for the pointer.  "let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct?

Also, with code like 
let myfunc = () => whatever { ... }
is it similar to
 myfunct = function() { ... }
Is so, the second option is clearer, why do we need to use the first one?
 

[toc] | [prev] | [next] | [standalone]


#31576

Fromjustaguy <lichunshen84@gmail.com>
Date2016-10-14 15:30 -0700
Message-ID<6e0e94b5-fd01-4009-8e1f-94a3828cecd3@googlegroups.com>
In reply to#31575
On Friday, October 14, 2016 at 6:28:54 PM UTC-4, justaguy wrote:
> On Thursday, October 13, 2016 at 11:05:11 PM UTC-4, sail0r wrote:
> > I wouldn't say that code was necessarily "advanced", however it is 
> > quite contemporary.
> > I'd suggest you check out this ES6 tutorial to get your head around 
> > classes and let variables: http://ccoenraets.github.io/es6-tutorial/
> > 
> > On 2016-10-14 01:49:38 +0000, justaguy said:
> > 
> > > Other than advanced JavaScript books, that is, free resources...
> > > https://github.com/k9/globe-viewer/blob/master/app/js/controller.js
> > > 
> > > Thanks.
> 
> Thanks for the pointer.  "let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct?
> 
> Also, with code like 
> let myfunc = () => whatever { ... }
> is it similar to
>  myfunct = function() { ... }
> Is so, the second option is clearer, why do we need to use the first one?

Correction:
 myfunct = function() { ... } 
->
var myfunct = function() { ... } 

[toc] | [prev] | [next] | [standalone]


#31577

FromRam Tobolski <ramtob@gmail.com>
Date2016-10-15 12:06 -0700
Message-ID<6c729f49-dae7-4264-8047-42403315f63d@googlegroups.com>
In reply to#31576
>"let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct? 
Yes, it is. If you have es6 support, "let" is the norm, rather than "var". Es6 also provides the "const" keyword for constants:

const SIZE = 165;

const log = x => console.log(x);

>Also, with code like 
let myfunc = () => whatever { ... } 
is it similar to 
var myfunct = function() { ... } 
Is so, the second option is clearer, why do we need to use the first one? 

The "arrow function" syntax is not necessary, but in some cases it is more convenient, less cumbersome, more readable. Compare e.g

let a2 = a.map(function(s){ return s.name })

with

let a2 = a.map( s => s.name )

Which one is clearer?

[toc] | [prev] | [next] | [standalone]


#31578

Fromjustaguy <lichunshen84@gmail.com>
Date2016-10-15 15:20 -0700
Message-ID<dc5027d0-c115-45b6-995b-afc0a298ec73@googlegroups.com>
In reply to#31577
On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wrote:
> >"let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct? 
> Yes, it is. If you have es6 support, "let" is the norm, rather than "var". Es6 also provides the "const" keyword for constants:
> 
> const SIZE = 165;
> 
> const log = x => console.log(x);
> 
> >Also, with code like 
> let myfunc = () => whatever { ... } 
> is it similar to 
> var myfunct = function() { ... } 
> Is so, the second option is clearer, why do we need to use the first one? 
> 
> The "arrow function" syntax is not necessary, but in some cases it is more convenient, less cumbersome, more readable. Compare e.g
> 
> let a2 = a.map(function(s){ return s.name })
> 
> with
> 
> let a2 = a.map( s => s.name )
> 
> Which one is clearer?

I see.  Thanks.

Regarding es6 support, probably the most cutting edge web browser such as Google Chrome supports it?  Is it correct?

[toc] | [prev] | [next] | [standalone]


#31580

FromRam Tobolski <ramtob@gmail.com>
Date2016-10-16 02:31 -0700
Message-ID<25fd72a3-ff7f-4ae5-b7da-d108d591686a@googlegroups.com>
In reply to#31578
On Sunday, October 16, 2016 at 1:20:35 AM UTC+3, justaguy wrote:
> On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wrote:
> > >"let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct? 
> > Yes, it is. If you have es6 support, "let" is the norm, rather than "var". Es6 also provides the "const" keyword for constants:
> > 
> > const SIZE = 165;
> > 
> > const log = x => console.log(x);
> > 
> > >Also, with code like 
> > let myfunc = () => whatever { ... } 
> > is it similar to 
> > var myfunct = function() { ... } 
> > Is so, the second option is clearer, why do we need to use the first one? 
> > 
> > The "arrow function" syntax is not necessary, but in some cases it is more convenient, less cumbersome, more readable. Compare e.g
> > 
> > let a2 = a.map(function(s){ return s.name })
> > 
> > with
> > 
> > let a2 = a.map( s => s.name )
> > 
> > Which one is clearer?
> 
> I see.  Thanks.
> 
> Regarding es6 support, probably the most cutting edge web browser such as Google Chrome supports it?  Is it correct?

Even a browser like Chrome does not completely support es6 yet. So, it depends which es6 features you actually use. 

Es6 "modules" (https://hacks.mozilla.org/2015/08/es6-in-depth-modules/), for example, are not supported by any browser, yet. That's why it is common today for javascript developers to use a "transpiler" tool, such as Babel (http://babeljs.io/) to automatically convert es6 code to es5 code, before going to production.

[toc] | [prev] | [next] | [standalone]


#31581

Fromjustaguy <lichunshen84@gmail.com>
Date2016-10-16 13:36 -0700
Message-ID<dbc979b5-2506-455d-a59b-0f178eb10622@googlegroups.com>
In reply to#31580
On Sunday, October 16, 2016 at 5:31:46 AM UTC-4, Ram Tobolski wrote:
> On Sunday, October 16, 2016 at 1:20:35 AM UTC+3, justaguy wrote:
> > On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wrote:
> > > >"let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct? 
> > > Yes, it is. If you have es6 support, "let" is the norm, rather than "var". Es6 also provides the "const" keyword for constants:
> > > 
> > > const SIZE = 165;
> > > 
> > > const log = x => console.log(x);
> > > 
> > > >Also, with code like 
> > > let myfunc = () => whatever { ... } 
> > > is it similar to 
> > > var myfunct = function() { ... } 
> > > Is so, the second option is clearer, why do we need to use the first one? 
> > > 
> > > The "arrow function" syntax is not necessary, but in some cases it is more convenient, less cumbersome, more readable. Compare e.g
> > > 
> > > let a2 = a.map(function(s){ return s.name })
> > > 
> > > with
> > > 
> > > let a2 = a.map( s => s.name )
> > > 
> > > Which one is clearer?
> > 
> > I see.  Thanks.
> > 
> > Regarding es6 support, probably the most cutting edge web browser such as Google Chrome supports it?  Is it correct?
> 
> Even a browser like Chrome does not completely support es6 yet. So, it depends which es6 features you actually use. 
> 
> Es6 "modules" (https://hacks.mozilla.org/2015/08/es6-in-depth-modules/), for example, are not supported by any browser, yet. That's why it is common today for javascript developers to use a "transpiler" tool, such as Babel (http://babeljs.io/) to automatically convert es6 code to es5 code, before going to production.

Ok, good to know.  So, in this sense, learning es6 is sort of preparing for the future as a developer, and then, it begs for the question, what type of capability/key features in es6 that is/are way superior to es5?

Thanks.

[toc] | [prev] | [next] | [standalone]


#31582

FromRam Tobolski <ramtob@gmail.com>
Date2016-10-17 03:09 -0700
Message-ID<9d17a360-9e9c-441f-a5b7-da1595ca8a78@googlegroups.com>
In reply to#31581
On Sunday, October 16, 2016 at 11:36:18 PM UTC+3, justaguy wrote:
> On Sunday, October 16, 2016 at 5:31:46 AM UTC-4, Ram Tobolski wrote:
> > On Sunday, October 16, 2016 at 1:20:35 AM UTC+3, justaguy wrote:
> > > On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wrote:
> > > > >"let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct? 
> > > > Yes, it is. If you have es6 support, "let" is the norm, rather than "var". Es6 also provides the "const" keyword for constants:
> > > > 
> > > > const SIZE = 165;
> > > > 
> > > > const log = x => console.log(x);
> > > > 
> > > > >Also, with code like 
> > > > let myfunc = () => whatever { ... } 
> > > > is it similar to 
> > > > var myfunct = function() { ... } 
> > > > Is so, the second option is clearer, why do we need to use the first one? 
> > > > 
> > > > The "arrow function" syntax is not necessary, but in some cases it is more convenient, less cumbersome, more readable. Compare e.g
> > > > 
> > > > let a2 = a.map(function(s){ return s.name })
> > > > 
> > > > with
> > > > 
> > > > let a2 = a.map( s => s.name )
> > > > 
> > > > Which one is clearer?
> > > 
> > > I see.  Thanks.
> > > 
> > > Regarding es6 support, probably the most cutting edge web browser such as Google Chrome supports it?  Is it correct?
> > 
> > Even a browser like Chrome does not completely support es6 yet. So, it depends which es6 features you actually use. 
> > 
> > Es6 "modules" (https://hacks.mozilla.org/2015/08/es6-in-depth-modules/), for example, are not supported by any browser, yet. That's why it is common today for javascript developers to use a "transpiler" tool, such as Babel (http://babeljs.io/) to automatically convert es6 code to es5 code, before going to production.
> 
> Ok, good to know.  So, in this sense, learning es6 is sort of preparing for the future as a developer, and then, it begs for the question, what type of capability/key features in es6 that is/are way superior to es5?
> 
> Thanks.

Not exactly, es6 is already the present of javascript. That's why, as I said, js developers today are willing to use "transpilers", to compensate for the lack of complete es6 support in the browsers.

Offhand, in es6 there are:
a. small but important improvements, such as "let", "const", arrow functions, and classes.
b. substantial and useful additions, such as promises and modules.
c. more advanced stuff, that is rarely used in everyday js, such as iterators, generators, proxies.

[toc] | [prev] | [next] | [standalone]


#31583

Fromjustaguy <lichunshen84@gmail.com>
Date2016-10-17 14:33 -0700
Message-ID<c6b6f4e2-64b6-41cb-8072-5426b3162def@googlegroups.com>
In reply to#31582
On Monday, October 17, 2016 at 6:09:35 AM UTC-4, Ram Tobolski wrote:
> On Sunday, October 16, 2016 at 11:36:18 PM UTC+3, justaguy wrote:
> > On Sunday, October 16, 2016 at 5:31:46 AM UTC-4, Ram Tobolski wrote:
> > > On Sunday, October 16, 2016 at 1:20:35 AM UTC+3, justaguy wrote:
> > > > On Saturday, October 15, 2016 at 3:06:10 PM UTC-4, Ram Tobolski wrote:
> > > > > >"let" seems to be a better choice for a variable for a block of code without concern of unintended affect vs. "var" seems to have global and local scope.  It seems safer to use "let".  Is such understanding correct? 
> > > > > Yes, it is. If you have es6 support, "let" is the norm, rather than "var". Es6 also provides the "const" keyword for constants:
> > > > > 
> > > > > const SIZE = 165;
> > > > > 
> > > > > const log = x => console.log(x);
> > > > > 
> > > > > >Also, with code like 
> > > > > let myfunc = () => whatever { ... } 
> > > > > is it similar to 
> > > > > var myfunct = function() { ... } 
> > > > > Is so, the second option is clearer, why do we need to use the first one? 
> > > > > 
> > > > > The "arrow function" syntax is not necessary, but in some cases it is more convenient, less cumbersome, more readable. Compare e.g
> > > > > 
> > > > > let a2 = a.map(function(s){ return s.name })
> > > > > 
> > > > > with
> > > > > 
> > > > > let a2 = a.map( s => s.name )
> > > > > 
> > > > > Which one is clearer?
> > > > 
> > > > I see.  Thanks.
> > > > 
> > > > Regarding es6 support, probably the most cutting edge web browser such as Google Chrome supports it?  Is it correct?
> > > 
> > > Even a browser like Chrome does not completely support es6 yet. So, it depends which es6 features you actually use. 
> > > 
> > > Es6 "modules" (https://hacks.mozilla.org/2015/08/es6-in-depth-modules/), for example, are not supported by any browser, yet. That's why it is common today for javascript developers to use a "transpiler" tool, such as Babel (http://babeljs.io/) to automatically convert es6 code to es5 code, before going to production.
> > 
> > Ok, good to know.  So, in this sense, learning es6 is sort of preparing for the future as a developer, and then, it begs for the question, what type of capability/key features in es6 that is/are way superior to es5?
> > 
> > Thanks.
> 
> Not exactly, es6 is already the present of javascript. That's why, as I said, js developers today are willing to use "transpilers", to compensate for the lack of complete es6 support in the browsers.
> 
> Offhand, in es6 there are:
> a. small but important improvements, such as "let", "const", arrow functions, and classes.
> b. substantial and useful additions, such as promises and modules.
> c. more advanced stuff, that is rarely used in everyday js, such as iterators, generators, proxies.

Ok, thank you.

Now, a new related question, in the world of MVC, I heard ReactJS is particularly useful for View, if one intend to further his skills in client side technologies, would time spent to learn ReactJS likely yield better return than time spent to beef up general JavaScript?  One reason, recruiters/companies are asking, do you know ReactJS (no recruiter ever ask are you strong in JavaScript)?

Personally, I like jQuery a lot, and would love to pick up more of it.

[toc] | [prev] | [next] | [standalone]


#31584

FromRam Tobolski <ramtob@gmail.com>
Date2016-10-18 11:17 -0700
Message-ID<94726c2e-d82f-47c9-8803-d78aa9a27068@googlegroups.com>
In reply to#31583
>Now, a new related question, in the world of MVC, I heard ReactJS is particularly useful for View, if one intend to further his skills in client side technologies, would time spent to learn ReactJS likely yield better return than time spent to beef up general JavaScript?  One reason, recruiters/companies are asking, do you know ReactJS (no recruiter ever ask are you strong in JavaScript)?

From my experience, recruiters ask for MVC framework knowledge in the job specifications, but in interviews they test you more often on pure javascript. So, it is best to study some of both.. Also, note that frameworks like ReactJS come and go relatively quickly, but pure javascript is more enduring. Typically, the recruiter is less interested in your amount of knowledge of, say ReactJS, or AngularJS, then to see that you understand the basic ideas and capabilities of a modern js MVC framework. If you begin to master one framework, you will be able to learn other frameworks, which you will probably have to do sooner or later.

>Personally, I like jQuery a lot, and would love to pick up more of it.

If you like it, by all means learn more of it. Still, jQuery is much less central today than it used to be. That is because jQuery's main strength is DOM manipulation, but today the MVC frameworks do most of the DOM manipulation for you automatically.

[toc] | [prev] | [next] | [standalone]


#31585

Fromjustaguy <lichunshen84@gmail.com>
Date2016-10-18 16:55 -0700
Message-ID<2c91fd34-366c-4b6e-8caa-d7911ae96a0b@googlegroups.com>
In reply to#31584
On Tuesday, October 18, 2016 at 2:17:48 PM UTC-4, Ram Tobolski wrote:
> >Now, a new related question, in the world of MVC, I heard ReactJS is particularly useful for View, if one intend to further his skills in client side technologies, would time spent to learn ReactJS likely yield better return than time spent to beef up general JavaScript?  One reason, recruiters/companies are asking, do you know ReactJS (no recruiter ever ask are you strong in JavaScript)?
> 

> From my experience, recruiters ask for MVC framework knowledge in the job specifications, but in interviews they test you more often on pure javascript. So, it is best to study some of both.. Also, note that frameworks like ReactJS come and go relatively quickly, but pure javascript is more enduring. Typically, the recruiter is less interested in your amount of knowledge of, say ReactJS, or AngularJS, then to see that you understand the basic ideas and capabilities of a modern js MVC framework. If you begin to master one framework, you will be able to learn other frameworks, which you will probably have to do sooner or later.
> 

Good points.  Particularly, "pure javascript is more enduring", exactly my sense as well.  It's more fundamental for web client side technology.

> >Personally, I like jQuery a lot, and would love to pick up more of it.
> 
> If you like it, by all means learn more of it. Still, jQuery is much less central today than it used to be. That is because jQuery's main strength is DOM manipulation, but today the MVC frameworks do most of the DOM manipulation for you automatically.

I mostly like jQuery UI for instance, dialogue, datepicker, accordion.

Btw, I took a look at AngularJS about two months ago, its two way data binding seems powerful, however, it's extremely restrictive, every iota of code must follow its syntax.  If we say, pure JavaScript is standard English, English spoken by Virginians are jQuery, then, AnguarJS is like Spanish, totally another language.  Such restriction makes uncomfortable.

Yesterday I started to look at reactJS, some argues that it's View only for the MVC framework and its syntax seems convoluted, maybe because I'm new to it.  

On the contrary, I read a piece about nodeJS, super fast web server because of its way of handing UA requests... sounds like promising, but too bad, I can't play with it because my own computer (laptop) is not accessible at this point.

Thanks.





[toc] | [prev] | [next] | [standalone]


#31588

FromRam Tobolski <ramtob@gmail.com>
Date2016-10-19 10:11 -0700
Message-ID<4a45e7eb-1f1b-44a2-a7ad-bd49c86aa2df@googlegroups.com>
In reply to#31585
You're welcome

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web