Slashdot Mirror


Ask Slashdot: Have You Migrated To Node.js?

A developer maintaining his company's "half-assed LAMP / WordPress stack pipeline for web and web application development" is considering something more scalable that could eventually be migrated into the cloud. Qbertino asks Slashdot: Have you moved from LAMP (PHP) to Node.js for custom product development and if so, what's your advice? What downsides of JS on the server and in Node.js have a real-world effect? Is callback hell really a thing? And what is the state of free and open-source Node products...? Is there any trend inside the Node.js camp on building a platform and CMS product that competes with the PHP camp whilst maintaining a sane architecture, or is it all just a ball of hype with a huge mess of its own growing in the background, Rails-style?
Condensing Qbertino's original submission: he wants to be able to quickly deliver "pretty, working, and half-way reliable products that make us money" -- and to build a durable pipeline. So leave your educated opinions in the comments. What did you experience moving to Node.js?

210 of 341 comments (clear)

  1. Yes callback hell is a thing by Anonymous Coward · · Score: 1, Insightful

    It keeps me up at night with stress. I hate node.js and everything it stands for. It wasn't always like this though.

    1. Re:Yes callback hell is a thing by Anonymous Coward · · Score: 2, Insightful

      I looked at node.js because we needed something for an embedded linux project. reading up on it I saw the callback idiom and thought why would anyone want to do that to themselves?

    2. Re: Yes callback hell is a thing by Anonymous Coward · · Score: 1

      Why are you still stuck in callback hell in the era of promises? We do some pretty fancy stuff, and don't get caught in callback hell because we use promises. Callback hell was more a pre-promise situation.

    3. Re: Yes callback hell is a thing by Junta · · Score: 1

      The call to have horribly nested callbacks is mitigated to some degree, but it's still ugly compared to approaches in other languages. It's still a callback driven paradigm, just allowing a somewhat less painful way to manage complex scenarios.

      It's a lot like the other improvements in Javascript, significantly crippled by being worked to fit into the existing language.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    4. Re: Yes callback hell is a thing by Junta · · Score: 2

      I don't know if aspiring to PHP levels of maintainability/readability is a high ambition. Also, when the question is 'should I migrate from php', a sentiment that suggests 'about as good as php' doesn't seem to be a ringing endorsement.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    5. Re:Yes callback hell is a thing by Carcass666 · · Score: 1

      Promises (esp with Bluebird library) pretty much eliminate callback hell. If you have to do something sequentially, it's trivial to chain. Better yet, if you have multiple things you can concurrently, promises make it easy.

    6. Re:Yes callback hell is a thing by Jeremy+Lee · · Score: 5, Interesting

      As pointed out, Promises are the primary solution to Node's "callback hell". People like to hate on the explicit value/error return separation, but that's merely a convention used by the top-level HTTP components, not actually baked into the language. It makes something explicit that is usually implicit.

      The thing is, if you language has Exceptions and try/catch then you already have an implicit equivalent of the success/fail control split, and anyone trying to properly handle exceptions caused by their exceptions finds themselves merely in the circle of hell next door.

      I've coded in node.js for a couple of years now, written some semi-big pieces of software to do real-time message passing/transaction processing stuff. It was fine. It's better than PHP, which I moved from. It's better than writing cgi-bin programs in C++, which is how I started. On of the big reasons to use node.js is it nicely integrates alternative protocols like WebSockets, RTC, AMPQ, so you can roll up a "web server plus other protocol" system that gets a lot of jobs done you just can't accomplish with PHP/Apache.

      People love to hate on Javascript because they don't like admitting the language wars are over, and Javascript won. When you can walk into a room and ask "How many people have a compiler on them _right now_." and people answer "I've got at least two!" Try that with any other language. Compilers shipped, lines written, active users... JS wins on all metrics. It's not the "best" language, but then, what is?

      A last note... node.js works especially well in 'cluster' situations, because to be honest, your average node.js process isn't terribly reliable. Individual node.js programs will crash on a weekly basis, thanks to funny net errors. In a cluster that doesn't matter, and in fact you WANT your 'nodes' to fail-fast rather than hang waiting for a deadlock. 'forever' restarts the errant script in seconds, but in those seconds your load-balancer should be handing the task off to another node. It's a paradox that to get a reliable cluster, you want your individual parts to be quite twitchy and explody., which node.js is.

      --
      Jeremy Lee | Orinoco
    7. Re:Yes callback hell is a thing by Jeremy+Lee · · Score: 3, Interesting

      Because when you need to get the page built and back to the user in 10ms, you control path through the program must be explicit and direct, both for the normal control flow, and the error path

      And because the alternative to single-threading is multi-threading, and that sounds like a great abstraction until you realize how much time is lost acquiring and releasing locks, and performing context switches. And you see your code complexity balloon because you have to deal with all the cross-thread synchronization. And it's hard to test.

      The alternative to single-threading is a system which can interrupt the current page build with the _next_ page build (multithreading!) and that almost always makes things worse.

      Node.js responds to server overload by rejecting page requests because it's busy - something the outer load balancer can deal with in milliseconds. (You have a load balancer, right?) Multithreaded programs respond to overloads by slowing down, running out of stack space and crashing. If you're running a real-world web app with thousands of users, one of those is worse.

      --
      Jeremy Lee | Orinoco
    8. Re: Yes callback hell is a thing by ZeroWaiteState · · Score: 1

      The fact that lazy evaluation and monads are an add-on library and not a core part of the language syntax means we are in promise hell.

    9. Re:Yes callback hell is a thing by Anonymous Coward · · Score: 1

      Thread pools instead of a thread to serve each customer. Reject if too many customers -- this can also be easily done with threads. It can be even set up to be changabe or dynamic throughout the system execution.
      Multiversion Concurrency Model instead of explicit locks.
      No need for the fucking total assinine garbage that is node.js. The "js" in that name stands for "just shit".

    10. Re: Yes callback hell is a thing by dave420 · · Score: 1

      He didn't say "about as good as php" though.

    11. Re:Yes callback hell is a thing by erikkemperman · · Score: 4, Interesting

      It's a paradox that to get a reliable cluster, you want your individual parts to be quite twitchy and explody., which node.js is.

      I think I get what you're saying, but somehow I don't expect this argument to convert any nonbelievers :-)

      My personal favourite JS verdict is from Verity Stob, over at The Register,

      CON: The most dysfunctional functional language. On top of all its well-known flaws that disrupt ordinary primitive programming, it lacks many allegedly must-have functional gewgaws. Its variables are mutable, its type holes are indubitable, its 'eagerness' unsuitable, its modules are inscrutable, tail recursion disputable, scoping inexcusable, and I'll stop there, with 'refutable' (to name but one) still in the bank, just because you were kind enough to beg me.

      PRO: It's what you'll end up using.

      Source: Learn you Func Prog on five minute quick!

      --
      Gosh, thanks. That must be why the other ships call me Meatfucker -- GCU Grey Area (Eccentric)
    12. Re:Yes callback hell is a thing by leptons · · Score: 1

      "Callback hell" is a problem with the developer, not the language. If you've created a mess, then you should probably find a way to fix it that doesn't keep you up at night.

    13. Re:Yes callback hell is a thing by Jahta · · Score: 2

      I've coded in node.js for a couple of years now, written some semi-big pieces of software to do real-time message passing/transaction processing stuff. It was fine. It's better than PHP, which I moved from. It's better than writing cgi-bin programs in C++, which is how I started. On of the big reasons to use node.js is it nicely integrates alternative protocols like WebSockets, RTC, AMPQ, so you can roll up a "web server plus other protocol" system that gets a lot of jobs done you just can't accomplish with PHP/Apache.

      Well that's not really a big selling point. In the last couple of years I've worked on Java and Python projects that used WebSockets, RTC, AMQP, NoSQL databases, etc. Not only are these protocols well supported but in both cases you get a much richer and more robust platform to work on.

      People love to hate on Javascript because they don't like admitting the language wars are over, and Javascript won. When you can walk into a room and ask "How many people have a compiler on them _right now_." and people answer "I've got at least two!" Try that with any other language. Compilers shipped, lines written, active users... JS wins on all metrics. It's not the "best" language, but then, what is?

      And this is frankly misleading. Yes there's lots of Javascript code around, bit it's primarily on the client side. One of the biggest issues I've seen with node.js is the number of people who have only ever coded Javascript UIs, but who think that with node.js they can put "Server-side developer" on their CVs. It doesn't work that way. Backend development is an entirely different proposition.

    14. Re:Yes callback hell is a thing by joboss · · Score: 1

      That's just functional language snobbery.

    15. Re:Yes callback hell is a thing by erikkemperman · · Score: 1

      Actually I think she's mocking just that. Perhaps my quote here loses context in that sense, I recommend reading the whole thing. It's kind of funny.

      --
      Gosh, thanks. That must be why the other ships call me Meatfucker -- GCU Grey Area (Eccentric)
    16. Re:Yes callback hell is a thing by Anonymous Coward · · Score: 1

      "Node.js responds to server overload by rejecting page requests because it's busy - something the outer load balancer can deal with in milliseconds. (You have a load balancer, right?) Multithreaded programs respond to overloads by slowing down, running out of stack space and crashing. If you're running a real-world web app with thousands of users, one of those is worse."

      If you have a load balanced environment and your multi-threaded programs are slowing down and crashing, but your node server rejecting requests adding time to the response time whilst the load balancer tries to find a server willing to respond is somehow better then you're doing it very, very, wrong.

      Your load balancer shouldn't have to wait until requests are being rejected before it starts distributing load, and your multi-threaded servers should equally see the load distributed before they start slowing down.

      Beyond that I'm not sure what you mean when you say multi-threaded programs respond to overloads by slowing down and crashing, that's such a broad sweeping statement to make that it doesn't really make any kind of sense. Which programs exactly, on what hardware, on what OS, and what technology? The reason node programs don't do that is because it's interpreted (well, JIT compiled now really) and so can protect itself from you, but what you're really talking about here is managed vs. unmanaged code - yes, badly written unmanaged code can do all the things you state (but well written unmanaged code wont). Managed code typically wont do those things anymore than they would in node. For what it's worth though It's perfectly possible to make a node application crash with a stack overflow too, but it's got fuck all to do with threading - set up some kind of deep or infinite recursion and I'm sure you'll see what I mean.

      I'm not sure why you were modded to +5 because to make such sweeping statements about multi-threading shows a profound lack of knowledge on the topic. If anything your up-modding is frankly a sad reflection to the level of technical illiteracy that's not widespread on Slashdot. Other languages can do all the things node.js can do for what it's worth, there's nothing magical or unique about node.js and what it does - node is really just a convenient wrapper around the hard stuff.

    17. Re:Yes callback hell is a thing by HalWasRight · · Score: 1

      MOD UP PLEASE!

      --
      "This mission is too important to allow you to jeopardize it." -- HAL
    18. Re:Yes callback hell is a thing by GodelEscherBlecch · · Score: 1

      Poorly designed programs respond to overloads by slowing down, running out of stack space and crashing.

      FTFY

  2. Have you migrated to qbasic? by Anonymous Coward · · Score: 4, Insightful

    Fuck no, it's a toy language that's being stretched way beyond its intent. JS has become the absolute bane of the internet, which now requires 2ghz machines to render ~~responsive~~ web pages, and the language has no place whatsoever on servers.

    1. Re:Have you migrated to qbasic? by ShanghaiBill · · Score: 4, Funny

      JS has become the absolute bane of the internet

      JavaScript is a horrible language, as you can see. But PHP is also a horrible language. If you are writing a lot of JS for the client side, then node.js has the advantage that you only need to learn one horrible language.

    2. Re:Have you migrated to qbasic? by WarJolt · · Score: 1

      My experience with Node.js is that database migrations are a pain compared to Rails. Use the best language for the domain you're working in. Server side and client side design patterns are different.

    3. Re:Have you migrated to qbasic? by MightyMartian · · Score: 1

      The difference is that I can use many languages on the back end to develop web apps. I'm stuck with Javascript, a really really shitty shitty language, for anything that runs on the browser. But like many shitty pieces of technology, it gained adoption and thus continues, each iteration just as fucking terrible as the last.

      Yes, I know there are alternatives, but at the end of the day they still compile down to javascript.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    4. Re:Have you migrated to qbasic? by dgatwood · · Score: 5, Informative

      See, I don't get all the hate towards JavaScript. From what I've seen, it's a perfectly usable language except for the lack of true classes, and even that flaw can be fairly easily worked around if you're a C programmer who did OO back before it was cool (function pointers).

      What makes client-side JavaScript a nightmare is not the language, but rather the DOM, which is kind of a pain in any language. The biggest difference is that in other languages, most developers never have to deal with the DOM....

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    5. Re: Have you migrated to qbasic? by ZeroWaiteState · · Score: 3, Insightful

      They don't like Node because it runs in a single thread and basically forces you to use async IO or risk blocking the thread which is serving incoming requests. On most frameworks you can just to kick the user request to a background thread and do your IO synchronously there. Problem is, thread per user doesn't scale for fairly high connection counts when you are IO bound (which most web apps are). However, doing async programming is hard, because the flow of control is inverted and doesn't really follow the flow of code on the page and because callbacks become hairy when you have to chain several async operations together (what happens if a call never returns, returns with exception, etc). How do you compose the results of several async operations when the results may come in our of order? JS, as a language, doesn't provide you the tools to compose those things easily. There are third party libraries which try to fix that, such as async.js, bluebird and promises API, or Rx. You have to use futures/observables/promises to compose async tasks or things get out of hand in a hurry.

    6. Re: Have you migrated to qbasic? by Billly+Gates · · Score: 1
    7. Re:Have you migrated to qbasic? by Anonymous Coward · · Score: 1

      Yeah - this is why TypeScript etc. came into existence. You write in TypeScript that has minor little things like TYPE CHECKING and other stuff real languages have, and compiles to vanilla JavaScript.

    8. Re:Have you migrated to qbasic? by DuckDodgers · · Score: 1

      They compile down to Javascript, but ideally that shouldn't matter any more than the fact that C++ compiles down to intermediate language in most compilers. As long as the top level language does what you want, the intermediate steps between it and CPU microcode should be irrelevant.

      I think the killer feature of Node.js is that you have the same code on client and server, which makes the mental overhead for a 'full stack developer' smaller. But now Dart, Typescript, Clojure/script, Scala, and many other languages can offer the same reduced mental overhead but with a more consistent language.

    9. Re:Have you migrated to qbasic? by Anonymous Coward · · Score: 1

      No you could not do the same stuff we do today back in the 90s. There was no AJAX, it was basically all just POST/GET requests that caused the whole page to reload. Video wasn't much of a thing since everyone was on dial-up internet. Video streaming wasn't even introduced into flash until 2002. The beginning of chat on websites was done in constantly refreshing frames, applets or in flash. Applets were introduced with HTML 3.2 in 1997 and frames and stylesheets weren't ever official until HTML 4.0 in 1998. CSS was barely even adopted in the 90s, it had minimal support so web developers couldn't rely on using it. It wasn't until 2000 where browser support picked up so developers could start to use it.

      Maybe you played with HTML a little bit, but from your statements it is 100% clear you're not a web developer and have zero experience web developing in the 90s. Don't make BS statements that you just pull out of your arse, only makes you look look a fool.

    10. Re:Have you migrated to qbasic? by KingMotley · · Score: 1

      Yes, we've migrated, but it doesn't run on the server. It's used to run gulp which precompiles our LESS files to CSS, minifies the CSS and JS, makes bundles out of them, and optimizes our images. I wouldn't actually run the thing on a server, but it's great as a development build chain.

    11. Re:Have you migrated to qbasic? by Lumpy · · Score: 2

      It would need to if web designers would stop making webpages into flashy bling bling crap. Honestly the moment a webpage uses node,js someone should hit the webmaster with a sack of doorknobs.

      If your website takes more than 4 seconds to load on a 5mbps internet connection, then it's designed by a freaking noob that should not be allowed near a webserver.

      --
      Do not look at laser with remaining good eye.
    12. Re: Have you migrated to qbasic? by Dracos · · Score: 4, Informative

      No.

      We don't like Node because Javascript is eccentric (read: benignly insane) in too many ways. If there was an alternative, that would be adopted in a heartbeat. Something with sensible types and type casting at least, preferably with a better, non-prototype object model.

    13. Re:Have you migrated to qbasic? by tomhath · · Score: 2, Insightful

      People who only know one language (usually Java, or sometimes Ruby) see every other language as a threat to their livelihood. They hate Javascript, SQL, Python, PHP - everything except the only one they know. The fact is, software development languages and techniques are constantly changing; even if you don't have a need for a new language you should learn it, if for no other reason than to expand how you think.

    14. Re:Have you migrated to qbasic? by jon3k · · Score: 1

      Or, alternatively, maybe javascript really isn't a great language for a number of reasons? Like, the insane equality tables. NaN literally doesn't equal NaN. Just google the truth table and behold the wonder.

      What else? Two words: global variables. If you've done any javascript, you know what I mean. Or have you ever tried to do any arithmetic in javascript?

    15. Re:Have you migrated to qbasic? by mattventura · · Score: 1

      It just has the bad parts of various paradigms, yet none of the good parts. For example, some "bad" things throw an exception, whereas others just cough up an "undefined".

    16. Re: Have you migrated to qbasic? by Pseudonym · · Score: 2

      You jest, but Erlang actually delivers what node.js promises (pun intended).

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    17. Re: Have you migrated to qbasic? by TimMD909 · · Score: 1

      I use Grunt constantly with is basically the same deal. We use it to kick off LESS compilation and JavaScript uglfication. It also handles our QUnit and visual regression tests. Lastly, it does the automated releases.

    18. Re:Have you migrated to qbasic? by TheRaven64 · · Score: 5, Informative
      JavaScript has some nice features. It's a pure OO language, it has a simple prototype-based model with differential inheritance, but it also has a lot of ugly corner cases:
      • 'Semicolon insertion' - the semicolon is optional anywhere that the parser can determine that one should be needed. This means that some things are either code blocks or object literals depending on how you line wrap your code.
      • The only integer type is an IEEE double-precision floating point number. You can't represent a 64-bit integer without using a bignum library. Compare this with something like Smalltalk (an ancestor of JavaScript, with Self as the direct parent), where integers are either SmallInt or BigInt objects and are transparently promoted when they are no longer small enough to be hidden inside a pointer.
      • Javascript has operators that work on objects, but no operator overloading. object + string, string + number, number + array are all well-defined in JavaScript. They won't throw type exceptions, but they will produce really unexpected results.
      • The semantics of 'new' and 'this' binding are really weird. Any JavaScript function (which is actually a closure) can be either called directly or as an argument to the new operator. In the first case, the hidden 'this' parameter is the closure object. In the latter case, the 'this' argument is a new object whose prototype is set to a field in the function object. There are a few other subtleties.
      • JavaScript is a pure imperative language. The execution model is that code is run as soon as it is read, which makes quick startup difficult. V8 cheats and just does brace matching when it encounters a function and lazily parses the function when it's first called, but other languages that have a more explicit declarative structure get this for free and have cleaner entry points (there's no equivalent of 'main()' in JavaScript).

      That said, it's not significantly worse or better than most other mainstream programming languages.

      --
      I am TheRaven on Soylent News
    19. Re:Have you migrated to qbasic? by joboss · · Score: 2

      node.js is great for integration of multiple realtime sources of data and for some solid net linked applications. However to replace the LAMP stack for something as simple as blogs, standard webpages, etc is a bad use of node. Node is not a toy language but people do use it for things that it is not really suited to or inappropriately. It can be a lot faster than LAMP but takes much more effort for it to scale. Generally speaking, if your webpage is an application and has realtime connectivity, heavy datasync, etc, you might want node.js. If your webpage is part of a traditional website you probably want to stick with LAMP.

    20. Re: Have you migrated to qbasic? by K.+S.+Kyosuke · · Score: 1

      Does Common Lisp really have what could be labeled as sensible types? Recently I've been been leaning towards deductive systems, and novel models of computation, but even though I'm quite certain that CLOS+MOP are light-years ahead of anything else that can be currently used to structure hand-written code, making smart automated or semi-automated code processing systems to push us even further (algebraic simplifiers/optimizers, deductive/exploratory compilers and optimizers etc.) appears to be difficult in Common Lisp. (Even straight Scheme might need modifications for that, but there could be some tremendous benefits coming out of it.)

      --
      Ezekiel 23:20
    21. Re:Have you migrated to qbasic? by K.+S.+Kyosuke · · Score: 1

      Like, the insane equality tables. NaN literally doesn't equal NaN.

      Are you sure you grasped the concepts of floating point correctly? If all you know about two values is that neither of them is a number, you have no way of deciding whether they're equal/identical values or not.

      --
      Ezekiel 23:20
    22. Re:Have you migrated to qbasic? by dave420 · · Score: 2

      How can NaN === NaN? Their only commonality is that they are both not a number. Zebras and Oranges are also not numbers - should they be equal to each other?

    23. Re:Have you migrated to qbasic? by K.+S.+Kyosuke · · Score: 1

      What Javascript really needs is Scheme-like generic arithmetics. Hell, originally, "Mocha"/"LiveScript" was supposed to be Scheme in the first place. Look where marketing people got us.

      --
      Ezekiel 23:20
    24. Re: Have you migrated to qbasic? by terjeber · · Score: 1

      So, develop in Typescrip, pure ES6 or something similar. Works fine with Node.

    25. Re:Have you migrated to qbasic? by Anonymous Coward · · Score: 1

      Or have you ever tried to do any arithmetic in javascript?

      Concerning the arithmetic, it's because FP arithmetic is done in base 2, which makes numbers such as 0.2 not-dyadic (the equivalent of decimal in base 2); therefore there are rounding errors. In Python 3:

      Python 3.5.1 (default, Mar 3 2016, 09:29:07)
      [GCC 5.3.0] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> 0.2+0.4
      0.6000000000000001

    26. Re:Have you migrated to qbasic? by leptons · · Score: 1

      You aren't familiar enough with JS to make this statement. JS is fast enough to do audio and video processing in real time. The fact that your web experience is slow is not the fault of Javascript the language, but likely the implementation of it by someone not experienced or not interested in their job, perhaps someone like you.

    27. Re:Have you migrated to qbasic? by SQLGuru · · Score: 1

      If you're writing a lot of JavaScript to make your page responsive, you're doing it wrong. Your responsiveness should be handled by CSS and Media Queries. You might have a little bit of JavaScript to manage a few things, but the bulk of it should be done with styles.

    28. Re: Have you migrated to qbasic? by SQLGuru · · Score: 1

      TypeScript adds a little of the rigor of a "real" language on top of JavaScript.......still not perfect, but at least better. And since it transpiles into JavaScript, you don't lose any browser compatibility. It's also easy to "convert" your code since you can mix old and new as you work through the migration.

    29. Re:Have you migrated to qbasic? by omnichad · · Score: 1

      And nobody even tried using XMLHttpRequest for anything non-XML until a while later (because who wants to parse XML client-side?). It never made sense that it was a generic caller, but had XML in the name, which is one thing that scared off a lot of would-be early adopters. It still didn't matter too much until it was supported outside of IE.

    30. Re:Have you migrated to qbasic? by aix+tom · · Score: 1

      Thank god I use a sane language then. Even when it's "not cool" anymore. ;-P

      $ perl
      print 0.2 + 0.4
      ^D
      0.6

    31. Re:Have you migrated to qbasic? by joboss · · Score: 1

      Strings are also unicode by default which sucks on backend. There's a few gotches like that going from a client to backend language.

    32. Re:Have you migrated to qbasic? by Wraithlyn · · Score: 1

      Design isn't created in a vacuum.

      Most of the "crap" you see on webpages is stuff demanded by idiot project stakeholders (ie, the people paying for the work).

      "But it's the designer's job to educate the client blah blah..." I hear you saying. Sure it is. Let me join you in fantasy land where the client always heeds that education and advice. :P

      You can lead a client to water but you can't make them drink.

      TL;DR it's more complicated than "web designers suck".

      --
      "Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
    33. Re:Have you migrated to qbasic? by K.+S.+Kyosuke · · Score: 1

      "Sane?" Who are you kidding?

      $ perl
      print ((0.2 + 0.4)-0.6)
      ^D
      1.11022302462516e-16

      --
      Ezekiel 23:20
    34. Re: Have you migrated to qbasic? by buchanmilne · · Score: 1

      Tell me how you magically streamed these videos in 1998 when browsers didn't have codecs for videos and flash didn't support video streaming until 2002.

      RealPlayer

  3. It's not that bad, just don't write PHP with JS. by Anonymous Coward · · Score: 5, Informative

    I come from a strong C++/Java background and was drug into the Node/JS world kicking and screaming. It's still not my platform of choice but at least I don't despise it anymore. A few things:

    1. Don't try to write PHP (or C++/Java/etc) with Javascript. You see a lot of people try to force Javascript into their way of programming and that's where a lot of the callback hell comes from. It's an event driven environment, just repeat that over and over.

    2. Take the time to familiarize yourself with ES6/Promises/Rx before you start. Promises vs. Rx is almost a religious discussion but when you get down to it, both do the job. This helps a lot with callback hell.

    3. After you've chanted it's an event driven environment often enough, start chanting everything is a stream.

    3. Use eslint religiously. This will find a lot of the mistakes new programmers make, especially ones coming from other languages.

  4. Absolutely not, and never will by sciengin · · Score: 2

    The only upside of Javascript is that it is available everywhere. (and kinda functionaly-sh)
    Everything else about that language is horrible.
    I barely tolerate it inside the browser, most of the time thanks to NoScript, not even that.
    So why the hell should I start putting this nonsense on servers?
    On servers I typically use C++ if I can, Java is the clients demands it, Haskell if I feel playful (Yesod is really great), Common Lisp if I feel like experimenting (Hunchentoot is interesting), Python if I feel lazy and just want to get the job done fast.

    I was aware that the state of Javascript development is pitiful, but the recent incident where the pulling of a simple String-padding library crashed hundreds of other projects outdid even my worst fears.

    1. Re:Absolutely not, and never will by AchilleTalon · · Score: 1

      In the browser, you will have to get used to it, because it is part of the HTML5 standard.

      --
      Achille Talon
      Hop!
    2. Re:Absolutely not, and never will by Anonymous Coward · · Score: 2, Informative

      Use a transpiler then.

      Write in a better language then compile to JavaScript / ECMAScript.

      ECMAScript is probably one of the worlds WORST languages out there.

      How about Coffee Script or TypeScript then transpile to JavaScript for deploying?

    3. Re: Absolutely not, and never will by chispito · · Score: 1

      I was aware that the state of Javascript development is pitiful, but the recent incident where the pulling of a simple String-padding library crashed hundreds of other projects outdid even my worst fears.

      That really had little to do with JavaScript as a language and more to do with NPM, the package manager for NodeJS. I get that you'd love to hold that against JavaScript. I just think you'll have to find another reason.

      --
      The Daddy casts sleep on the Baby. The Baby resists!
    4. Re:Absolutely not, and never will by edxwelch · · Score: 2

      Interesting blog about node.js here:
      http://geekforbrains.com/post/...
      some quotes:
      "All this to say that it feels like the Node ecosystem is constantly moving. Not in a good way. New tools that âoetrumpâ old tools seem to come out daily. Theres always a new shiny thing to replace the other. Youâ(TM)ll be surprised on how easily this happens to you and the community seems to encourage it. You use Grunt!? Everyone uses Gulp!? Wait no, use native NPM scripts!

      Packages that consist of trivial code no more than 10 lines of code are downloaded in the thousands every day from NPM. Seriously!? You need a dependancy for array type checking? "

    5. Re: Absolutely not, and never will by dave420 · · Score: 1

      And one can use JavaScript without using NPM. Your comment reeks of goalpost-shifting.

  5. Uh... by K.+S.+Kyosuke · · Score: 1

    ...no.

    But I never migrated to lhe LAMP disaster either.

    --
    Ezekiel 23:20
    1. Re:Uh... by wbr1 · · Score: 5, Funny

      Yep, still running a Gopher server on AIX. The way god intended. Been looking at PERL 2, but me thinks it is the tower of Babel.

      --
      Silence is a state of mime.
    2. Re:Uh... by FormOfActionBanana · · Score: 1

      I'm think he's using Tomcat...

      --
      Take off every 'sig' !!
    3. Re:Uh... by KiloByte · · Score: 1

      LAMP is not a disaster if you choose a good P. There at least two decent mainstream choices (although users of either will cast aspersions on the other). Although, upgrading the M to P won't hurt, either.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    4. Re:Uh... by K.+S.+Kyosuke · · Score: 1

      If "P" were "PostgreSQL", that would indeed be the case. The "A" part seems largely redundant these days, though. Between reverse caching proxies and modern HTML5 features, I'm not sure why I'd bother with it. It seems that at least Go people ditched it completely already.

      --
      Ezekiel 23:20
    5. Re:Uh... by SeriousTube · · Score: 2

      You really should upgrade to perl 4. Perl 5 has a lot of nice ideas but comes with a lot of nonsense where they tried to make it object oriented and modular which you don't need, so stay away from that.

    6. Re:Uh... by K.+S.+Kyosuke · · Score: 1

      A separate one? Probably yes. There doesn't appear to be a shortage of decent HTTP server libraries that you can embed these days.

      --
      Ezekiel 23:20
    7. Re:Uh... by tigersha · · Score: 1

      I have never used LAMP in my life either, and I am not using Tomat. Switched from Java/EE to Rails and have always used Postgres, not MySQL.

      So I went from LAJP to LNRP. No LAMP.

      Also did some Clojure and now some Elixir. PHP? Programmed one little job in 2 days, and will never do so again, FFS.

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  6. I don't evev know what it is by Hognoxious · · Score: 5, Funny

    Nope. Can't be arsed. Even if I could, by the time I learn it it'll be obsolete & replaced by something with a retarded name like Cunt%% or something.

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    1. Re:I don't evev know what it is by StormReaver · · Score: 1

      ...by the time I learn it it'll be obsolete & replaced by something with a retarded name like Cunt%% or something.

      Jim Jeffries, is that you?

    2. Re:I don't evev know what it is by Hognoxious · · Score: 1

      You mean Jim Jefferies?

      I hadn't heard of him before, but apart from him being Australian and slightly less handsome we're like fucking twins.

      The way he talks and goes off on tangents is very similar. Two beers and we'd be finishing each other's sentences.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  7. Much respect by twistedcubic · · Score: 5, Funny

    "...pretty, working, and half-way reliable products that make us money..."

    Now that's a honest business person!

    1. Re:Much respect by msauve · · Score: 1

      How is that honest?

      "[W]orking, and half-way reliable" are mutually exclusive.

      --
      "National Security is the chief cause of national insecurity." - Celine's First Law
    2. Re:Much respect by Anonymous Coward · · Score: 1

      I think he meant honest in the sense speaking honestly about his intentions, and not having honest intentions.

    3. Re:Much respect by Qbertino · · Score: 1

      "...pretty, working, and half-way reliable products that make us money..."
      Now that's a honest business person!

      LOL!
      Nice one. :-)

      Truth be told, as I wrote in my original long post, I work in an agency of 30 with colleagues who know squat about IT and won't learn the difference between a client and a server.

      But they do like nice and shiny things to click on and as marketing/communication consultants are *very* good at selling them for obscene amounts of money. Also, appart from most agencies I've encountered, the entire company is 100% asshole-free which is a rare thing. 50% women contributes to that. ... Bottom line: I enjoy working here and I doubt I'd be building avantgarde web stacks any sooner and with more professionality in some smelly devshop full of socially inept jerks - which I have worked with in the past too - rather than in our brand new and shiny 90% hippster-compliant agency office with cute and sociable ladies on the crew and all around.

      If the people I do the "dev guy" for rake in bucketloads of cash by selling "change management intranets" to corporations which, on the online end, are basically pimped out stock-themed WP installations accompanied by insane amounts of marketing bullshit-bingo and "involvement workshops" I'll be the last to complain.

      I work part time, call *all* the web-technology and development decisions around here and get to fiddle with all the nice and shiny stuff I'm interested in all day.

      Why do you think I'm asking about the feasibility of a move from LAMP to Node?
      Because it's actually in my power to make such a strategic call, and like most, I've rarely had such an occasion.
      That's why I'm educating myself on this topic. I want to do this responsibly and my experience has me being very meticulous about this pondering and the decision process.

      But nice whitte joke anyhow. :-)

      --
      We suffer more in our imagination than in reality. - Seneca
  8. The real question by JustAnotherOldGuy · · Score: 5, Insightful

    The real question is why, and what would be gained from doing so?

    This would be a major project, is the return really going to be worth the investment of time and energy?

    I think there is often a desire, rational or not, among programmers to want to redo things and make them "clean" (whatever that means) and more efficient. It's a laudable notion, but it's often outweighed by the amount of work required to re-code everything from scratch. I've rarely found it to be worth the time and effort, frankly.

    My guess is that he'd be better off optimizing some of the choke points, or perhaps implementing one of the many existing development platforms. That may require some modification, but it would still probably be a better way to go about it. It's unlikely that his needs are so out-of-band or unusual that a standardized solution wouldn't work (again, even if it required some customization).

    Wanting "Something potentially scalable and perhaps even ready for zero-fuss migration to an entirely cloud-based platform" sounds very buzz-wordy to me, and that's a red flag in my book.

    Finally, the statement that "it's about correctly building a pipeline that won't be completely outdated in 10 years" seems to be pure wishful thinking.

    Good luck with that- I doubt ANY development environment is going to survive for ten years. That's an eternity in the world of coding and development. Tools get outdated as capabilities and needs expand and mature. Hell, I doubt I'll even be using the same text editor in 10 years, let alone an entire development environment.

    --
    Just cruising through this digital world at 33 1/3 rpm...
    1. Re: The real question by chispito · · Score: 1

      Yes but after the project fails, and he is let go, think how marketable he will be as a Full Stack Developer.

      --
      The Daddy casts sleep on the Baby. The Baby resists!
    2. Re:The real question by erktrek · · Score: 1

      Local Governments with no budgets have to make their custom software last for an insane amount of time before they can get a replacement. I know of one still running Dos & a Novell 3.1 server. Web apps seem a good way to keep things standard across a variety of aging and ancient computer systems. I do not necessarily mean that NodeJS is the answer here just that using the web (internally) seems to be a longer lasting solution then a platform dependant one (say windows app). With Node at least the govt IT people who may know javascript have a chance of parsing the backend server stuff to make changes etc long after the developer is gone. Of course the same could be said for PHP etc..

    3. Re:The real question by erktrek · · Score: 1

      arghh sorry "Novell 3.11"

    4. Re:The real question by 93+Escort+Wagon · · Score: 1

      The real question is why, and what would be gained from doing so?

      Given that they're currently on Wordpress, I'd think there's a good possibility they are already on the "reinvent the web wheel every few years" treadmill. So if I were talking to this guy, before I attempted to answer the question he asked I'd first ask another question - why did you move to Wordpress in the first place? Where you trying to address some existing problem(s), or was it just "hey Wordpress is popular right now so I'd like to learn it"? I suspect the latter; but, if the former was actually the case, did it solve the problem he was trying to solve?

      He described his current web stack as "half assed"... who's fault is that? Did he implement it?

      I really think there's a lot of important information that's missing here, not the least of which is - is there actually a significant underlying issue with how the site is being managed?

      --
      #DeleteChrome
    5. Re:The real question by LWATCDR · · Score: 1

      Or look at some other CMSs.
      Node.JS is nto a replacement for Wordpress.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    6. Re: The real question by undefinedreference · · Score: 1

      It's more than an eternity in the NodeJS world. Since the libraries and frameworks are under active development by a bunch of people that are happy to make backward compatibility breaking changes, it's likely that they'd be stuck on an archaic version indefinitely. That isn't making it future-proof, it's making development a constant task (as it is with any software that is in continuous use for a long time), except it will be more extensive than normal maintenance (which is 95+% of the time in the lifecycle of average software).

      The only difference between older platforms that are no longer "cool" and new ones is the age of the developers you hire: NodeJS is almost entirely people at the very beginning of their careers, while older languages are known by older and more established developers (that command higher salaries, although this gulf has been shrinking considerably in the last few years).

      People that want the latest all the time are simply afraid of grey hair and people that refuse to work 16 hour days with zero social life until they're obsolete and discarded. Most of those older developers already lived that and don't want to do it again.

      Good luck to the OP, I suppose, if they push forward with it.

    7. Re:The real question by JustAnotherOldGuy · · Score: 1

      just that using the web (internally) seems to be a longer lasting solution then a platform dependant one (say windows app).

      Agreed...although browsers may come and go and change, the underlying stuff will probably stand the test of time. There's no reason you couldn't build a web app that would (*SHOULD*) still work 5 or 10 years from now. But his idea of keeping everything the same for a decade is probably unrealistic.

      --
      Just cruising through this digital world at 33 1/3 rpm...
    8. Re:The real question by JustAnotherOldGuy · · Score: 1

      Or look at some other CMSs.
      Node.JS is nto a replacement for Wordpress.

      Yep. A modern CMS may last for quite a while, especially if they're committed to managing in house over the long haul. But it also sounds as though they have some custom dev tools that are going to be time-consuming to replace, so it might be better to fix what they can while transitioning to something that's already available rather than coding the whole thing new from the ground up.

      --
      Just cruising through this digital world at 33 1/3 rpm...
    9. Re:The real question by Dracos · · Score: 2

      And WordPress is antiquated, poorly written garbage that survives mostly because designers live for its theming ecosystem. Anyone that has actually read that heaping plate of spaghhetti code (with its big, juicy meatballs of bad practice and thick backwards compatibility sauce) knows not to touch WP.

    10. Re:The real question by Junta · · Score: 1

      I think there is often a desire, rational or not, among programmers to want to redo things and make them "clean" (whatever that means) and more efficient. It's a laudable notion,

      Also, it is all too common the programmer overestimates what the quality of the redo would look like, *especially* if they are looking at redoing someone else's code. They think 'ok, this is way more convoluted than it has to be', and then realize way too late they were wrong.

      Even more so when they think part of making it 'clean' *requires* reimplementation in another language. Now there may be valid reasons to reimplement in another language (better matching your available talent pool, better performance, you would just prefer it), but if it's just to 'make it clean', that can pretty much always be accomplished within the existing language choice.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    11. Re: The real question by Junta · · Score: 1

      It's really interesting because if you look at PyPI, you'll see a lot of this too, but not universally. Some projects exercise some degree of release management discipline and multiple supported branches and such. Others are managed like you describe, just a constant stream of whimsical updates.

      Across the industry there is a very *vocal* sentiment, particularly among newcomers, that stable branches and release management in general is for the birds. We have unit tests and continuous integration now, so why expend energy catering to the the 'old ways'. Veterans tend to be more reserved and careful and reluctant to chime in on a technology change, so the dialog is largely dominated by the enthusiastic 'change everything weekly' crowd.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    12. Re:The real question by Junta · · Score: 1

      Yeah, that stuff is ancient and annoying, lacking severely in useful features. Everyone worth their salt is using vim.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    13. Re:The real question by HornWumpus · · Score: 1

      Let me guess? Drywalled into a space with no doors?

      2 was netmare, but 3 was sweet.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    14. Re:The real question by DraconPern · · Score: 1

      Here's what is interesting... I have seen a lot of things being re-implemented in node.js, that is.. these are complete rewrite of a protocol, api, etc. but using pure js. The speed that things are getting written is really really fast. I have been looking at making the jump from C++ to node because of this. It's the most lightweight dev platform that let's you 'write once' and run anywhere. It's like.. java but better. The only issue is, node.js is really designed to be used on a cluster of machines on the server side.

    15. Re:The real question by tigersha · · Score: 1

      Programmers are like cleaning ladies who think it is easier to demolish the rebuild the building instead of cleaning it up.
      This works, but....

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    16. Re:The real question by goose-incarnated · · Score: 2

      Good luck with that- I doubt ANY development environment is going to survive for ten years.

      I've been using the same dev environment (mostly) for the last twenty years. Sure, I've updated my vimrc/emacsrc, I've copied my Xresources to newer machines and I've backed up my GNUStep directory and restored on newer machines over the years.

      My workflow has remained exactly the same - edit/make/deploy[1]/test/repeat. I don't use an IDE, my 16-virtual-screen WindowMaker desktop *is* the IDE.

      [1] Deploy means anything from "push to test-server" to "program the device's flash with new firmware".

      (Yes, I know - you meant "language-framework environment"; I just thought it might be useful to know that not all frameworks are web-frameworks)

      --
      I'm a minority race. Save your vitriol for white people.
    17. Re:The real question by JustAnotherOldGuy · · Score: 1

      Do you clean your house? Or are you living in a garbage belt?

      I clean my house, but I don't tear out the walls and replace them each time.

      -

      as demonstrated by you needing to add "whatever that means".

      "Clean code" means different things to different people, hence my comment. Now you're just being an ass and a bit of a pedant. If it didn't mean different things to different people we wouldn't be having this conversation, would we?

      -

      Funny that, I maintain a 20 year old system... Is it still running on the same development environment as 20 years ago? Of course not.

      Exactly: your development environment isn't the same as it was 20 years ago. Thank you for making my point for me, I appreciate it.

      --
      Just cruising through this digital world at 33 1/3 rpm...
    18. Re:The real question by JustAnotherOldGuy · · Score: 1

      The only issue is, node.js is really designed to be used on a cluster of machines on the server side.

      I didn't realize that...is it not suitable for use a single server setup, or is it preferred to use a cluster? I'm not familiar with it so that's why I'm asking.

      I don't think Javascript is as dreadful as many people here seem to consider it, but I would be a little leery of writing a huge application in it (although, at the same time I am quite fond of jQuery and what it can do on the client side).

      --
      Just cruising through this digital world at 33 1/3 rpm...
    19. Re:The real question by omnichad · · Score: 1

      I implemented b2 a while before Wordpress was well-known (or maybe even created) and it wasn't too bad. Wordpress bloated so fast that it was almost unrecognizable as based on b2 except for a few database tables with the same name.

    20. Re:The real question by Gondola · · Score: 1

      Raise your hand if you had a CNA before the "C" was cisco...

  9. Works fine by etinin · · Score: 1

    Haters gonna hate, but well-written JS performs better than most php software. You could argue Javascript makes it easier to develop shitty code, but if you look at java, C and any other language for that matter, most software is shit and the one to blame is the programmer, not the language.

    From shit ass slow angular websites to instant loading react ones, there just can't be a generalization. You have awesome software like Atom written in node and I bet many people would never realize it was written with Node.js.

    We also have a lot of proprietary crap (look at IBM/MS stuff) written in C and now Java which are slow as a turtle. Node by itself is a fine tool and it sure does help me build better websites.

    Just don't think a MEAN platform is gonna be the best for everything. I've often used node with PostgreSQL, for example, because it was a better combination for the job. The same applies for LAMP, it's not snake oil. Know your tools and use them wisely and you'll be fine with whatever path you pick.

    --
    "I decided I could write something better than everything out there in two weeks. And I was right." - Linus Torvalds
    1. Re:Works fine by Anonymous Coward · · Score: 5, Interesting

      All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident.
      — Arthur Schopenhauer, German philosopher (1788 – 1860)

      I can second that it works fine. I'll go further to say it doesn't just work well, it works!!! Sadly though, it does take a better programmer to excel in JS/NodeJS.

      1) Yes, it's asynchronous and takes some getting used to. But so are real CPUs, or perhaps you didn't notice because of all the language abstraction.

      2) Yes, it's loosely typed. But try passing an actual function as a parameter in a strongly typed language. Or get a function back as a return value. Better yet, get back a runtime specialized function as a return value.

      3) Yes, it's single threaded. And what a God Send that is. You can have the net effect of threading libraries with thread/variable synchronization without any of the overhead. (If you learn how to program in an async environment. Which seems to be hard for some people.)

      4) Yes, NodeJS uses callbacks. So learn Promises. You avoid callback hell and get extra cool features, like queueing Promises. (Oh, right. Promises are hard.) :-)

      5) Forget about OO polymorphism. JS take polymorphism to a level that Java/PHP can't even dream about. What you need Java Aspects for is natively baked into JS. And it did that on day one, not seven generations later or with an addon. JS is a natural at Aspect Programming (as well as Functional Programming.) Which makes life simple to go from prototype to fully featured. Especially when you find out about "features" the week before deployment. (Hint: it's this feature that make integration testing easy.)

      6) NodeJS along with PM2, gives you the advantages of Docker Containers without the complexity or overheard or wasted disk space (or the need for tooling.) And it doesn't have to run in privledged mode. Which is only important if you think security is important. :-) You can break down your API into single endpoints (or groups of endponts) and run them seperately in their own execution context. Change, replace, update, deploy services without downtime or affecting other services on the same NodeJS instance. THIS IS Micro Services!

      7) NodeJS's module system let's you run several versions of the same package but only in the dependency tree where they're needed. Think of running several Java6 libraries in the same JVM execution context as several Java8 libraries, at the same time, with no possible conflicts. Blow your mind yet?

      I could go on, but that's not the point I'm trying to make.

      First they laughed that JS was a "toy" language. Now they're opposing it as a new platform. So when will it be seen as self-evident?

    2. Re:Works fine by Dracos · · Score: 2

      Look back on the hype cycle of MongoDB and NoSQL: it was all the rage three years ago, now it's a fountain of regret. The same will happen with Node.

    3. Re:Works fine by Pseudonym · · Score: 1

      Haters gonna hate, but well-written JS performs better than most php software.

      I doubt anyone would dispute that, but surely that's an abusrdly low bar.

      I did some node.js for a while. The more I used it, the more I realised that what I really wanted was Erlang. All of the advantages of asynchronous events, plus real concurrency, real thread isolation, real stack backtraces...

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    4. Re:Works fine by rnturn · · Score: 2

      "... now it's a fountain of regret.

      I gotta remember that one. Seems to be a apropos description of several projects at work.

      --
      CUR ALLOC 20195.....5804M
    5. Re:Works fine by brantondaveperson · · Score: 2

      Yes, it's loosely typed. But try passing an actual function as a parameter in a strongly typed language. Or get a function back as a return value. Better yet, get back a runtime specialized function as a return value.

      Yeah. I think most strongly typed languages can do that perfectly fine. C++11, for instance, does it pretty well.

    6. Re:Works fine by coofercat · · Score: 2

      As a sysadmin (devops?), I don't have anything against the language per-se, but so far, I haven't been impressed with the packaging and deployment options. Maybe I'm not doing it right (quite possibly), but so far I'm not especially impressed with npm and pm2. I find they're both a bit opaque and don't feel very natural to me - I don't feel like I have proper control over them - it feels like they're doing 'clever' things on my behalf which I'd rather do myself.

      None of that is a reason to avoid node.js, but it's not a glowing endorsement for it either. Ultimately this shit has to run in production, and that means people like me have to deploy it. That means we want 'clean' and reliable, repeatable (etc) ways to get things onto boxes. It feels like the node.js world is about as ready for production as Ruby, Python etc. All possible, but none very friendly.

      Java, for all its faults is actually pretty easy - you can have multiple versions of the language, libraries and application quite easily. Perl's weirdly pretty easy too (although in truth, multiple language versions would be fairly painful). PHP is really easy, so long as you want it in Apache web server (but again, multiple versions is hard).

    7. Re:Works fine by tigersha · · Score: 1

      Agreed. Working through the Phoenix book right now.

      And add "real composability" to that list.

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    8. Re:Works fine by Perky_Goth · · Score: 1

      Not to mention actual, real functional languages.

    9. Re:Works fine by brantondaveperson · · Score: 1

      Haha. And here's silly old me, writing real, functional code (I assume we're talking about code that functions, not functional languages, but anyhow) in C++. I must just simply be wrong. All that pesky compile-time checking causing me to write fewer bugs and deal with fewer run-time exceptions.

      Although, to be fair, I am comparing it with Java and Python here.

    10. Re:Works fine by Perky_Goth · · Score: 1

      Yeah, not going to agree with your new comment. At all.

      But it wasn't a dig at you, it was at who you were replying to: " try passing an actual function as a parameter in a strongly typed language. Or get a function back as a return value. Better yet, get back a runtime specialized function as a return value." are perfectly normal things to do in haskell or scala, which are definitely strongly typed.

    11. Re:Works fine by brantondaveperson · · Score: 1

      Ha. Fair enough. Agreed.

  10. Node what? by rhysweatherley · · Score: 3, Insightful

    I have yet to come across a problem in my career where googling it reveals Node.js as a recommended solution. Not all of us are building web apps, and frankly the web app people should probably stop and consider whether a proper application is what they really need.

    1. Re: Node what? by cyber-vandal · · Score: 2

      Web applications are popular because you can deploy them instantly to all your users and they work across multiple platforms including mobile with little tweaking. Good luck doing that with a "proper" application.

    2. Re:Node what? by ZeroWaiteState · · Score: 1

      You mean you haven't heard the app-Appy guy? He must be on vacation.

    3. Re: Node what? by cyber-vandal · · Score: 1

      Written many cross platform applications that work on Windows, Mac, Linux, iOS and Android have you? Which middleware did you use? How did you instantaneously, without user intervention, deploy the latest version to every user's machine?

  11. you have to be kidding ? by joss · · Score: 3, Informative

    I used node for a while, I should have known better, but it sure made a change. Not a good change, but definitely a change. I think this explains it pretty well: https://www.youtube.com/watch?...

    --
    http://rareformnewmedia.com/
    1. Re: you have to be kidding ? by Anonymous Coward · · Score: 1

      And, yet... still true today.

  12. There are two kinds of people by RightwingNutjob · · Score: 4, Insightful

    1. Those who use real programming languages.
    2. Those who are surprised when their shit breaks because someone on the other side of the internet sneezed.

  13. There is little reason to "migrate" by DrXym · · Score: 1
    Node.js isn't a bad environment, but I can't see much reason to move from some other web hosting technology. I suppose if the computer was maxed out with concurrent processes to serve content then perhaps the event based Node.js model might be beneficial. But if not, then it's moving for moving's sake.

    Aside from its benefits, Node.js has some substantial dangers. The whole npm model of no locking by default and fuzzy matching is a security disaster in the making.

    1. Re:There is little reason to "migrate" by DrXym · · Score: 1
      Node.js is event based and heavily asynchronous. A single process can serve multiple incoming requests via handlers which in turn asynchronously run a database query and leave IO unblocked while it's happening. It might take 1s for the query to complete but the process isn't blocked while it happens and can be serving other requests in the meantime. It means it can scale concurrently with the load. It also has cluster APIs and other functionality if desired.

      Most PHP instances run as N spawned subprocesses where it can handle N concurrent requests and no more. Execution is synchronous so if each subprocess is blocking on some query then the website is too.

      So that's the benefit. But as I said I don't see it being a justification to move unless someone had scaling issues. And even if someone had scaling issues, they could always just set N to some higher number. I doubt it's a big deal for most sites.

      That doesn't mean PHP is a good language. It's awful language but migrating code to something else without a good reason is rarely a good idea in itself.

    2. Re:There is little reason to "migrate" by NotAPK · · Score: 1

      "and can be serving other requests in the meantime."

      Kind of.

      The point that everyone seems to forget is that at the end of the day the "work must be done". It doesn't necessarily matter if you do it via some fancy non-blocking IO framework, or multiple threads, the WORK MUST BE DONE.

      Please try to remember that.

      Node.js is no magic silver bullet, not by any measure!

    3. Re:There is little reason to "migrate" by DrXym · · Score: 1

      Node.js is obviously bound by the CPU and other constraints. The point is that if a database query takes a second to return the entire thread isn't blocked until the result comes back. In JS, the query goes off with a promise and the promise is executed when the result is returned. In the meantime the thread can be serving other requests, also from events and handlers. It's not a magic bullet by any means and writing asynchronous code can be painful and nasty. But to return to my original point if someone has PHP working, the fact that Node.js might be more efficient is not a good reason in itself to migrate unless scaling is a problem. And for most setups it wouldn't be.

  14. Re:I don't get node.js hype... by NotInHere · · Score: 1

    No, that's the fun thing about asynchronous programming: nothing runs in parallel at all. It all runs in the same thread. You can add worker threads, but JIT engines weren't designed for multiple threads, as well as browsers, so its not done.

    Maybe with languages like Rust in which you can do actual proper multithreading without stepping onto your toes (even better than in Go!) this might change, but its a long time until servo takes off, a very long time.

  15. Re:Ruby Community / Rails is hardly "a mess" by NotInHere · · Score: 1

    Ruby and javascript are both crap, because they are barely strongly typed, and you have to unit test everything in order to have *some* guarantees about your code. It might just outright crash because you wanted to call a number like a method. Or worse, it might continue execution but with unintended consequences.

    Putting js onto the client is one thing. It is sandboxed in one of the the world's best sandboxes and it can't do much harm there.

    But having it on the server, where it processes user data and decides whether somebody is admin or not? No, javascript is no language for that, nor is ruby or php. Js is maybe the best of those three, but still a real mess.

  16. As a hoster/developer by guruevi · · Score: 1

    what's your advice?
    Don't
    What downsides of JS on the server and in Node.js have a real-world effect?
    Scalability and lack of threads (unless you do tricksy things), lack of optimization. Sure you can throw more hardware at the issue, but if all you can pay for is a 300MB RAM, 1 core on a 1.2GHz 2nd Gen. Intel Core VPS, LAMP (or rather nginx) will easily maintain 10k hits per second for dynamic pages.
    Is callback hell really a thing?
    Yes, pure OOP in general is an issue when you need any sort of state
    And what is the state of free and open-source Node products...?
    There is a 'framework' for just about any solution. If you call every CMS a 'framework', it never has to be finished/useable out of the box right?
    Is there any trend inside the Node.js camp on building a platform and CMS product that competes with the PHP camp whilst maintaining a sane architecture
    It's very hard to do it with classic programming in classic languages (like PHP or C), it's worse when everything is an object that has unreadable API's, different style, interwoven dependencies etc
    or is it all just a ball of hype with a huge mess of its own growing in the background, Rails-style?
    Isn't it always?

    PHP works well because it's easy to learn and maintain, it may be easy to make really bad mistakes but it also means it's equally flexible. How many times I haven't cursed at Ruby or even Perl for 'tainting' a variable because someone deep, deep down did something funky like save state in a text file.

    --
    Custom electronics and digital signage for your business: www.evcircuits.com
  17. "an eternity in the world of coding" by Anonymous Coward · · Score: 2, Interesting

    Code lasts a surprising amount of time compared to the mindset of the mainstream programmer. You know, the payroll stuff running on mainframes, embedded stuff running everywhere, that sort of thing. The short timespans we see on the "consumer" side, moreso on "web" and "apps" and "cloud" and other buzzwords. In fact, html5 is all about moving on from previously working stuff and "upgrading" to the latest fad. That's why it's branded a "living standard".

    Anyhow, php and mysql are rotten pieces of crap and so is wordpress, of necessity since it's built on top of crap. node.js has the same problem. So you can stuff your wildly inefficient stack "in the cloud" so you can throw resources at your room-heater software with "web-scale" wild abandon. "Oh yeah, future proofing, baby!" Well, no.

    Me, I make sure most of the html is of the old-and-working, not the "living (only in the latest nightly browsers)" kind, meaning I still stick to mostly html4 and css, and generate both on the pre-deployment server. Meaning most content is served statically, and can be pre-compressed. That scales wonderfully. The little dynamic stuff what's left after that, eh, we can deal with it. This is very old school, but I've yet to see the whippersnappers on the web-lawn manage to do better by throwing more code and more stack layers, even more stacks, requiring more resources, at the problem. It really doesn't matter what flavour they pick, as they keep on picking the suckiest, ickiest flavours. Like, oh, php, mysql, and node.js. Migrate from shit to crap? Maybe the other steaming heap of manure will stink less? Geeze, I don't know. Why don't you try and find out? I'm sure it'll be a worthwhile experience! Don't forget your complimentary family-sized bottle of turd polish.

    1. Re:"an eternity in the world of coding" by Anonymous Coward · · Score: 1

      An old fuddy duddy myself, when I hear nodejs fan bois make statements like software over 10 years old is unrealistic, I just shake my head. I've got code older and still running than the kids making statements like that. Of course, we don't know what we're talking about cuz we're old, and this is the new way. Again, like it was the previous 3 or 4 times X has been done. It is amusing to watch them scramble to try and solve problems which they don't even understand they are having which have been solved several times already. You're welcome to pull up a seat on my porch as we watch the kids run into their newest problem that was solved in the 90s.

    2. Re:"an eternity in the world of coding" by DraconPern · · Score: 1

      You are forgetting that a lot of useful stuff were written in ActiveX controls and Java applets at the time of html4. I still see tons of those and still have to deploy them on new machines. I guess still like to use those too....

  18. Short answer: dont by MyDixieWrecked · · Score: 3, Interesting

    A lot of people are spewing a lot of well-founded hate at the node platform, but the comments are missing a lot of substance.

    Node is just ok. What it is amazing at is doing lots of asynchronous IO, and has some libraries that make this pretty easy (i.e.: async). When all you need to do is read files and hit APIs and write files it's great.

    Now node has a lot of shortcomings. For one, it's really not that fast when doing actual processing. If you need to do any kind of remotely complex calculations, including things like html template rendering (handlebars), data structure transformations or even like zipping/unzipping, it's slow as a dog. And since data calculations aren't IO, async operations actually start to slow you down. AND, unless you explicitly do things in an async manner, your whole node process will lock up and only that one task will execute, which can cause all kinds of latency issues with your app.

    One can argue that ruby, etc suffer from the same fate and that's why you have multiple processes running. But because of node's async nature, if you are using a web framework like express, each process will potentially be handling multiple clients. And process that's processing will cause those clients to get slower responses and any crash will kill all of those clients.

    There is also the mess that is npm, where it becomes very easy to have a 700MB dependency directory which SUCKS to deploy to multiple servers.

    That's just my experience as a node Dev for the past 18 months.

    --



    ...spike
    Ewwwwww, coconut...
    1. Re:Short answer: dont by joboss · · Score: 1

      Node is great basically because it fills a set of niches really nicely. I've been developing for a long time doing the same thing in Java, C even PHP which is a horrible language to write a sockets daemon in.
      If you have a really rich web/browser targeting application where you want fast real time communications with things like websock and integration into a lot of sources node.js is great. You can whip up things in it really fast and connect things together extremely easily. It also has the benefit of being able to share libraries between server and client.
      It does have a lot of hangups as well though. I agree lack of quality control on NPM is concerning. Writing especially large enterprise systems in JS also takes and additional amount of effort to decide how to enforce a structure and the things is, no one does the exactly the same thing. Scaling is also a problem although there are some techniques. What I find really problematic is when I make CPP native extensions for it. It might be my error but as of yet all indications are that JS is about as fast in CPP due to internals and the internal API as it is in JS and this is a pain point for optimising when some other languages run things ten times faster switching to implementing native extensions or plugins than node.js does for the same tasks. JS is still improving on the callback hell front. Generators will make things better for a little while but it's still quite convoluted. The jury is out on what to do with that. The ES6 changes are also making JS even more inconsistent and unpredictable although some of the changes there are very welcome. There are also big issues with the documentation and lack of clear explanation of event flow control that the community ignores and eschews from making a standard for. Things like updating your node code also incur a cost as you need to restart processes unless you do fancy things.
      However if you stick to the niches the node.js cover, it's way more productive than anything else.

  19. The missing ingredient - cloud by Anonymous Coward · · Score: 1

    You see fine fellows, there is a bigger actor at work here ---

    Shitty bloated web crapplications written by 3rd world fools with 50 cent degrees are paramount to the new world order and the agenda to make us all serfs and control our every move with the cloud, IoT and big dick data.

    If you write shitty software for the cloud that only means one thing --- you need more cloud!! That means more money for those that sell cloud. That means more money for those that sell hardware for those that sell cloud. This is the great silicon mindfuck!

    Just think how fucking fast a bare metal web application would be. No gawdam hypervisors, no gawdamn VMs, no gawdamn interpreted scripty bytecode intermediate phantom typed gobbly gook script kiddie nonsense. You'd need far less hardware. No fucking clouds.

    The agenda is --- sell, sell, sell.....depress wages, enslave workers, control population through education and media and monitor their every move with IoT and big data.

    Big brother's here and his pants are down. Open wide mutherfuckers....

  20. Yes and it is actually harder to maintain... by undefinedreference · · Score: 2, Informative

    There are more poorly-written libraries and more fragmentation in the Node.JS space than there is even in the PHP world. Beyond this, it's like developing on dev code. They've made major fundamental changes to Node in the last couple years that we've been using it that we have to almost completely rewrite our code every year or so to keep anywhere near current.

    I wouldn't change. It feels like a flash in the pan tech, it's just that developers are available for it and development is pretty rapid if they use decent front-end libraries.

    If I had it to do over again, we'd use front-end JS libraries with a more traditional server-side language that isn't like developing on quicksand where fundamental functionality changes require completely redesigning/developing your site code all the time.

    1. Re:Yes and it is actually harder to maintain... by undefinedreference · · Score: 1

      Almost two years now. We're currently on our third major rewrite in that time.

  21. Comment removed by account_deleted · · Score: 4, Interesting

    Comment removed based on user account deletion

  22. Re:Ruby Community / Rails is hardly "a mess" by KermodeBear · · Score: 4, Interesting

    I've had to learn some Ruby to support automated testing written in Ruby and Cucumber.

    I hate Ruby.

    Ruby feels like someone took Perl and intentionally made it even worse.

    The syntax is awful. Pipes and hashes and at symbols everywhere. The documentation is not good. Many packages - I'm sorry, "gems," because we have to be cutesy - don't have documentation at all, not even in the source code. Typing? What's typing? Everything is an object! That's all the type you need, right? Curly braces? Pffft. Those are to passe. You need to close things with an 'end'. Methods with ? in the name? Sure, why not. It gets really fun when you're using that character as a method name and an operator.

    I can forgive the anti-curly-brace thing, but everything else about the language feels like it was developed by an 8 year old watching bad hacker movies. So much language-specific crap that does utterly nothing to enhance readability or ease of development.

    The day I never have to touch Ruby again will be a great day.

    --
    Love sees no species.
  23. possibly by s4m7 · · Score: 1

    Migrated probably isn't the word. But my company has done some pilot projects from scratch in Node. There are some advantages:

    • Node is usually comparable or better in terms of performance and resource efficiency
    • Node projects seem to get to a MVP state very quickly.
    • The event-driven model is a very good solution to SOME problems.

    There are some disadvantages:

    • The number of choices you have for different stack layers can be paralyzing. Example: we had to interface with an MSSQL database. 6 different libraries were evaluated, two were found to meet requirements, one was settled on. A month later a new requirement was added which meant we had to switch.
    • if you are not very careful things can go spectacularly wrong with your dependencies (see: lpad disaster)
    • callback hell is trying to trace a chain of callbacks for debugging. Promises have helped... some.

    If developing something new I tend to look for ways that node can be used first, mostly because we're still trying to work out our stable development pipeline about 9 months after it started. Unless it was required I probably wouldn't choose PHP, only because the composer chain has more or less the same pitfalls of NPM, neither PHP nor node has any typing to speak of, and PHP has its rich history of inconsistency still weighing heavily upon it. to get top-notch performance out of it, you've gotta use something like HHVM which is less forgving.

    Working with a legacy base, ask yourself: can this self-contained bit be written in node as a bridge to an eventual php-free-future? Does the event model make sense for the problem at hand? Will it incur unnecessary technical debt? If the answers are yes, yes and no... then develop that part in node. No reason to rebuild working PHP parts unless you actually need to rebuild them anyway.

    --
    This comment is fully compliant with RFC 527.
  24. Conflictng requirements by lucm · · Score: 3, Informative

    If you want to create new web applications quickly, especially ones where you rely on a REST design, node.js is fantastic. With express js you can build things with very few lines of code, and if you respect the REST spirit you won't feel like the asynchronous thing is a problem. Just find Promise-based libraries for your database layer and you'll find the whole thing very smooth. Although I find the default templating library (jade) totally unusable, which is why I usually use swig; that's something to keep in mind if you do a lot of server-side html generation (as opposed to single page apps).

    As an added bonus, with a nginx/node combo you'll get better performance than with Apache/PHP and it's even easier to configure. (Although to be honest you could use nginx/fpm to get almost the same performance). Performance matters because it's easier to scale in a cost-effective way. You can start with a smaller host (like one of those $5 virtual machines on AWS) and provision as many of them as you need.

    Unfortunately this beautiful agility comes at a cost: node is not a stable ecosystem and unless you're extremely diligent in managing your dependencies, there's no way you can expect the same code base to live for 10 years. Just like bower and other packagers, npm is great and solves a lot of problems, but it relies on houses of cards built upon houses of cards. Libraries hat depend on librairies are more nimble but at the end of the day you will be the one left with a pile of garbage once a few building blocks start to erode. And with npm it's totally normal to have core libraries built by one guy in his basement who doesn't maintain his masterpiece; you don't see it because each "npm install" does all the magic, but really it can be nerve-wracking when something goes wrong and you start digging for weird error messages caused by cross-dependencies in two underlying libraries you didn't know you were using. At least with PHP frameworks there's usually a somewhat structured community.

    I don't pretend this is highly scientific but based on my experience, here's fhe difference between the same web application written in different programming languages:

    -Asp.net takes 25% less code than j2ee
    -PHP takes 50% less code than Asp.net
    -Node takes 75% less code than PHP

    However when it comes to long term maintenance:
    -nothing comes even close to java in terms of stability. I will happily debug a war created in 2002 and figure out ways to work around old jdk issues.
    -there is zero way to debug an Asp.net web application created with an old framework; just finding an IDE that will support it without trying to upgrade it (and failing at it) would prove nightmarish. And it keeps moving forward like this.
    -I'd rather drink a tall glass of melted butter than debug something written in PHP3, especially with the bad mixes of html, includes and mysterious variables that may or may not come from another file.
    -As for node, it's probably easier to rewrtie an app created two years ago than to try and fix it.

    Maybe things will change; PHP is becoming more mature and at some point people will get fed up with the throw-away nature of node js and some stability will appear. Until then: for quick & dirty stuff node is the best, and for long term maintenance java is king. I don't see immense value in sticking with stuff like PHP, RoR or Asp.net, but to each his own.

    --
    lucm, indeed.
    1. Re:Conflictng requirements by lucm · · Score: 1

      There's plenty of options in any of those languages to use ACID transactions *if* that's the appropriate design for the specific needs of the application, and it doesn't bring any code overhead. As an example you can open an ADO.Net connection with the Serializable transaction isolation level to apply the ACID principles strictly (especially the I part). That's merely a property to be set.

      It is however a misconception that "stability" can only be achieved with ACID transactions. It's always a matter of requirements and purpose.

      --
      lucm, indeed.
    2. Re:Conflictng requirements by PJ6 · · Score: 1

      -nothing comes even close to java in terms of stability. I will happily debug a war created in 2002 and figure out ways to work around old jdk issues.

      It's sad that thick client gets completely ignored in the discussion.

      I have a 100KLOC+ WinForms application written in .NET that I completed in 2003. It ran on WinNT machines with 64MB RAM, and it still runs today, just as well as it did originally, on Windows 7. Nobody has ever needed to work around any "issues". It just works.

      You want stability, don't target a browser.

  25. Half-way reliable? Anything will do. by Narcocide · · Score: 1

    Seriously, if the bar is that low, then it doesn't matter what you choose. Node.js is just as suitable for making garbage websites that wow and fool and bankrupt naive clients as WordPress or any other boilerplate crap written by the type of coders who share your "money first, rapid development time second, competence never" approach to software development.

  26. Very happy with NodeJS by laird · · Score: 1

    We replatformed a legacy C# app to a modern stack including Node.JS, and are very happy. The "win" wasn't so much the Node.JS language itself as that it was part of a platform that gives us fantastic code development velocity and fluidity. The "stack" includes CircleCI and Docker, MongoDB and Mongoose, Node.JS for a thin web services layer, and Angular (JavaScript) for the user experience, all integrated into HipChat for "ChatOps". Selenium and BrowserStack for end-to-end testing.

    I'll agree that JavaScript isn't my favorite language, but the tooling around it is fantastic, making development teams very productive.

    The benefits of using Node.JS in the overall stack include:
    - Same language for the whole stack, so a single developer can implement a whole feature (story). This eliminates the coordination cost of having three different people (front-end JavaScript, server-side C#, and database SQL) having to coordinate for use cases, giving much better velocity.
    - Node/JavaScript has fantastic testing support, making it fairly easy for us to maintain 90%+ unit code coverage, and end-to-end testing of user paths. This is integrated into the CircleCI builds means that after every code commit we have a fully built, unit and end-to-end tested, and deployed (to a test environment) application.
    - npm is awesome. It's a great tool, and the community support means many things are very easy.
    - Mongoose is awesome.
    - it's very easy to run Node.JS in AWS Lambda, which makes operations easier and is absurdly cheap to run, since you only pay for the compute you actually utilize, measured in fractions of a second. We're building one project in Lambda, and if that works well we'll likely move all the Node.JS code into Lambda, and save a lot of money at AWS.
    - Yeah, event-driven programming is complex. Luckily promises make it much easier. But in return for wrapping your head around a more complex programming model, you can more scalable applications. Similar tradeoff to multi-threaded programming.

    Yes, none of this is about the Node.JS language itself.

    1. Re:Very happy with NodeJS by NotAPK · · Score: 1

      Good post, but with all due respect, using C# to achieve this was the wrong choice to start with.

      So of course moving to node.js felt wonderful!!!

  27. Re:Ruby Community / Rails is hardly "a mess" by BlackPignouf · · Score: 2

    You need to close things with an 'end'.

    You don't need to.

    10.times{
        puts "HELLO"
    }
    10.times do
        puts "HELLO"
    end

    Both have correct Ruby syntax.

  28. Slashdot quality has improved in leaps and bounds by Qbertino · · Score: 5, Interesting

    David has shortened my Ask Slashdot significantly (no hurt feelings here what-so-ever), but the effort he put into his edited post is heart-warming and his preservation of the gist of my Node.js issue is spot on.

    I've noticed that the quality of the editing work done on Slashdot ever since the newest crew took over is off the charts compared to everything before and I'd like to take the occasion to give a huge warm applause to the new crew and the work these guys are doing. You folks freakin' rock and I've never felt such pride in being a long-time slashdotter as I feel right now. I wish you a nice stream of revenue and happy times as the new herald of slashdot, you guys are off to a spectacular start in my book. BRAVO!

    I'm actually going to point out to my geek buddies who've since abandoned slashdot (Whimps! :-) ) that now if ever is the time to return. Simply seeing slashdot soar to new heights is a pleasure in itself.

    As for the discussion on my question - great input, folks.
    And, btw., needs to be said after 17 years of slashdotting: You guys rock too. Of course. Naturally.

    --
    We suffer more in our imagination than in reality. - Seneca
  29. A language is a tool, and a tool solves a problem. by Neitokun · · Score: 1

    Have Carpenters moved over to Hammer yet? Have Plumbers checked out the newest version of Wrench? Questions like this imply that you need to use one solution to every problem, which is how we end up with broken shit like Node to begin with.

  30. Javascript is going away by phantomfive · · Score: 5, Interesting

    Javascript is approaching its peak as a programming language. The thing that will kill it is WebAssembly.

    Soon, you will be able to write front-end code in any language you like, you won't need to use Javascript. And if you're not using Javascript on the front-end, there's really no reason to use it on the back end.

    --
    "First they came for the slanderers and i said nothing."
    1. Re:Javascript is going away by phantomfive · · Score: 3, Insightful

      WebAssembly and Emscripten are really cool technologies though. But in no way a threat to JavaScript.

      The reason Javascript is popular is because in the browser, it's the only option. Once WebAssembly is widespread, that will no longer be a reason to use Javascript. That is my reasoning for explaining why Javascript will no longer be popular.

      Why do you think people will still use Javascript once they have other options?

      --
      "First they came for the slanderers and i said nothing."
    2. Re:Javascript is going away by phantomfive · · Score: 1

      Personally i don't see any problems with JavaScript.

      None at all? You might want to look into that blindspot.
      There are things in this world that I think are just awesome, but even then there are at least some problems.

      --
      "First they came for the slanderers and i said nothing."
    3. Re:Javascript is going away by jasnw · · Score: 1

      Why do you think people will still use Javascript once they have other options?

      (1) Inertia, and (2) code base. COBOL, and to some extent Fortran, are still around because of the huge amount of code nearly everywhere that would be way too expensive (and in some cases impossible) to recode. You also have to retool people and dev environments if you're going to jump to the latest/greatest way to slice bread. Not a fan of JS, but I don't see it disappearing any time soon.

    4. Re:Javascript is going away by ZeroWaiteState · · Score: 1

      Answer, because JavaScript programmers are what the programmer mills are churning out. Technology choice is only loosely coupled to merits.

    5. Re:Javascript is going away by Anonymous Coward · · Score: 1

      Because their FAQ says so? https://github.com/WebAssembly/design/blob/master/FAQ.md#is-webassembly-trying-to-replace-javascript

    6. Re:Javascript is going away by NotAPK · · Score: 1

      "you can write open APIs that enables your frontend to render in OpenGL, Canvas as well as HTML."

      So which one do you choose? And why?

    7. Re:Javascript is going away by NotAPK · · Score: 1

      But you have now defeated the entire point of this discussion: node.js, "use the same language on the client side and server backend"!

      Please do not misunderstand me, I am well aware of the complexity that currently pervades modern in-browser "app" development.

      It just frustrates me that we are making extremely complicated programs to work around a plethora of shortfalls in the architecture and design limitations of this platform. Speak to an assembler developer from the 80s. Yes, lots of chips to choose from. A lot of work was required for performance. But the key point is that they programs **did** perform extremely well.

      Contrast that to today: gob-loads of complexity, but very very little to gain for it.

      I do not buy that the price of a "web app" or "cloud program" or the next big "2.0 thing" is exceedingly complex software.

      Am happy to debate, please enlighten me!!

    8. Re:Javascript is going away by NotAPK · · Score: 1

      Points well made, thanks, I'll do some research into those technologies.

      However, adding abstration does not go hand-in-hand with performance. They're almost diametrically opposite objectives.

      If indeed these frameworks can achieve incredible performance in the browser, then my experience tells me this will only happen via direct support from the browser developers. Which as you very correctly allude to, can only happen via a widely adopted framework.

      Interesting times, thanks.

  31. Re: Node.js web scalable! Very funny by Billly+Gates · · Score: 1
  32. So much resistance to change! by ajyand · · Score: 1

    I do not know why people discourage people from experimenting change! I won't recommend changing a good, existing working base from PHP to JavaScript but I'd strongly recommend using Node.js for all future deployments. While everyone is seeing callback-hell as a limitation of JavaScript, I see it an important property of JavaScript which is a kind of early warning to you if you do not modularize your code.

    1. Re:So much resistance to change! by ajyand · · Score: 1

      Oh, I forgot to mention my experience. I've moved to JavaScript after working on C++ for over 10 years. My experience has been better than C++. While JavaScript is gaining more features from C++ in each release and Boost is moving C++ in the direction of JavaScript, I find JavaScript neat, cleaner and handy than C++.

    2. Re:So much resistance to change! by NotAPK · · Score: 1

      "While JavaScript is gaining more features from C++ in each release"

      When you want to develop stable code, this is not actually the benefit you are claiming it to be...

  33. YAM2C (Yet Another My Two Cents) by rgbe · · Score: 1

    I dove straight into Node.js to develop a platform around 3 years, I don't regret using Node.js, in fact I am glad that I used it. I essentially used the MEAN stack (MongoDB, Express, Angular and Node.js). It was great to:
    1) use JS everywhere: back-end (including the DB) and front-end.
    2) use JS: it's fun (for me) - if you use the right parts. And it performs fast enough, on par with PHP, if not faster.
    3) have an experienced community - JS and Node.js has gone through it's teething issues already.
    4) do async programming - if you do it right, you tend to keep your code more modular.

    What was painful:
    1) Learning to write JS the "right way" and how to avoid the bad and ugly parts.
    2) At the time there was no great CMS, I believe Keystone is the best at the moment, but it looks very light when compared to Wordpress.

    What you need to do if you go with Node.js:
    1) Learn JS well, learn "The Good, The Bad and The Ugly", such that you can avoid the Bad and Ugly. The good is actually awesome.
    2) Understand prototypical inheritance, it's not your classical classes, but it a powerful and memory efficient way create objects.
    3) Use a linter to write your code, like eslint, it will help you avoid the bad and ugly parts.

    I still use Node.js today, but now for the Internet of Things and my embedded device runs Node.js. JS is everywhere and it's going to remain everywhere.

    1. Re:YAM2C (Yet Another My Two Cents) by Anonymous Coward · · Score: 1

      >use js for the DB
      Nightmare fuel.

      >using node.js for an embedded device
      Thanks for that, now I will never sleep again. I hope You are proud of Yourself.

    2. Re:YAM2C (Yet Another My Two Cents) by NotAPK · · Score: 1

      "1) use JS everywhere: back-end (including the DB) and front-end."

      I understand what you are saying, and I've read a good load of posts in this forum claiming the same...

      But I must ask why??

      While the language syntax might be the same, the object model, pattern, and coding structure of what you are trying to do is **entirely different**!!!

      For this reason along I simply do not understand the benefits...

    3. Re:YAM2C (Yet Another My Two Cents) by rgbe · · Score: 1

      Good point. The reason I like to use JS everywhere is that I only need to learn one language. And it means I can learn it really well. Until I did full-stack JavaScript I had only done front-end JS and it was pretty wonky. Using Node.js means that you need to learn some of the great parts of JS well (closures, async, etc). This drastically improved my front-end JS. If you used the LAMP method for full stack development, you would need to learn Apache config (although once it's running it's okay), PHP, JavaScript and SQL, and I would not have the time to learn the subtleties of each language.

      I agree that the object model and patterns for MongoDB are different, the object mode and patterns for front-end and back-end are very similar in many cases, there is a big overlap. Things you use on all three are:
        - Callbacks
        - Closures
        - Prototypical inheritance (front-end and back-end)
        - Event emitters (front-end and back-end)
        - And many more like described here: https://www.smashingmagazine.c...

      Code re-usability is useful at times, I was able to write a library (https://github.com/psiphi75/web-remote-control) that was used on the server, on the front-end and on an embedded device and I guess around 80% of the code is shared across all three. Imagine writing and debugging that code in three different languages.

  34. Choose platform / language last. by MegOnWheels · · Score: 1

    Hi, Pick your platform based on the ability to get workers, manageability, vendor support, depth of libraries, actual business need and the overall toolchain.
    The platform is just the tool. Starting with the platform is like answering the question.
    "How many rooms do we actually need?" with "I have a hammer!"

  35. So much hate for JS, but I love it by davesag · · Score: 1

    I'm one of those older coders who started out with assembly language, did some BASIC, APL, Ridl, etc, before finding Java, then Javascript. I've seen enough PHP to scare me. I've written enough Ruby to be used to its quirks. I've been writing Javascript since 1997 and it's still my go-to language for when I need to get something done quickly and reliably. I've taken code that took 12 hours to run in Ruby and turned it into a simple Node script that ran in 6 minutes. Like Ruby and Java there is a real culture of testing with Javascript and Node especially, which makes the inevitable refactoring a dream. I am thinking of kicking it all up a notch however and diving into Elixir.

    I learned Coffeescript in an afternoon for a particular project (lots of Coffeescript devs) and while I do get the advantages of it, those advantages (especially with ES6) seem too slight to make me want to really deep-dive into it. I suppose I really ought to learn Swift though, as I expect it will become the new server-side hotness sooner or later.

    --
    I used to have a better sig than this, but I got tired of it
    1. Re:So much hate for JS, but I love it by NotAPK · · Score: 1

      Sure it's easy to optimise code:

      Just replace:

      do something 100 times {
            do something 100 times {
                  do something 100 times {
                        actuallyDoIt();
                  }
            }
      }

      With:

      JustDoIt1000000Times();

      Or peer deeper and:

      DontDoItAtAll(); ...amazing!!

  36. Re:Haha, you pussy. by lucm · · Score: 1

    Regards, a Perl developer.

    I've done my share of Perl years ago, including cgi web applications with mod_perl. Back in the days I was all for it, telling whoever who'd listen how slashdot and imdb were success stories of Perl on the web.

    Back then it was an okay technology, but it didn't age well and never got the kind of good frameworks that make rapid development of complex applications possible in other ecosystems. I don't know why someone would still write web applications with Perl today, unless they're unable or unwilling to keep up with more dynamic technologies. I can see someone using it for systems administration, but even there it's been outpaced by python and ruby thanks to devops tools like Ansible or Puppet.

    --
    lucm, indeed.
  37. Use Node for what it is good for by Carcass666 · · Score: 2

    Node is very good for processes that hit a database and/or file-system with "simple" manipulation. You will have to think asynchronously, and you will want to learn promises. Where it shines is when you have a lot of simple things to do during a method, and you can do those things concurrently. It's great for squeezing out every last ounce of CPU/core capacity - which can be priced at a premium if you are on "the cloud".

    For web-hosting, you can use something like Express, and implement it with clustering to scale out to your server's capacity with regard to CPUs/cores. This gets very clunky, very fast, much more so than PHP or even ASP.MVC. It seems like a solution looking for a problem. I'd avoid it.

    One of the better implementations I've seen of Node is in AWS. You can upload a Node package to their Lambda service, and trigger based upon a schedule, S3 (file) event or an inbound web call (via API gateway). It pretty much scales "auto-magically". But there are limitations. You have some utilities like Ghostscript available, but you are mostly limited to the version they have on their server images. You can include your own executables (by building them in an EC2 instance), but this increases your package size, load time, etc. If you want to use Node for a website, I'd probably limit Node's use to webservices (AJAX) for hitting the database and business logic; and drive your site's UI using a client-side engine (Angular, react, etc.). You can use it very effectively for back-end processes thumbnail generation, email notifications, etc.).

    For "quick & dirty" websites, I'd probably avoid Node, unless you are going to drink the "cloud Kool-Aid" (especially with AWS Lambda); then Node might be a fit if you are going to craft custom sites where scalability and cost management are significant considerations.

    1. Re:Use Node for what it is good for by NotAPK · · Score: 1

      As a fellow developer I would only claim to understand about half of what you're written.

      For this reason, I'd like to start a meta-discussion about why and how the complexity has grown to be this insane?

      Yes, we have code running on the server, and code running on the client. But why should this be inherently any more complex than HTTP?

      Everyone in this game is striving to solve the same problems, yet why are we all doing such a piss poor job of making things simpler?

      It really bums me out...

    2. Re:Use Node for what it is good for by Carcass666 · · Score: 1

      For better or for worse, a lot of this (esp. microservices) comes down to cost. In the "good old days" I could load a service, batch process, etc. onto a server in my data center that had the spare capacity to deal with it. Of course, in those same "good old days" I had to worry about things like fiber channel firmware, router OS updates, etc. and never, ever, had the resources to do that right. We always used equipment well past its depreciated book lifespan, and generally replaced stuff only when it broke. We very rarely got the budget to adequately address redundancy and fail-over.

      The "cloud" largely absolves us of responsibility for dealing with firmware, failed drives, etc. Yes, sometimes there are failures, but anybody being honest about uptime (especially with AWS) has to admit it generally is a lot better than the average SMB data center. The big downsides are privacy and cost. Your data lives somewhere else, with what else you have little idea, but that's a pill that more companies are learning to swallow. A lot of companies use AWS as a glorified server farm, which is the most expensive way to use the "cloud". The platform-as-a-service stuff and now micro-services (Lambda) scale much more economically. For me, it helps to look at all of this kind of like the difference between building with Duplo and regular Lego bricks - you can do far more elegant designs with the smaller bricks, and you ultimately end up with stronger builds.

  38. Re:Node JS is the new PHP, the new PHP is actually by Anne+Thwacks · · Score: 1

    I think you will find 200% of 0 is still 0.

    --
    Sent from my ASR33 using ASCII
  39. node.js is fine by mveloso · · Score: 1

    Node.js is neat. We have a production service running on it that handles a couple of hundred thousand messages a day sent by tens of thousands of devices. It's not much, but it's only about 700 lines of javascript. That's including comments and whitespace.

    The callback mechanism takes some getting used to. If you haven't programmed interrupt handlers or async I/O it'll be confusing, because the flow-of-control isn't really that obvious.

    Why did we choose node? Our understanding was that it's great at concurrency, and this was a small and fast project to test it out. We're using it as a stepping stone to Apache Lambda, with the goal of throwing our message infrastructure into Apache at some point.

    We didn't try to replace a LAMP stack with it. I suspect that would be a bad use for node...although given a low workload it could probably be done.

  40. Re:Ruby Community / Rails is hardly "a mess" by ZeroWaiteState · · Score: 1

    You forgot you can also modify constants.

  41. With regard to the durable pipeline by ZeroWaiteState · · Score: 1

    It's worth noting that Node.js has really one build manager: NPM. For why that is relevant, see this: http://www.theregister.co.uk/2... NPM is fairly new, and is undergoing the growing pains of becoming a major code distribution platform. Part of this is finding out why it's a bad idea to allow repositories to instantly disappear, and also why its an even worse idea for the previously used namespace to be reused by a different maintainer, especially in the absence of other security measures like code signing. Putting your project under the Node umbrella means you will need to adapt as they gradually figure these things out.

    1. Re:With regard to the durable pipeline by dolmen.fr · · Score: 1

      To be fair, all repositiories of open source libraries have this kind of issues.

  42. Why should I? by aglider · · Score: 1

    Clear statements and real facts, please!

    --
    Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
  43. manager POV on node by hardcorejon · · Score: 1

    I've managed a team that spent more than one day just isolating where a bug was occurring. If you don't have expert-level developers (expensive!!), be very afraid. Every once in a while a nasty bug will pop up that takes 5-10 days to finally fix. Development on large codebases is very slow due to poor modularization/code structure from the start, which I have sadly never seen done right.

    If you have a greenfield situation, and really want to use node, make sure your first developer is top-notch, not only in coding skill but in coding structure. Hopefully it can be designed so that its tendencies are not to become a giant hairball -- but it still might anyway.

  44. nodejs is not reliable by crispytwo · · Score: 1

    Me and my team migrated away from nodejs.

    it is not easy to debug,
    the library versioning is shit via npm so 1 deployment may well be different from the next.
    finding good libraries is like ... you can't
    scaling is poor.

    what is it good for? quick prototyping and experimentation. Fantastic for that.

  45. Re:Ruby Community / Rails is hardly "a mess" by BlackPignouf · · Score: 1

    Ruby and javascript are both crap, because they are barely strongly typed

    Don't put them in the same bin. Both are dynamically typed, but Ruby is strongly typed and JS is weakly typed.
    JS:

    a="10"
    -> "10"
    a-1
    -> 9
    a+1
    -> "101"

    Ruby:

    a="10"
    ->"10"
    a+1
    ->TypeError: no implicit conversion of Fixnum into String

  46. Re:No, since Node.js has too much ideologues in it by dave420 · · Score: 1

    So much self-righteous stupidity in one comment. Amazing.

  47. Re:It's not that bad, just don't write PHP with JS by joboss · · Score: 1

    Better to wait for generators to really take off. They are showing some promise. I reached a point where I was having call back hell, looked at async, promises and decided screw that, I need some kind of new language feature to solve that. Amazingly, a year later generators came to the scene to address that which isn't too long to wait. I hate an argument with someone about promises and implemented my own promises library just to prove the point that I knew what he was talking about and that it sucked. Someone else has also gone through the same mess but unlike me could has tried everything else rather than to skip the 3 or 4 common ways to deal with callback hell until something worth actually going for arrives: http://blog.namangoel.com/deal...

  48. improve instead of reinvent by Tom · · Score: 2

    A developer maintaining his company's "half-assed LAMP / WordPress stack pipeline for web and web application development" is considering something more scalable that could eventually be migrated into the cloud

    How about replacing it by a less-assed LAMP stack? You know, the answer to a broken wheel is not to sit down and reinvent the wheel. Generally, it is faster, cheaper and smarter to simply get a proper wheel.

    I've refactored projects, both successfully and with failure. This is one area where the old estimate rule-of-thumb (take your best guess, double it, then increase the order of magnitude by one, i.e. replace hours by days, days by weeks, weeks by months, etc.) is so absolutely true. If you have a working pipeline, no matter how bad it works, you will dramatically underestimate the effort it takes to rebuild that pipeline on a different technology.

    Sometimes it is worth the effort. Typically, not. Replacing wordpress with something non-broken is probably ten times faster and easier than reinventing the whole thing.

    --
    Assorted stuff I do sometimes: Lemuria.org
  49. Re: The fuck is node.js? by terjeber · · Score: 1

    No

  50. Re:Node.js scalable! Very funny by terjeber · · Score: 1

    node.js is just awful. Why would anyone think that is is more scalable than the LAMP stack

    This is one of those comments that are too funny. A person talking up a horrible, terrible, monstrosity of a piece of junk (PHP) as a solution to another horrible, terrible, monstrosity (in their opinion) node.js.

  51. Of course not. Go is a better choice! by dolmen.fr · · Score: 1

    8 months ago, when we rebuilt the previous version of our platform that was insanely in PHP (with an insane level of intricated web services) that had poor performance, we wisely choose Go.
    Go is compiled. Go has strict type checking. Go has built-in support for writing unit tests.

    And Go's support for concurrency is far much better than node.js (which still runs on a single CPU).

  52. Re:Ruby Community / Rails is hardly "a mess" by steveb3210 · · Score: 1

    I've had to learn some Ruby to support automated testing written in Ruby and Cucumber.

    I hate Ruby.

    Ruby feels like someone took Perl and intentionally made it even worse.

    The syntax is awful. Pipes and hashes and at symbols everywhere. The documentation is not good. Many packages - I'm sorry, "gems," because we have to be cutesy - don't have documentation at all, not even in the source code. Typing? What's typing? Everything is an object! That's all the type you need, right? Curly braces? Pffft. Those are to passe. You need to close things with an 'end'. Methods with ? in the name? Sure, why not. It gets really fun when you're using that character as a method name and an operator.

    I can forgive the anti-curly-brace thing, but everything else about the language feels like it was developed by an 8 year old watching bad hacker movies. So much language-specific crap that does utterly nothing to enhance readability or ease of development.

    The day I never have to touch Ruby again will be a great day.

    Whats really wrong with having a ? in a function name? Other than C didn't do it in 1971...

    Written in another language, people often prefix boolean-return functions with is_, e.g. obj.is_deposit - to me its much more readable and clear that your "asking a question" by writing obj.deposit?

    Again, pipe is just a chracter - whats wrong with using it? They are used to denote blocks, e.g.

    0.upto(10) do |i|
        puts "i"
    end

    Also, I'd be curious to know what "language specific crap" you're referring to, theres plenty to like..

  53. Re:Ruby Community / Rails is hardly "a mess" by tigersha · · Score: 2

    Agreed. a PHP Programmer calling Ruby a mess is just deluded or plain stupid.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  54. Re:Ruby Community / Rails is hardly "a mess" by tigersha · · Score: 1

    Ruby is not based on Algol/Pascal/C/Java thing. It is based on Smalltalk with a lot of LISP thrown in. That is why

    a) It is so cool
    b) Codemonkeys regard it with distaste.

      And curly brackets suck donkeyballs.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  55. Re:From the original article by omnichad · · Score: 1

    Drupal and WP are both not examples of PHP being ahead of the game. Those are examples of bloat and inefficient code taken to an extreme.

  56. Re:Node JS is the new PHP, the new PHP is actually by omnichad · · Score: 1

    You don't implement error-handling and then you blame PHP?

  57. Ruby Runtime by Tenebrousedge · · Score: 2

    There's actually not a lot in Ruby that you can't modify at runtime. You can't break variable assignment, and I don't think you can erase the concept of class inheritance, but most other components are up for grabs. It's perhaps not quite as flexible as Lisp or Smalltalk, but there's definitely no shortage of hanging rope. Metaprogramming Ruby was an enlightening look at how this can be put to practical use. Personally, I think that "monkey patching" is grounds for "developer punching", but there are a great many tools which improperly used make superlative footguns.

    --
    Those who advocate genocide deserve every protection afforded by law, and none afforded by common human decency.
  58. Re:Have you even had a programming class? by TheRaven64 · · Score: 1

    Complete rubbish; object based & functional, not OO.

    Functional languages are ones that have a strong notion of a pure function (i.e. something that is side-effect free and has immutable state). JavaScript doesn't come close to representing this.

    A very good definition for the term: rubbish language.

    Name one mainstream language that doesn't have odd corner cases.

    by definition not an integer.

    Sorry, I meant the only type that you can use for representing integer data. You effectively have a 53-bit integer that silently becomes a floating point value on overflow. This is the type that you must use for all integer data, including things like loop induction variables.

    --
    I am TheRaven on Soylent News
  59. Re:Haha, you pussy. by sydneyfong · · Score: 1

    This.

    Catalyst was there before Ruby on Rails was even a thing.

    --
    Don't quote me on this.
  60. Node.js for simplecart by Bobbox1980 · · Score: 1

    I can't speak for javascript's good or bad performance and usability in complex projects but I can say that Node.js and simplecart which uses Node.js is very easy and runs fine. Yeah a hacker can change a price going to Paypal with it but with only one product to sell it is easy to see if the correct price is being transmitted. A little html and boom the site can run on a Raspberry Pi and perform well.

    1. Re:Node.js for simplecart by NotAPK · · Score: 1

      While I respect the integrity of your comment, if you only have one product to sell, why is this not on a static page with a static price?

      Then it becomes trivially simply to change the price, plus, you know that every single concurrent user is seeing the exact same content. In addition, it will save on the hosting costs!!!

  61. Re:Haha, you pussy. by lucm · · Score: 1

    Really? You have created actual web applications with this thing? What kind?

    --
    lucm, indeed.
  62. No, since Node.js has too much ideologues in it by sethstorm · · Score: 1

    (That, and people modbombing me only serves to confirm it)

    --
    Twitter supports and protects racists - by smearing their critics with the "Hate Speech" label.
  63. Nodejs version shit by Gunstick · · Score: 1

    This is so braindead. Whoever thought this out must be sick.
    I wanted to install some software to control my cromecast.
    First install: the nodejs in the repository is too old.
    oh well, just upgrade my linux, it's kinda old...
    Next install: the nodejs in the repository is too new!

    WTF? And of course the "too new" message is displayed via 500 lines of error stack dump.
    Well this is exactly how you get people to embrace and use nodejs, NOT!

    --
    Atari rules... ermm... ruled.
  64. Don't repeat yourself by tepples · · Score: 1

    Server side and client side design patterns are different.

    But sometimes you want the prevalidation logic on the client to have the same behavior as the authoritative validation logic on the server. There are two common ways to keep the logic in sync without violating Don't Repeat Yourself: either write the server in the client-side language or transpile the logic from the server-side language to the client-side language.

  65. UTF-16 sucks. Does Unicode? by tepples · · Score: 1

    Strings are also unicode by default which sucks on backend.

    What about Unicode in general necessarily "sucks on backend"? Or are you confusing Unicode with its UTF-16 binary form, which arguably does suck compared to UTF-8?

  66. 2 MB of illustrations and photos by tepples · · Score: 1

    If your website takes more than 4 seconds to load on a 5mbps internet connection, then it's designed by a freaking noob that should not be allowed near a webserver.

    Converting from bits to bytes and subtracting protocol overhead produces a limit around 2 MB, even if a site keeps its scripts under, say, 10 kB. If a single document has more than 2 MB of illustrations and photos, such as a long how-to article, how should it be sent? Should all images after the first 2 MB use "lazy loading", where an image doesn't load until the user has scrolled to it and thus can't be viewed without turning scripts on for the site or after going offline?

  67. Get passive-aggressive: review the site by tepples · · Score: 1

    I just thought of a passive-aggressive way for a design firm to fight clients that demand excessive scripted animation.

    1. Clarify to the client that some design firms also run websites offering reviews of random sites' usability. Name-drop "Web Pages That Suck", "Tab Closed Didn't Read", and "Plain Text Offenders".
    2. Remind the client that disability discrimination laws may apply. Name-drop National Federation of the Blind v. Target Corp.
    3. Provide a view of the same information with a similar look but less bling, and link to it from the main site with a wheelchair symbol (alt="Accessible version of this page"). Follow best practices for accessibility and usability on this view.
    4. To disguise this site's connection to the design firm, use a shell company and/or review other firms' sites.
    5. If a client insists on bling that harms the user experience, and particularly if the client requests removal of the accessible version, review the site and mention the harmful UX and possibility for lawsuits from an advocate for the disabled.

  68. Having to hire someone to write a transpiler by tepples · · Score: 1

    Now there may be valid reasons to reimplement in another language (better matching your available talent pool, better performance, you would just prefer it)

    Especially when the deployment platform dictates the choice of language. Examples include Xbox Live Indie Games and Windows Phone 7 requiring verifiably type-safe CIL for the .NET Compact Framework (in practice, requiring C#), or the web requiring either ECMAScript 5 or a language that transpiles to ECMAScript 5. Then "better matching your available talent pool" means "we would have to hire someone to write a transpiler to the only supported language", and "better performance" means "the alternative is writing an interpreter".

    but if it's just to 'make it clean', that can pretty much always be accomplished within the existing language choice.

    Even if "the existing language choice" is assembly language, as in the case of porting a classic video game to a modern platform? Can assembly language be made as clean as, say, Python?

    1. Re:Having to hire someone to write a transpiler by Junta · · Score: 1

      Well, I was speaking to the common use case of no porting, no using it in a new context, just wanting to make the implementation 'more clean' but otherwise maintain roughly the same behavior in the same context. I did not mean the list of example valid reasons to be comprehensive. Porting and all sorts of other valid use cases exist.

      Now one could make an argument that raw assembly by most eyes will never be as readable as a higher level language, but that's a pretty rare circumstance and there are frequently a lot more reasons to be wary of pulling the trigger on a rewrite of such a case just for cleanness sake.

      Bottom line, if you want to rewrite an existing program, it better be for more reasons than making it cleaner, 99.99% of the time.

      --
      XML is like violence. If it doesn't solve the problem, use more.
  69. When platform owners ban categories of native apps by tepples · · Score: 1

    You just need to pick the right combination of frameworks and programming language. Everything can be converted to everything else nowadays.

    Unless the web application is a workaround for a platform owner's policy that specifically forbids a set of native apps. For example, applications doing any of these things cannot be converted to a native iOS application intended for distribution to the public.

  70. Re:Ruby Community / Rails is hardly "a mess" by TeknoHog · · Score: 1

    Curly braces? Pffft. Those are to passe. You need to close things with an 'end'.

    Fortran uses the 'end' convention, and it was the first high-level programming language. As a more recent language for scientific computing, Julia has adopted this, and I personally prefer it to both braces and Python's syntactical indentation.

    Basically, I want to minimize the amount of punctuation (aka line noise) I see. Line breaks are a simple way of getting rid of semicolons (unless you really need to write one-liners that aren't). For blocks you need something else, and Python's way is too fragile between different programmers/editors.

    --
    Escher was the first MC and Giger invented the HR department.
  71. No by NotAPK · · Score: 1

    No.

    Next question?

  72. perl by silverdirk · · Score: 1

    I started on Perl to maintain existing code, but have since used it extensively for everything I do these days. The greatest thing about perl is the wealth of CPAN libraries available. Recently I was asked to automate the process of logging into a mailbox, downloading the most recent message meeting various criteria, extracting a zip file attachment from it, extracting an Excel ('97 format) file from the zip file, and importing its table of data into the database used by a large webapp.

    Thanks to CPAN, I had the whole thing done in less than a day. CPAN modules are a mixed bag, but most of the important ones have decent documentation and a lot of real-world testing. They're also trivial to install. "cpanm ModuleName".

    I judge web frameworks by how *little* they try to do for me, and how easy it is to pull in other modules that serve specific purposes. The Perl ecosystem excels at this, more than any other language I've worked with.

    --
    Mark of the Coder fades from you. You perform Opening on World of Warcraft. Warcraft crits GPA for 4. GPA dies.
    1. Re:perl by lucm · · Score: 1

      Sure, I know CPAN, but you can get all that plus vastly superior performance with node js. And there's 10x more packages on npm than CPAN (according to modulecounts.com) and it's clearly the most active.

      Look at the packages:
      https://www.npmjs.com/

      It's not more difficult to install a package (npm install ModuleName) and you get all kinds of fancy tools to make development easier. You can use frameworks like express js to quickly build apps, but with just node alone it's trivial to create pretty much anything. It's javascript so there are things that suck (like dates) but overall it's pretty good, and much easier to learn than perl.

      I'm not saying you should ditch perl, but there's no compelling reason to use it unless one has invested time already in becoming a perl expert.

      --
      lucm, indeed.
    2. Re:perl by silverdirk · · Score: 1

      Well npm does seem to have caught up on module availability. Though I just checked and the excel parser is actually just a wrapper around the Python library. Also these APIs are pretty skeletal and the documentation is almost non-existent.

      Compare: (just picking the modules with high star ratings)
          http://search.cpan.org/~dougw/...
          https://www.npmjs.com/package/...

          http://search.cpan.org/~phred/...
          https://www.npmjs.com/package/...

      --
      Mark of the Coder fades from you. You perform Opening on World of Warcraft. Warcraft crits GPA for 4. GPA dies.
  73. Re:Haha, you pussy. by silverdirk · · Score: 1

    It won't give you asynchronous event-driven websockets or anything like that, but Catalyst is great for a fast backend, serving pages and ajax requests. The learning curve is higher than it needs to be (thus the rise of Mojo and Dancer), but it's served me well on two moderate sized projects. (one public site serving ~30,000 requests a day, and the other a closed system with ~1000 active users a day)

    --
    Mark of the Coder fades from you. You perform Opening on World of Warcraft. Warcraft crits GPA for 4. GPA dies.
  74. Re:Node JS is the new PHP, the new PHP is actually by tepples · · Score: 1

    Does it mean my webpage won't either die with no error or run fine with unhelpful warnings anymore?

    If you want exception semantics instead of "error reporting", use ErrorException .

  75. PHP 7 OK, not perfect by tepples · · Score: 1

    PHP7 is a huge improvement over old versions. If you haven't looked at it, do so. PHP sucks in 2016 is mostly FUD now.

    To see how much of an improvement PHP 7 is, let's check the 7 things wrong with PHP 5 that I mentioned in this article (and previously in a Slashdot comment):

    Things such as switch use the byzantine semantics of operator == Not fixed to my knowledge. Parse errors and undefined functions are fatal PHP 7 makes them "engine exceptions" which are catchable Error instances. Inconsistent naming and argument order conventions for standard library functions Not fixed completely for back-compat reasons, but PHP 7 has started to drop some duplicate functionality. Backwards associativity for operator ?: Not fixed for back-compat reasons, but at least the new null coalesce operator ?? has its associativity on the more useful side. Letting the server operator change program semantics in annoying ways Safe mode and magic quotes were already gone in PHP 5.4. cURL would not follow redirects if open_basedir was set until September 2013. But upload_max_filesize still defaults to 2MB, which I see as unnecessarily small. Semantics breakage in minor (5.x) versions encouraging shared hosting operators to delay making new versions available to subscribers Not fixed until the majority of shared hosts offer PHP 7. Has someone run a survey about this? No keyword arguments Not fixed.