Tag Info

Hot answers tagged

30

Erlang isn't complicated to learn, it's just alien to the mindset that the Chambers Constant (99.44%) of coders have learnt as the way programming works. The problem you're facing are likely just conceptual disorientation rather than actual complexity. Here are some of the alien features of Erlang that are going to bite a typical programmer: Erlang is a ...


29

First of all, I agree with JUST MY correct OPINION's answer regarding learning Erlang. It's a mostly functional language (although concurrency plays a big role), and all of its features were added to go towards fault-tolerance and robustness, which is not exactly the same design goals as Javascript in the first place. Second of all, leaving Node.js to get ...


26

While that concept can indeed be implemented in many languages (and as dodgy_coder mentioned, it has been implemented in Ruby and Python at least), it's not quite as trivial as you state. True, Java has non-blocking IO APIs. So you can do raw disk/network IO in a non-blocking way. However every API that somehow wraps or handles IO needs to be implemented in ...


24

I don't understand what is more "safe" about python than for example php. I've seen php used plenty of times for financial applications just like python, ruby, perl, c#,java and a bunch of other languages. node.js is as solid of a platform for financial applications as any as long as you stick to all the regular rules that an application that deals with ...


20

Most of the questions you ask are not answerable without context, and are more or less moot given management has already made the choice for you... unless you are asking 'should I quit and find a new job in the face of all this change?' If your going to tough it out I recommend you read this this post on the topic: How To Survive a Ground-Up Rewrite Without ...


19

Do you as a Javascript developer consider the traditional Design Patterns as important or less important than they have been with other languages / environments?. Classical design patterns do not apply to JavaScript. What does apply is writing modular and functional code. You should use a mixture of Constructors and first class functions. As ...


18

JavaScript certification is called github. It's called write modules, maintain modules, and share modules with the community, build popularity, etc. As a JavaScript employer I couldn't care less what certification you have, I care about either examples of github modules showing quality code or live websites/web applications show high quality code.


18

The nice thing about callbacks is there's no global state there, and passing parameters to them is trivial. If you have a function download(URL, callback: (FileData)->void) then you can know that's a self-contained higher-order function which essentially lets you construct a "grab this and do that" function. You can be sure your code flow is exactly as ...


17

Probably the main reason is that it uses JavaScript to write server-side components for things such as web servers, web applications or web services. This unifies the traditional front end (client-side) development language JavaScript with the server-side language. You're right - the fact it is non-blocking, using the reactor pattern is not unique - it has ...


14

There is two important things that make Node.js different to existing server-side frameworks, asynchronous events and the use of JavaScript as programming language. Asynchronous Events While most of the existing server side frameworks use an synchronous architecture, Node.js use an asynchronous architecutre that JavaScript can handle well. This means that ...


13

Of course any CPU bound work is going to utilize the CPU. It's going to block the CPU in whatever language or framework you write it in. Node.js is great for when you have I/O bound work, not CPU bound. I wouldn't do heavy lifting in Node, though it can be done. Node.js solves real problems, not fictional or imagined ones like fibonacci number servers. It's ...


12

is there any good reason to avoid Node.js for traditional web apps Yes, if you have N years in web platform X then clearly you can developer an application in platform X faster. If you want to do Y and platform X has a pre-made solution Y that does X then do so. All the generic reasons of why you should use one platform over another. the sort of ...


12

