Bear Bibeault

Marshal
+ Follow
since Jan 10, 2002
Bear likes ...
Mac Mac OS X IntelliJ IDE jQuery Java
Author of:
Secrets of the JavaScript Ninja, 1st and 2nd editions,
jQuery in Action, 1st, 2nd and 3rd editions,
Ajax in Practice, and
Prototype and Scriptaculous in Action
Austin, TX
Cows and Likes
Cows
Total received
173
In last 30 days
0
Total given
186
Likes
Total received
4559
Received in last 30 days
5
Total given
2929
Given in last 30 days
9
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt Green check

Recent posts by Bear Bibeault

Mark Volkmann wrote:Let's do this! Hit me up with your questions about Svelte and/or Sapper! No question is too basic.



OK, basic, what are Svelte and Sapper? I've heard of Svelte (but not much in the way of details), but never even heard of Sapper.
You claimed:
  • node js is the language which comes as best in those parameters
  • it can provide the same features by consuming less memory compare to java
  • node can handle more requests than Java for the same api build

  • What evidence do you have to support these claims?
    Was the article Cay pointed to not clear in that respect?

    SunilK Chauhan wrote:
    So I think node js is the language which comes as best in those parameters and also it can provide the same features by consuming less memory compare to java.

    And also node can handle more requests than Java for the same api build.


    Can you cite your sources for the above claims?
    What are you using as a test runner? Code coverage isn't provided by an IDE, but rather the test runner.
    It's been many a year since I've worked on a project where the attitude towards IE has not been "get over it".

    Cay Horstmann wrote:Now I always use undefined, except of course, when an API gives me null.


    I do the same -- undefined seems to capture the spirit of a, well, undefined value better than null; hair-splitting perhaps, philosophical perhaps, but a real distinction in my mind.

    However, lots of code treats them interchangeably, and I cannot count the number of bugs I've had to deal with when code specifically checks for one or the other, but not both, in situations where a distinction is not made.

    In this topic, I pointed out the fairly new nullish coalescing operator which helps a lot in this regard.

    Cay Horstmann wrote:That test also passes if a is 0 or "", which can really bite you if that's not what you expect.


    I have scars to show for that one...

    To add another twist to the discussion: frequently null (or undefined) is checked for in order to provide a default if a value is null/undefined. A very recent addition (check your environment for compatibility) is called nullish coalescing and goes like so:

    whose value is a if a is not null and not undefined, b otherwise.

    This is nice because it avoids the zero and empty string pitfalls that Cay pointed out.

    Cay Horstmann wrote:
    When someone asks me what the value of [3] * true is in JavaScript, I reply that there is only one correct answer. And that answer is "Who cares".


    I love this! I can't tell you how many excruciating interviews I've sat through where someone carts out some obscure JS question. I've probably dodged a lot of bullets by giving the equivalent of the "who cares" answer.

    Cay Horstmann wrote:But you do want to have a firm grounding in JS and not just treat the framework as magic.


    Again, quoted for emphasis.

    Cay Horstmann wrote:It is not a hard language to learn as long as you skip over the cruft from the past.


    Quoted for emphasis. As someone who has the scars of being part of the JS ecosystem for over two decades, I try hard to forget the pains and aches...
    LOL. I remember well the culture shock in going from VAX/VMS to Windows back in the early 90s. From a system where up-time was measured in months, to one measured in minutes.
    Industry trivia: the Cheshire Cat was an unofficial mascot of VAX/VMS when it was developed in the late 1970s as VMS was one of the first systems that could truly boot itself from nothing without operator intervention.