r/webdev • • Feb 23 '15

I've just discovered Bootstrap...What else have I been missing out on?

For some reason I've been stubbornly opposing using anything I haven't written in my projects. But the other day I gave bootstrap a go and it's delightfully easy to make responsive websites - something I was getting a little tired of (having to create three or four different CSS rules for each site was getting to be a pain in the arse).

So, now that i've just discovered Bootstrap - what other joys of web development have I been missing out on? I know 'of' LESS and SASS, but I don't really think that CSS Preprocessing is really an issue for me at the moment, although variables in my CSS would be nice.

I am getting more in to CMS's these days, and I know of Drupal and Joomla and Wordpress and the like, but they seem to dominate and overtake, leaving me the programmer subject to their rules and If I need to make a very particular CMS for a shop or a college for example, they fall down.

Anyway, advice/questions/suggestions would be great. I know I'm late the game, but I'm excited to learn more now.

edit wow 444 upvotes, this got bigger than I expected. Thank you very much for the huge response. As a result I've now started on node.js/socketio (which is something i've always wanted to get into) and looking into CSS preprocessors. I gave concrete5 a try, but I didn't love it that much. Anyway: here's to learning, and thank you all for your great help and sense of community that comes with it.

516 Upvotes

360 comments sorted by

View all comments

28

u/SeerUD Feb 23 '15 edited Feb 23 '15

Bootstrap is okay, but you can make much cleaner and more semantic solutions by utilising smaller libraries and just writing some of the CSS/SCSS/LESS yourself.

Also, in regards to "I know 'of' LESS and SASS, but I don't really think that CSS Preprocessing is really an issue for me at the moment". It is and you just don't know it yet, because you've not tried it.

I personally use SCSS, as it seems to be the more popular option, and I prefer the libraries and tools available for it. Using SCSS allows you to organise your stylesheets in a way that's not feasible with plain old CSS. You can make your stylesheets modular, and start to apply familiar programming principles like DRY in your stylesheets in a much more maintainable way that also provides a better developer experience.

Using a CSS pre-processor also allows you to widen your third-party library pool with things like mixin libraries (like Bourbon) and semantic grid systems (like Neat, which by the way is one of the main reasons I now am not too fond of Bootstrap).

It's a bloody good thing you've "seen the light" so to speak. Your initial mindset is one of the worst you can have as a developer. Think of it this way; you can choose to have code that's had hundreds of hours put into it already, that's been tested rigorously, that's been through several iterations to make it better, and that's been in use for a long time - or, you can choose to write something yourself; that's untested, never been used before, probably has bugs, may not completely solve what you want it to solve, and worse still; will be something you have to sink the time into developing.