I'm now looking at node.js and it's performance implications (I'm addicted to speed), but I haven't delved into it all that much. Profile, profile, profile. That's the only way to know that your speedups are having the proper affect. You can guess that it's fast enough. But most people like to prematurely optimize. That's worse than playing with ...


12

Good IDE for Node specially for Debugging(Also regarding JavaScript) Nide, is a web-based IDE for Node.JS, designed with simplicity and ease-of-use in mind. You can run Nide locally or install it on your remote server, and access it through your Web browser. Cloud9, a Good IDE specifically for developing JS applications. Komodo Edit supports ctrl+click to ...


12

When Node.js is described as "non-blocking", that specifically means that its IO is non-blocking. Node uses libuv to handle its IO in a platform-agnostic way. On Windows, it uses IO completion ports, on Unix, it uses epoll/kqueue/select/etc. So, it makes a non-blocking IO request (which may have a background thread monitoring, but this is never exposed to ...


12

I believe that you should be looking at the problem technical domain instead of the tools. Let's take it a bit further. Imagine I'm building an apartment building, and I like to use this awesome hammer with two claws (yeah, just like the PHP hammer). Me and my coworkers all have one of these fancy hammers, we use them everyday, all day long. It makes our ...


10

We will have about 200 computers (most on the same network) that will each send, via HTTP POST, around 5000 requests/day. With each request containing about 300 bytes of data. That's about 10 req/s. So it's clear that you don't need to switch. Real life benefits of switching (besides getting valuable experience)? Well, as you said, you're hosting on ...


9

Take this answer as subjective opinion. Do you as a Javascript developer consider the traditional Design Patterns as important or less important than they have been with other languages / environments? If you mean traditional design patterns like Gang of Four, then most of the techniques are language/platform agnostic like "Program to an ...


9

The three main reasons I would give are: Non Blocking IO / Asynchronous IO. This is hashed everywhere on the web and in the previous posters. One thing I would contribute is that designing your code to explicitly assume asynchronous behaviours assists the compiler engine to maximize the hardware. Yes, many of the JIT compilers and hyperthreading processors ...


9

Since you can pass functions as parameters, it is common to pass a "callback" function to these sorts of functions. So, for example, you may have a "read" function that looks like this: function getUser(userId, callback) { var mydbAPI = something; var myQuery = somethingElse; mydbAPI.getUser(myQuery, function(data) { //parse data a little here: ...


9

JavaScript doesn't have integers. It's commonly accepted that money should not be dealt with using floats so this causes a bit of a problem. Another response went into a detailed list of pros and cons about the platform but this is a major aspect of the core language that will always be lurking in the shadows waiting to cause problems for you.


9

It's popular and growing. If it failed, it's not like you wouldn't be able to re-use a bunch of your code elsewhere. It's not hard to port core node libraries to the client-side and other JS libraries. It took me about 10 minutes to rewrite their event system for use in browsers without losing any of the interface. If Node or JS declined in popularity, it's ...


8

Wikipedia might be a good place to start with some general concepts and basic information. This quote from that page sums it up but probably needs a bit of knowledge to fully understand it. In programming, asynchronous events are those occurring independently of the main program flow. Asynchronous actions are actions executed in a non-blocking scheme, ...


8

I've heard it's called NPM style "comma-first" rule. Example from the doc: var magicWords = [ "abracadabra" , "gesundheit" , "ventrilo" ] , spells = { "fireball" : function () { setOnFire() } , "water" : function () { putOut() } } , a = 1 , b = "abc" , etc , somethingElse ...


8

Well, I don't think that rewriting the application was a good idea unless it was performing poorly. To answer your questions: Node.js is not magic. Your application has huge amount of users, so there is no way to be certain that it will make it faster. Well, yes, Node.js does in fact consume fewer server resources. So not only can you save money on ...


8

There's no technical reason you couldn't do this. I did something very similar for a simple game I wrote to play with Node. The pages were served by Apache and written in PHP, but then I had an HTML5 canvas and I initialized a socket to my Node server. Both Apache and Node can run happily side by side on the same machine, just different ports.


8

Running several web server processes in parallel is not a problem at all, people do it all the time. However, since only one process can ever listen on any given port, they can't both run on port 80 directly, so you'll have to dispatch somehow. An easy solution is to run the Node.js application on a custom port (anything above 1024 should be fair game, but ...


7

If you and your team have good experience with PHP and it's simple enough to implement, I would stick with that. If the amount of traffic goes up and concurrency is an issue, then it might be worth getting to grips with node (plus it's always fun to learn a new language!!). The other benefit of node is; it's fast. But again in this scenario I can't imagine ...


7

In general, any function that does networking or uses timers to do things over a period of time will be asynchronous. If the function takes a callback, you can look at what the callback is used for and usually it will be obvious whether is is asynchronous or not. If the function does not offer a callback, then it has no way of communicating asynchronous ...


7

I've run into some difficulties thus far I'd like to document here. How do you handle reconnect logic? This is a hard problem and an especially hard problem in designing and implementing a message queue. Messages must be able to queue up somewhere when consumers are offline, so a simple pub-sub is not strong enough, and consumers need to reconnect in a ...



Only top voted, non community-wiki answers of a minimum length are eligible