As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was wondering if it is possible to use the WebSharper compiler to write Node.js applications in F#. Are there any resources available that could show me how to do this? Are there any good reasons not to try to do this?
[I would post this as a comment, but it got a bit too long...]
Here is another good reason not to do it - F# agents and asynchronous workflows provide a concurrent programming model that is in many aspects much better than what Node.js provides. For example:
it gives you both concurrency and also true parallelism so you can write code that does not block the system when it needs to do some work using the CPU
asynchronous workflows provide easy way to handle exceptions and handle resources
(you can use try .. with in asynchronous (or event-based) code)
the agent-based programming model gives you a great way to store state
If you can use F# to write your server-side application, then you can as well us the powerful abstractions it providers. See Server-Side Functional Programming for a brief introduction. I also did a talk F# on the server-side which has been recorded and discusses the same topic.
This is not necessarily a reason why not to try this. Trying this might be fun and if you like F# language, but want to use in Node.js environment, then it would be very useful to have this.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm writing a new web application, I haven't got problem with backend part (it's my job until 6years) but i'm little new with frontend development (around 1 year). What's the best way to manage your JS code?
At this time I use a single file (app.js) where i call many function like this:
writer.init();
other.init();
writer and other are functions like this
function () {
var writer = {
"init": function() {
// do something
}
}
}()
I think it's an ugly way. What are the best practices?
I'd recommend using a JavaScript framework that enforces some structure, like using directives with AngularjS. If you want to do it all yourself, this chapter of Eloquent JavaScript is a good read.
The Asynchronous Module Definition (AMD) provides a very nice way of organizing code in modules. It is especially aimed for client-side Javascript code. There are various implementations but I would recommend having a look at RequireJS.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm a web apps developer, I use for most apps PHP/MySQL with APC enabled, caching technologies: Memcached is my favorite one. Sometimes I use Percona MySQL version.
I'm new to NodeJS and I want to build my own web app using it. It's a SaaS working with Facebook, Twitter and Instagram APIs. I read a lot of good things about it.
What I need to know about Asynchronous JS Programming before starting the app?
Is there any performance advantages for Asynchronous Programming?
Is there any live examples, graphs with the difference between Async/Sync?
It doesn't block.
Let's compare with PHP:
<?
readfile('some/large/file.bin');
?>
This might take a while. And while PHP reads the file, it won't be able to do other stuff (like answering other requests).
The same thing asynchonously (using node.js):
fs.readFile('/some/large/file.bin', function callback);
Node does the reading without blocking the current process.
So in conclusion: while the synchronous way blocks the process until the result is available, the asynchronous method has the advantage of doing other stuff, even before the readFile callback got fired.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm a programming "enthusiast", not a pro, and I'm looking for an easy graphical programming environment (for desktop, on the Mac and iOS) similar to RealBasic or RunRev Livecode.
However, because my available time is limited, I'd rather spend it into something that uses a more ubiquitous language like Javascript/Html5 (so I can transfer this knowledge into other areas like web programming) rather than an idiosyncratic language like the one used by Livecode or RealBasic (which cannot be used outside of that specific programming environment).
I've looked into Appcelerator Titanium (which uses Javascript/HTML/CSS), but it doesn't seem to have an easy GUI development interface.
Any suggestions ?
Thanks.
Wakanda is likely the closest I've seen as well.
My experience on a Mac is that it isn't terribly stable. Not sure if that is just my env or if it's because it's still relatively new. I like, and am very impressed with what they are doing, but just not sure I can trust it yet for production level stuff.
Realsoftware has an awful lot of perks. I'm still exploring it but looks like it maybe what I'll use. It would be an easy decision if it was JS/HTML5! It's all compiled and server side tho - as I understand it.
EDIT:
Have a good look at Wakanda's NoSQL data capabilities. They are nothing short of amazing and very well thought out. Four types, storage, calculated, relational and alias. There's a good overview YouTube vid at https://vimeo.com/31837379
Have a look to the new Javascript Stack : Wakanda
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to learn Node.js. I'm sure, I will need good experience in Javascript (OOP). Is there any other technology i should know about to learn it? And also how long will it take me to starting implementing node.js taking into account i have decent experience in Javascript?
Thank You
http://www.crockford.com/javascript/inheritance.html
JavaScript is a class-free, object-oriented language, and as such, it
uses prototypal inheritance instead of classical inheritance. This can
be puzzling to programmers trained in conventional object-oriented
languages like C++ and Java. JavaScript's prototypal inheritance has
more expressive power than classical inheritance, as we will see
presently.
Javascript and Java are two different beasts.
I have been writing JavaScript for 8 years now, and I have never once
found need to use an uber function. The super idea is fairly important
in the classical pattern, but it appears to be unnecessary in the
prototypal and functional patterns. I now see my early attempts to
support the classical model in JavaScript as a mistake.
Some things I think you should look into.
Testing your code thoroughly with framework like for example mocha is very important.
learn npm to publish your own modules and to search for other modules.
A database like for example mysql, mongodb or redis and how to use them in node.js. I pesonally really like redis client library for it's insane speed.
Git(hub) to put your code into a repository(SCM).
Except from all kind of JavaScript programming experiences (OOP is not required) and depending from your former programming skills it also helpful to have a basic knowledge of:
the Posix API (what are file descriptors? what are pipes?)
what is HTTP? How does HTTP work?
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
i don't understand the meaning of the word library -
regarding to jQuery: will it be right to say that "library" is a huge file with many plug ins that are ready to use?
jQuery is a fast and concise JavaScript Library that simplifies HTML
document traversing, event handling, animating, and Ajax interactions
for rapid web development. jQuery is designed to change the way that
you write JavaScript.
All this means is that jQuery itself does not do anything. A library is "a collection of resources used to develop software". jQuery allows you to write cross-browser JavaScript a heck of a lot easier than it would be without it.
A library is something that extends a base langage. So in this definition jQuery is a library
A small(not huge!!!) file (32K only)... With many many functions and features.
Libraries contain code and data that provide services to independent programs. This encourages the sharing and changing of code and data in a modular fashion, and eases the distribution of the code and data.
Wikipedia