CodeCumbria / codecumbria.github.io

The Code Cumbria website
https://codecumbria.org
MIT License
1 stars 2 forks source link

CoffeeScript #6

Closed alyssais closed 10 years ago

alyssais commented 11 years ago

I used CoffeeScript when I was adding some JS to the site, but I'm thinking it might be a bit of a barrier to entry for people. Since we only have one line at the moment, I'd be happy to use standard JavaScript instead if it would help people contribute.

Any thoughts?

groks commented 11 years ago

Sounds like a good idea.

Also, SCSS. I think it's fine to use that, but it could do with a Makefile or something so that all someone else has to do is type 'make' and the css gets rebuilt.

alyssais commented 11 years ago

I've removed CoffeeScript with the latest commit. Would you be able to deal with the Makefile? I've never done that before.

groks commented 11 years ago

What commands are you running to generate the other assets (css, min.js etc.)?

alyssais commented 11 years ago

I'm actually not (I'm using CodeKit). I could probably work out the commands, though.

groks commented 11 years ago

Could use Less (http://lesscss.org/) instead of SASS, in client mode. I don't think performance matters, for this site.

alyssais commented 11 years ago

These are the commands I would use.

if [ -a js/scripts.js ]; then
  uglifyjs js/scripts.js -o js/scripts.min.js --compress --mangle
fi

if [ -a scss/style.scss ]; then
  compass compile . scss/style.scss
fi
alyssais commented 11 years ago

What would the motivation be for us using Less?

groks commented 11 years ago

Because Less can be run in client-side mode (because the compiler is written in javascript) - therefore: no one needs to remember to compile before pushing.

I guess it depends on how many features of compass are being used.

alyssais commented 11 years ago

I'd prefer to keep using Sass. There's no equivalent of @extend in Less as far as I know, and it's used pretty extensively.

groks commented 11 years ago

Apparently, Less does support extend: http://stackoverflow.com/questions/15464982/does-less-have-an-extend-feature.

It doesn't matter to me either way, use whichever you prefer. I just wanted to point out that there might be a way to avoid relying on external tools for css, while you brought up javascript.

Maybe a small note in the README about how to generate the css would cover things.

alyssais commented 11 years ago

That would be better. My point wasn't that a reliance on external tools was a bad thing, it was the fact that CoffeeScript isn't that well known, whereas SCSS is.

schwuk commented 11 years ago

I'm a big fan of CoffeeScript and Less (especially as they can be used directly in the browser without a build process, but I wouldn't use that feature in production), but I'd argue against using CoffeeScript or Sass in this case - the site is nowhere near complex enough to require a complex build process, and reliance on CodeKit (although a nice tool in itself) is a barrier to entry for non-Mac people.

alyssais commented 11 years ago

There is no reliance on CodeKit. See the commands I posted earlier.

schwuk commented 11 years ago

...but until you posted the commands, there was :-) (unless the developer was already familiar with CoffeeScript and Sass).

alyssais commented 11 years ago

As of a few commits ago JavaScript is actually no longer needed, so I just went ahead and stripped it out completely.

schwuk commented 10 years ago

Closing as there's currently no custom JavaScript (or CoffeeScript) in the site.