9

I hate javascript and all the shitty frameworks it has.

Background: I'm coming from Ruby on Rails world. Ruby is a nice short language built primarily for developer's happiness.

I recently started working on a meteor.js project. Oh boy that framework is terrible. Do I even have to start from all the dependencies failing to install because npm is shit, installs everything locally and only recently discovered lock files?
Fetching a post and its author from the database looks like a fucking space rocket compared to Rails' ActiveRecord fetching.

Meteor.js fetching:
```
Meteor.publishComposite('posts.all', {
find() {
return Posts.find(); },
children: [{
find(post) {
return Users.find({ _id: post.authorId });
}
}]
});
```

Rails ActiveRecord fetching:
```
Post.includes(:authors)
```

Sure, you might get more benefits like meteor uses websockets and it's all a single language, but that piece of the code above that I have to deal with all the time now...it gives me cancer.

Comments
  • 1
    Wasn't rails a framework to simplify Ruby? Legit asking because I don't know.
  • 0
    @projektaquarius rails adds a lot of extensions directly to ruby language. Some things it adds are not even possible in javascript. Like the "try" method.

    I'm dealing with this kind of code in React all the time:
    ```
    if (user && user.profile && user.profile.subscriptions) {
    ```

    In rails:
    ```
    if user.try(:profile).try(:subscriptions)
    ```

    Rails here extends nil (null) since in Ruby everything is an object, and so is nil. It returns nil if can't call a method, otherwise calls the method. In Javascript, null is a primitive, but when you do "typeof null" you get "object"! PS "typeof [ ]" is also "object"...
  • 2
    Meteor is awesome! Create multi platform apps. Publish and subscribe is the best for sending exactly those models I need on client. Websockets for real time update on certain changes you control very easily. Optimized client db cache. Basically stuff you need to implement anyway. Awesome community.
  • 0
    @devPlant hey, try() looks pretty useful actually. Why isnt this in vanillajs? It's literally one line of code.
  • 0
    @gratzl because one guy wrote vanilla js in about a week (which is a statue worthy thing, but a wrong foundation for any serious programming language), and ruby is made for developer's pleasure. Ruby is so powerful that you can create your own language with it. In fact many gems do exactly that - create their own DSL (Domain Specific Language)
Add Comment