My First BrightCode Class

Elisheva Elbaz
2 min readDec 7, 2020
brightcode.dev

I recently joined a class at BrightCode called Programming in an Enterprise Environment. It’s geared towards those with 3–18 months of programming experience. The purpose is to get some experience working on an existing project and adding features or changing layouts. Most developers learn to code by creating their own projects, but in a job as a developer, we will most likely be adding to an existing codebase.

As stated on the BrightCode website:

the class emphasizes best practices in developing readable and maintainable code.

Some of the things that I have learned so far include using SCSS.

In SCSS you can add variables and mixins in the CSS to create reusable and clear code. For example, we are working on making a site mobile and tablet friendly.

By using variables for the breakpoints, we can be sure that we are using the same breakpoints everywhere without needing to remember the exact number of pixels. Additionally, if we later decide to change the value of the breakpoint, we can just change it in the place where the variable is defined and it will change everywhere. We don’t need to worry that we missed updating any of the many places it is used. (This is just like the variables that we are used to in JavaScript or Ruby that we use instead of hardcoding values.)

The Sass website explains that using variables allows developers to

reduce repetition, do complex math, configure libraries, and much more.

The way we declare variables in SCSS is by using the format <variable>: <expression>, which looks similar to a CSS property declaration.

For example:

$tablet: 768px;

To use the variables in another SCSS file, we use the@import keyword, along with the file path, at the top of the page.

@import ‘../../styles/utils/breakpoints’;

Anywhere that we want to use the breakpoint for tablets (768px), we just need to include the variable, $tablet, as a value.

@media only screen and (max-width: $tablet){
display:block;
margin-left: auto;
margin-right: auto;
}

I’ve only attended one class so far, but I am looking forward to continuing the course. Be sure to check back next week as I continue to share my experience.

--

--