mirror of
https://github.com/nicolabs/nicolabs.net.git
synced 2025-09-07 16:27:21 +02:00
+ sass article
+ python vs shell article
This commit is contained in:
parent
7a1e4c93c4
commit
f9cb8949e9
34
_posts/2015-03-28-Sass-is-a-CSS-compiler.md
Normal file
34
_posts/2015-03-28-Sass-is-a-CSS-compiler.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
layout: post
|
||||
date: 2015-03-28 17:18:57 +0100
|
||||
title: Sass is a CSS compiler
|
||||
tags: web2.0 css media queries sass style web design
|
||||
---
|
||||

|
||||
|
||||
A year ago I was very excited to get my hands at _Sass_.
|
||||
|
||||
I thought it could fill the gaps in coding with CSS : preventing variables duplications, automatic generation of multiple static stylesheets depending on the rendering device (vs using media queries which are not always supported and require downloading all versions of the code). Tools we have in other languages and layers.
|
||||
|
||||
But it could not.
|
||||
|
||||
## What really is Saas
|
||||
|
||||
[Sass-lang.com](http://sass-lang.com/) states it is a "CSS extension language", but don't take it literaly or you will head straight for failure.
|
||||
|
||||
That would imply that CSS is a source language and Sass adds instructions to it ; however it's not right because web browsers today only understand CSS, not Sass.
|
||||
|
||||
Sass is nothing but dynamic : it's a pre-processor that may only really be used to produce different versions of a CSS with different sizes, colors and layouts, but it's not able to make your CSS dynamic. It's just several static versions of CSS that you must still dynamically load using an external mechanism (like static media queries or Javascript).
|
||||
|
||||
I fell into this trap as I tried to organize stylesheets with inheritance like in **o**bject **o**riented languages (_OO_) : this structure would always failed at a given point.
|
||||
|
||||
For instance : as variables only live in the sass context, and disappear in the compiled CSS, if you want to make two versions of a stylesheet with different variables, you have only one option : build use those variables in all places in the resulting static CSS. You cannot include variables in media queries as it cannot only contain CSS code : they must be in an "interpreted" form.
|
||||
|
||||
## Conclusion
|
||||
|
||||
Make no mistake : Sass is a very helpful evolution for CSS, **use it**, but **know its limits** !
|
||||
|
||||
## References
|
||||
|
||||
- [designshack.net/articles/css/sass-and-media-queries-what-you-can-and-cant-do](http://designshack.net/articles/css/sass-and-media-queries-what-you-can-and-cant-do/)
|
||||
- [thesassway.com/intermediate/responsive-web-design-part-2](http://www.thesassway.com/intermediate/responsive-web-design-part-2)
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
layout: post
|
||||
title: "Python versus Shell scripting : from experience"
|
||||
date: 2015-11-08 14:24:13 +0100
|
||||
permalink: articles/python-versus-shell-scripting-experience
|
||||
tags: python scripting shell
|
||||
---
|
||||

|
||||
|
||||
A quick "pros & cons" to choose between Python or Shell scripting, from what I've observed through the years.
|
||||
|
||||
This could probably apply to [other high level script languages][1] vs shell.
|
||||
|
||||
[1]: # "Like Ruby, but not like Perl, as it shares more with shells from my point of view, like unreadable syntax and execution speed."
|
||||
|
||||
## Choose Python for :
|
||||
|
||||
- **its simple syntax** : can be read even by non Python-speaking people. End users may not be scared to change scripts to fit their need.
|
||||
- **portability** : Python is actually more portable than shell because of ease of installation for any OS. Shell is theoretically portable but it's complicated to explain end users how to install the runtime (e.g. see cygwin). A Python script can be packaged into an executable program. There may be ways to bundle a script with the shell runtime.
|
||||
|
||||
## Choose Shell for :
|
||||
|
||||
- **speed** : except in case of bad code logic, shell scripts are usually a lot faster than Python's equivalents.
|
||||
- **its ease to deal with external programs and system** : shell's syntax is already made to test/pipe/chain easily existing programs, whereas Python requires some extra boilerplate. Shell also has built-in functions to deal directly with files and the system, whereas Python uses an object-oriented model, which may not be as handy.
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
layout: post
|
||||
title: Migrating from Drupal to Jekyll
|
||||
tags: drupal jekyll github blogging
|
||||
---
|
||||
|
||||
|
|
BIN
assets/blog/Selection_008.png
Normal file
BIN
assets/blog/Selection_008.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 372 KiB |
BIN
assets/blog/sass-color-1c4aab2b.png
Normal file
BIN
assets/blog/sass-color-1c4aab2b.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Loading…
Reference in a new issue