Code Monkey home page Code Monkey logo

Comments (7)

DAddYE avatar DAddYE commented on May 26, 2024

Will be supported instead ternary operators? a = true ? 1 : 2

This?

a = 1 if b

from luna.

DAddYE avatar DAddYE commented on May 26, 2024

Instead this:

def add(a:int, b:int){ ret b }

will be permitted?

from luna.

DAddYE avatar DAddYE commented on May 26, 2024

Also I prefer generally a single choice so what about force brackets for single line and force end on multiline?

I've no problem with brackets or ends, I love brackets as said in single line scenario like: if (foo){} but like in ruby I hate it when:

def foo
   Thread.new {
      lamda do |a|
        do_some_with a
      end.call(1)
   }
end

When I see those thing I miss the Python :D

from luna.

tj avatar tj commented on May 26, 2024

yeah I also dont like multiple choices, I dont even want to facilitate it to be honest, it's like writing single-line CSS rules, it never makes sense. I would rather not support it at all and have people create similar code by design, I'd like to keep the grammar pretty simple, choices create contention

from luna.

DAddYE avatar DAddYE commented on May 26, 2024

In part I agree with you, but sometimes happen that we need code like:

def get(path); add_path(:get, path); end
def post(path); add_path(:post, path); end
def head(path); add_path(:head, path); end

Since we have patch, put, delete etc... I see the reason around here but really this shot my eyes :D

Instead I think a thing like:

def get(path)  { add_path(:get,  path) }
def post(path) { add_path(:post, path) }
def head(path) { add_path(:head, path) }

I even don't like it a lot but it's almost readable. No?

from luna.

tj avatar tj commented on May 26, 2024

but why bother, why not just:

def get(path)
  add_path('get', path)
end

and call it a day, no moving things around when you need to add something else in there etc, much like how I cringe when I see:

foo > bar { color: blue }

you're almost always going to knock that down and add something else in

from luna.

DAddYE avatar DAddYE commented on May 26, 2024

@visionmedia I 100% agree with you, you know that I like the good ************, but I hope, that they will use single line statements only when necessary.

Generally in CSS its common to have 1000+ lines and a few width, so I can (even if I don't like) the reason behind that.

I hope that's should never happen here or in 99.9% but when really really useful

from luna.

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.