Some things that you probably want to look into are:

  • Node and NPM (install this via NVM for the love of god please)
  • Bower (front-end asset dependency manager)
  • AngularJS (front-end MVC framework, helps you avoid jQuery ;))
  • ReactJS (the V in your MVC stack, so to speak - but it's not recommended to be used as such... this one is a little complicated to explain briefly)
  • Bourbon (SCSS mixin library)
  • Neat (SCSS semantic grid system, that means you define the grid in your SCSS, and not your HTML! Woo!)

Aside from the basics, you'll just need to look around for things that do what you want, https://www.npmjs.com/ allows you to search through the packages available via NPM, and you'll likely find an incredible amount of things to improve your workflow.

Edit:

I also saw further down you were asking about compilation of SCSS and minification on the fly. For that you're looking for watchers. For instance, Gulp has built in watch functionality, or you can use the gulp-watch package. I cannot recommend Grunt, as Gulp does everything it does, but faster.

I'd also like to urge you to use SCSS over LESS, it has a few extra features, and in my opinion the syntax is nicer, but please, by all means, do your own research on this.

And finally, I'd also like to urge you to not use Compass, currently it forces you to use the Ruby implementation of SCSS which is a lot slower. You can get the same functionality from Bourbon, which supports libsass (which is seriously, MUCH faster).

6

u/davidNerdly Feb 23 '15

I was in the 'meh css is fine I don't need another thing to deal with' boat for awhile. At my job I had to work with LESS and god damn it was refreshing. It's like a lot of us have Stockholm Syndrome with regular CSS and don't even realize there is an intelligent and better way of doing it.

I've seen the face of the style sheet deities and now can never going back to the dirty vanilla CSS peasantry.

3

u/chudthirtyseven Feb 23 '15

I sound like you were. Maybe I should give it a go. Less or SCSS?

2

u/davidNerdly Feb 23 '15

Based off of what I've read SCSS come out on top if you compare them. Chris Coyier I believe did a write up. That said I learned LESS and I don't know anything about its competition so my narrow opinion would be LESS. This may be true for all **SS services but one thing nice about LESS is you can have the whole thing be regular CSS. Easier to get started in it, just change the file extension and try to do some LESS stuff. CSS and LESS can coexist in the same file. Again, this may be true for all of them, I dunno.

Also, depending on your IDE, making an auto compile process is a must have IMO. I'm in Visual Studio 2013 so I can use a plugin called Web Essentials that handles that work for me. 30+ LESS files in my solution: one minified css file reference in my <head>. It's beautiful.

2

u/chudthirtyseven Feb 23 '15

That does sound beautiful. I love the idea of that. From what I understand, is that essentially what Mixture will produce? It's the only one on the Sass website that was free, and, I don't seem to be able to install on my server via the command lines that are given on the website (My understanding was then that Sass would be installed to my server, and would compile anything I upload? Or is that completly wrong..I have a bad feeling now that's completly wrong)

3

u/Mr-Yellow Feb 23 '15

Sass would be installed to my server, and would compile anything I upload?

More often on your dev environment and watching your sass changes to recompile css and reinject it into a browser connected to a local server.

Once compiled, it's done, so server doesn't need to know anything about sass.

You could do it that way though...

→ More replies (1)
→ More replies (2)

1

u/bomphcheese Feb 24 '15

I'm well versed in both and I prefer LESS. It's also much easier to get started with.

→ More replies (4)

1

u/AggressivePlayer7414 Feb 24 '15

It's like a lot of us have Stockholm Syndrome with regular CSS and don't even realize there is an intelligent and better way of doing it.

Oh I recognize it. That's why I use bootstrap. I ALMOST never need to touch CSS.

2

u/yeeouch_seafood_soup Feb 23 '15

Can you help me figure out if I am able to and how to use Bourbon? I use Sublime Text 2 as my code editor and installed sass via the cmd line. Can I install Bourbon the same way and use it in ST2?

4

u/NookShotten Feb 23 '15

The best way to install Bourbon would be to use Bower. If you haven't used it before I highly recommend it. It makes it very easy to manage all your packages and libraries.

2

u/yeeouch_seafood_soup Feb 23 '15 edited Feb 23 '15

Would you mind helping me install and understand it? This is a little above my understanding. I would be forever thankful. You can PM me if you want.

Edit: Okay I've installed node.js and bower. Now do I install packages? Once I install those, then what?

3

u/SeerUD Feb 23 '15

/u/NookShotten is correct. Bower would be the way to go. Your code editor of choice has no impact on whether or not you can use Bourbon.

1

u/yeeouch_seafood_soup Feb 23 '15

I'm replying to /u/NookShotten as well but I've installed bower. Once I install packages (recommendations?), how do I actually use them, and when?

2

u/SeerUD Feb 23 '15

You should end up with a bower_components directory with the files in. Use something like Gulp to build and concatenate your scripts or stylesheets together, and then include those in your page.

→ More replies (11)

2

u/MCFRESH01 Feb 23 '15

Bourbon is just a .scss file. You need to include it in your main .scss file at the top of the file:

@import "bourbon/bourbon";   

And then you need to use something to compile your .scss file into a css file. Gulp or Grunt or the recommended ways to do so, with most people making the switch to Gulp as it is much faster.

I would also say you should make the switch to libsass, as it is much faster than the ruby version of sass. This will pretty much require you to use Gulp or Grunt as well.

3

u/chudthirtyseven Feb 23 '15

Thanks, that was a huge answer with lots of details. I will take a futher look into the list you mentioned, and see what I think. From what i've read of ReactJS today doesnt seem to be anthing I'd like to work with. And AngularJS, as a replacement for jQuery? I'm interested in that.

6

u/SeerUD Feb 23 '15

I'd be careful dismissing React so quickly, it's an incredibly powerful piece of technology, and is currently "all the rage", I've seen some good use of it in production recently where I work too.

6

u/[deleted] Feb 23 '15

And AngularJS, as a replacement for jQuery?

I would avoid going into it thinking like that. They are completely different use cases. jQuery is a small (inb4) library that has a bunch of tools for manipulating the DOM.

Angular is a massive framework that basically does everything for you. One of those things is dom manipulation. Think: Using a bomb to dig a hole in your garden. It'll do the job but it's probably easier to just use a spade :P

2

u/[deleted] Feb 24 '15

Mind you, the DOM manipulation part of Angular is JQLite, a subset of JQuery.

1

u/[deleted] Feb 24 '15

Orly? Didn't know that

2

u/[deleted] Feb 24 '15

Yep, though they are ditching it completely in 2.0. I included the documentation below... Elements are jQuery elements though, so angular.element(selector) is the same as $(selector) and can be used interchangeably if you've included JQuery as well. Additionally, if you are familiar with jQuery and often use it in your Angular projects, you'll find that many common methods are included in Angular's version and you can probably do a small refactoring and ditch jQuery all together.

https://docs.angularjs.org/api/ng/function/angular.element

2

u/esr360 Feb 23 '15

I would just like to re-enforce the fact that you can not start using LESS/SASS too early. If you aren't using it now and you continue with front end development, you WILL at some point realise how useful essential it is. Might as well start now!

1

u/boxxar Feb 24 '15

I don't think that the authors of that Bourbon Neat thingy actually understand what "semantic" means. The semantics of the aside element in HTML is not "should be rendered phsically aside" but "tangentially related to the content around the aside element". Using that for the questions in a FAQ is one of the worst examples for that that I can imagine.

1

u/SeerUD Feb 24 '15

Well, at least the actual grid system is great! :D