Coming from Old School Python, here's my take on Meteor after 1 week

Hi folks, please tell me if I’m smoking funny bananas:

  1. Coding in ecmascript is painful. This syntax was invented in 1969, and Meteor is supposed to be a modern framework?
  2. But coding in coffee script and jade is great
  3. But wait, coffee script seems buggy in Meteor, right. Some weird stuff happens with no rhyme or reason
  4. OK, so how do Meteor programmers set breakpoints and step through server side code so I can learn how all this stuff works. Are there any nice tools, or is it mostly done with console.log

It sounds a bit negative, but really, Meteor is awesome… as long as I can convince myself that it’s not buggy, and that there are “Modern” tools, like the ones we had back in 2006

3 Likes

That couldn’t be farther from the truth - ES2015 came out… in 2015. JavaScript is much better than before.

Shouldn’t be the case! Any specific examples? As far as I know, many people are happily using CS with Meteor.

There’s Meteor shell and Meteor debug: http://docs.meteor.com/#/full/meteordebug http://docs.meteor.com/#/full/meteorshell

7 Likes

1969 is the year C was invented. The basic syntactical style of javascript is based on C, regardless of the version. To be more precise, the syntax is based on Java, with a bit of Perl and Smalltalk like influences thrown in here and there.

But coffee script does take that pain away. I will write a different post outlining some of the buggy behaviours I’ve encountered (only in server side coffee script)

Looks like JetBrains Webstorm can be used as an IDE for modern style debugging of server side node.js.

https://www.jetbrains.com/help/webstorm/2016.1/running-and-debugging-node-js.html

1 Like

to be honest C belongs to the family of ALGOL languages, whose syntax first appeared in 1958.

Yes coming from the DRY python javascript seems so verbose… erorr prone and pleonastic. I

t got MUCH better with ES2015, but still sucks. Anyhow JS is the de facto standard of the web, and Coffee is very nice but not updated much, so it lacks some power features of modern JS.

You gotta eat the sour taste of JS, but you will be better than the average JS dev, as you will always remember the sweet Python Land, and try to write code as expressive as possible.

1 Like

What exactly does “DRY” have to do with syntax?

Seriously, people, get over yourselves.

Also: Braces make parsing nested structures way easier than meaningful whitespaces.

So there. Shots fired.

8 Likes
  1. Yes… they forgot to take the best thing of Coffeescript, the clean syntax…
  2. Hell yeah, it sure is!
  3. Perhaps look into these Coffeescript gotchas: https://gist.github.com/liaody/1598046
  4. You can also use the browser debugger with the keyword ‘debugger’. https://developer.mozilla.org/en-US/docs/Tools/Debugger

Also: OP calls himself “oldschool”, complains about age of syntactic structures.

4 Likes

I’m definitely Old School, but it wasn’t meant to be a complaint, just a comment on the fact that coffee script is available and makes the job a lot more pleasant.

coffee script is nearly the exact same language as ecmascript from a conceptual point of view. It is still this object-oriented language with a touch of functional programming. The difference in practise is neglectable.

I also thought that coffeescript makes things easier, but i think this is no longer true in comparison with ES2015. I would recommend to use ES2015 as it is a standard. It is not the best language, but it gets the job done and supports many different paradigms.

By the way. Try a real functional programming language if you don’t want to feel oldschool anymore. That is a breeze of fresh air.

2 Likes

@hexatonic Don’t knock JS until you really try it. Here’s my story as a former Pythonista:

When I first picked up Python, I remember reading this post Python is Not Java in which the author complains about Java-developers abuse of the python language. Coming from Java/C# it took me a few years to really understand how to write “pythonic” code.

Similarly I can imagine a similar “ES is not Python” article. After five years of using JS => coffeescript => ES2015, I greatly prefer ES2015 to Python. Why? In addition to better tooling, documentation, package system, web development, etc., there are a bunch of code patterns – mostly around Javascript’s ease of creating multiline anonymous functions, something that’s not possible with python lambda – that make me prefer the JS language despite some of its other warts.

Quick examples to get concrete:

  • Jasmine scoping is really slick, and AFAIK impossible in python
  • Underscore based entirely on anonymous functions. Some of its features are language features in Python (e.g. zip), but even so I think they’re better in JS.

When I switched from Coffeescript to ES2015 I certainly missed indentation-based scoping. But the benefits outweighed the costs. Also semicolons are optional in JS, and removing them cleans up your code. At this point the only thing I miss from Python is the array slicing features, especially in numpy which AFAIK wouldn’t be possible in JS.

Hope that helps!

3 Likes

Tried it. Didn’t like it due to the ambiguities it creates. I rather have a bit more verbose style using brackets and braces and don’t have to think about which part is actually evaluated in which order.

Gonna put this out there: I love curly braces, having indentation-based syntax is strictly a minus for me. But I understand that people have different preferences and that’s great!

8 Likes

re: item 4-- check out Jetbrains Webstorm – an excellent IDE that has specific support for Meteor.

2 Likes

Agreed, can’t stand all that whitespace…love { }

1 Like

Point well taken. In that case, we all win, because you can do either/or in Meteor…or mix styles together in a single file.

I sometimes program in Haskell, but that’s REALLY old school. Lambda calculus, which functional programming is based on, is from the 1930s ! :slight_smile:

Truthfully, I need to learn more about ES2015 before I bash it. Thanks for the great feedback. :thumbsup:

2 Likes

How do people even find meteor forums before framework documentation.
I only managed to join about 5 mounths after first development attempts :blowfish:

1 Like

I understand your concerns as I, myself, came to JavaScript from Python. I don’t do a lot of Meteor (although I really like it), I actually do Angular stuff for a living. At the beginning, I struggled a lot to grasp the so called Good Parts of the language, and discovered the Bad Parts along the way; but that wasn’t the truth about JavaScript, there is no “Good Parts” nor “Bad Parts”, the language is just misunderstood.

When I read Kyle Simpson’s “You Don’t Know JavaScript” series, I was like illuminated, the language actually has really solid foundations and I encourage you to give raw JavaScript a shot. It’s like love and marriage, TRUE love comes after years of marriage not before it.

Welcome aboard :slight_smile:

3 Likes

How coffescript syntax is nice? It’s a mess. Really hard to read. Javascript extra syntax makes everything readable in a glance.

I liked working with jade but as soon as the files getting bigger its also a mess.

Extra spaces breaks the whole thing, finding what wraps what also hard.

He said it’s nice because it resembles Python’s syntax. You have to come from Python to appreciate it :slight_smile: