Giter VIP home page Giter VIP logo

Comments (3)

BYVoid avatar BYVoid commented on August 16, 2024

Hi,

Thank you for contributing continuation.js. The style you have given in the example is another style, which is used by streamline.js or wind.js. It is definitely possible to implement, but I personally do not prefer it, because it is hard to support multiple return values. It is a convention that the first parameter of the callback function is the error object, therefore I implemented both cont and obtain. If the callback function has more than 2 parameters, for example:

var request = require('request');
request('http://www.google.com', function (err, response, body) {

})

How do you handle the return values using a function return value? You can wrap them into an array, but it will make your code even uglier.

from continuation.

eurekaa avatar eurekaa commented on August 16, 2024

Yes, i perfectly understand your point of view.
But programmers are addicted to left assignment passing style and there are few cases in which a function need to return multiple values. The error and a single value are sufficient in my opinion, you can also return a object with multiple keys and that is solved.

I really love your work, i was searching for a compiler which was usable both on client and server side and yours is the only one i found really good (i loved the sintax of streamline but it doesn't work well on the browser side).

The only thing is that it is really difficult to me to read right assignment style (also my ide marks passed values as errors and, you know, it is quite ugly to see a code with lots of non-errors, etc..).

I was very interested in your project so i forked it to https://github.com/eurekaa/continuum.js
and did some changes (add async stuff, new compilers (less, jade, ..) and start to try to change left into right assignment style but i don't know so much about transformation so i'd like to ask you if you'd like to help me (in need some suggestions to start).

Maybe it would be nice to add left assignment style to continuous in order to have both.
What do you think about?

from continuation.

BYVoid avatar BYVoid commented on August 16, 2024

Yes you can do that. Please tell me if you have any problem.

from continuation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.