On Apr 8, 2020, at 7:42 AM, Alexander <mycroft1891@gmail.com> wrote:
Following Uncle Bob’s - Clean Code advice that programming languages are just tools. I would go with JavaScript for 4 main reasons:
1. There is no need to add extra overhead to make javascript work in the browser.
2. Testing and debugging will be easier.
3. Freedom from dependencies. Making Ruby work in the browser might be possible but will come with new dependencies which I would have to manage. Furthermore, the dependency my project relies on could be outdated/malfunctioning and then I would be debugging 2 or more programs to make it all work.
4. Javascript is pretty easy to pick up.
PS: As a hobby project this could be an interesting and fun endeavor.
On Wed, Apr 8, 2020 at 04:47 Philip Rhoades <phil@pricom.com.au <mailto:phil@pricom.com.au>> wrote:
Jack and Walter,
Thanks for those clarifications!
Phil.
On 2020-04-08 12:02, Jack Royal-Gordon wrote:
> I think that the most successful attempt to put Ruby on the client
> side so far might be the Opal project. I haven’t actually used it,
> but my understanding is that basically, you write client side code in
> Ruby using it’s basic syntax plus the Opal libraries, and that code
> gets compiled into Javascript. I think this means that in your browser
> you’ll still have to deal with JS in your debugging. You can find
> Opal here: GitHub - opal/opal: Ruby ♥︎ JavaScript.
>
> From my reading of this and some other Opal articles, I would say that
> if you want something quick and dirty Opal might be fine but for an
> enterprise-level project, you should probably still use JS on the
> client side (I’m open to counter-arguments, this is just based on
> what I’ve seen and my experience with browsers).
>
> Now that’s for client-side apps that have server components. Browser
> extensions are a whole other animal, and as I’m maintaining one now
> I can speak to that with a little more authority. The key to
> accomplishing tasks in a browser extension is the use of Promises (a
> relatively new JS concept that essentially replaces callbacks). I
> didn’t see anything in my quick review of Opal that implied that
> they had anything analogous to Promises (again, please correct me if
> I’m wrong), so that presents a significant issue. To me, that means
> there’s no way you’re going to write a browser extension that does
> anything interesting in Opal. Further, I’m not aware of any way to
> tell the browser that the primary code of the extension is anything
> other than JS.
>
> I love Ruby and Ruby on Rails, but honestly a programmer should use
> the best language for the task and, given the current state of
> browsers (i.e. they all support client-side JS code, but support for
> other languages is either interpreted in JS or is not cross-platform),
> Javascript is it for browser extensions.
>
>> On Apr 7, 2020, at 6:17 PM, Philip Rhoades <phil@pricom.com.au <mailto:phil@pricom.com.au>> > >> wrote:
>>
>> People,
>>
>> I found this:
>>
>> "Javascript - Possible to develop google chrome extension with Ruby
>> on Rails?"
>>
>>
> javascript - Possible to develop google chrome extension with Ruby on Rails? - Stack Overflow
>>
>> - where, basically, they say it is not possible to develop
>> client-side apps in Ruby - but is this really true? - I am not
>> interested in the server side stuff FTTB . .
>>
>> In a recent post here:
>>
>> "What takes a month to write in Ruby takes a year in Javascript, and
>> the Ruby code will be more maintainable. And the javascript will
>> have far more security vulnerabilities and be far more of a pain to
>> manage."
>>
>> - I accept that there might be some exaggeration there but that, as
>> a generalisation, it is probably true . . which is another reason I
>> would like to stick with Ruby instead of having to learn JS as well
>> . .
>>
>> Comments?
>>
>> Thanks,
>>
>> Phil.
>> --
>> Philip Rhoades
>>
>> PO Box 896
>> Cowra NSW 2794
>> Australia
>> E-mail: phil@pricom.com.au <mailto:phil@pricom.com.au>
>>
>> Unsubscribe:
>> <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
--
Philip Rhoades
PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au <mailto:phil@pricom.com.au>
Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>