Man, JavaScript just feels so random where it needs ;
In strict mode, a semi-colon is used after expressions, or more simply any statement that is not a loop or function declaration (not to be confused with function expressions).
Man, JavaScript just feels so random where it needs ;
JavaScript is quite "random" compared to traditional languages. That's a charming thing on one hand, mind-boggling on the other!Man, JavaScript just feels so random where it needs ;
It's not random, it doesn't need them anywhere (Edit: if we are talking about end-of-statement. For loops need two semicolons). Semicolons in JavaScript are completely optional.
However, you should use them everywhere because not using semicolons is just terrible.
ESLints "semi"-rule is your friend: http://eslint.org/docs/rules/semi
The fuck. I did not know that. Thanks Treehouse and Duckett. Okay, so here is where I'm at.
Using semicolons = sometimes causes errors. If you put one where it shouldn't be, the JS just does nothing.
Not using semicolons = Party all the time.
Why would I used semicolons, then?
return {
foo : bar
}
return
{
foo : bar
}
Because it prevents a couple of situations where it's ambiguous.
Code:return { foo : bar } return { foo : bar }
Do different things.
Awesome. I hate everything at the moment. Okay, so how would you use semi-colons there?
return {
foo : bar
};
return;
{
foo : bar
}
<table>
<tr>
<td>Data</td>
<td>Data 2</td>
<td>Data 3</td>
</tr>
</table>
<div class="row">
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
<div class="col-md-1">.col-md-1</div>
</div>
<html>
<head>
<style>
.flex-container {
display: -webkit-flex;
display: flex;
width: 400px;
height: 250px;
background-color: lightgrey;
}
.flex-item {
background-color: cornflowerblue;
width: 100px;
height: 100px;
margin: 10px;
}
</style>
</head>
<body>
<div class="flex-container">
<div class="flex-item">flex item 1</div>
<div class="flex-item">flex item 2</div>
<div class="flex-item">flex item 3</div>
</div>
</body>
</html>
<div class="row">
<div class="col-md-1"><button class="btn"><img src="image.here"><p>.col-md-1</p></button></div>
<div class="col-md-1"><button class="btn"><img src="image.here"><p>.col-md-1 #2</p></button></div>
<div class="col-md-1"><button class="btn"><img src="image.here"><p>.col-md-1 #3</p></button></div>
</div>
What's the difference between:
Bootstrap and Flexbox both would be responsive and "newer" than old-school tables. So they'd move the datacells around (good), but at the same time they both seem like a pain in the ass to set-up.
Bootstrap, for instance won't do:
As a valid three "grid" table and puts them under each other even if the image would fit the desktop size.
I don't think Flexbox would solve this issue either?
Are you actually making a table here? Tables are semantic to table data so if that's the case use a table. Not sure what your responsive requirements are but it's likely flexbox will do it.
I'm trying to make a "table" of three by three columns and rows to have buttons that go to project pages on. Flexbox seems like it'd do it, but it seems like it'd be a hassle when the example I'm trying to copy uses Bootstrap but Bootstrap seems to have the projects "pad" out too much for my taste (and won't put the buttons/"data" on the same row despite being coded that way to do so, I could make a 10pix image to put in the button and it still breaks them on desktop). And I don't really know Flexbox well enough to know if it'd be similar to old table tags and just using CSS to remove the borders and the like.
They aren't on the same row as you're just using col-md which is the grid for larger displays.
https://getbootstrap.com/examples/grid/
Resize the window and you'll see them stack together.
So what is a large display? I thought an iPad-sized/7" display would display the same as a laptop/Desktop?
You should use eslint
I use the rulesets from airbnb with some adjustments (personal taste).
https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
I'll be 100 right now, I have zero idea what I'm supposed to be doing with this. When you (and Petrip) say use eslint, I believe you, but what is it and why? Right now, I'm just learning the basics of JavaScript. My ultimate goal right now is to know how this works:
Two applications, two interviews. I'm nervous as fuck, I haven't had to do this for a few years lol.
Is the investiment on a macbook pro worth it? I've been doing most of my work between Ubuntu and Windows but the trend seems to be more and more Mac oriented.
Euuuugh, I just got a leisure laptop which I had to develop on and the thought of spending 2k on a mac is really stumping me.If you need a laptop for web development it's the best you can get and I say this as an 99% Windows dev.
Euuuugh, I just got a leisure laptop which I had to develop on and the thought of spending 2k on a mac is really stumping me.
Oh I know that, believe me, trying to install ruby gems on windows L OH LI love working on my MBP, and I don't think I could work with something else atm.
Windows, which I did use in the past will drive you crazy when you have to deal with terminal related tasks. In modern web development, there is a lot of it.
Windows, which I did use in the past will drive you crazy when you have to deal with terminal related tasks. In modern web development, there is a lot of it.
How to do stuff in terminal on Windows:
1. Install cmder
https://github.com/cmderdev/cmder
2. Enjoy life because your life is now excellent
I love working on my MBP, and I don't think I could work with something else atm.
Windows, which I did use in the past will drive you crazy when you have to deal with terminal related tasks. In modern web development, there is a lot of it.
Windows, which I did use in the past will drive you crazy when you have to deal with terminal related tasks. In modern web development, there is a lot of it.
How to do stuff in terminal on Windows:
1. Install cmder
https://github.com/cmderdev/cmder
2. Enjoy life because your life is now excellent
How to do stuff in terminal on Windows:
1. Install cmder
https://github.com/cmderdev/cmder
2. Enjoy life because your life is now excellent
I tend to prefer conemu
It's a little off topic, but did they fix the terrible high dpi support with windows 10? I used a Samsung 13" Ultrabook with a FullHD screen and it was simply impossible to use this thing in a useful way with an external screen. The scaling was a mess.
And the app support for high res screens was even worse.
Yes and no. The HighDPI stuff works in Windows 10 as it should, but every now and then there's apps that just don't play nicely in hdpi no matter what and are reluctant to update.
To those interested in front end design:
How important do you think it is to consider the user's enjoyment when designing site navigation/transitions etc...?
It's the most important thing, as "enjoyment" comes from accessibility, speed, looks and functionality (among others). I always try to aim for accessibility and speed first. The often cited quote is that every 100ms improvement in speed brings in 1% of extra revenue on shopping sites, but it applies to regular web pages too: faster loading means that people are more likely to stay there. Accessibility means that you cater to the biggest possible audience, always. The looks are harder, because everyone likes different things: for example some find parallax scrolling really look, some think it's distracting and dumb. Functionality is another tricky part: it's always not possible to create "simple" sites from complex contexts, which can break all those other threes if not done correctly. Consider a site that is used to fill in spreadsheets and everything else is nice but actually filling in the spreadsheets is a pain in the ass: users won't stay even though you had the fastest, most pretty spreadsheet site in the world.
To those interested in front end design:
How important do you think it is to consider the user's enjoyment when designing site navigation/transitions etc...?
I'm finding a lot of my peers develop to the standard templates, and while they often look slick, and the familiarity makes navigation easy for the user, most of the designs I see aren't fun to interact with.
Obviously there needs to be a balance, but where do /you/ consider the sweet spot to be?
I suppose I'm asking for examples of this done well, maybe some examples of it being taken too far too.
Thanks.
Rant: Tried to built a Neat Thing with the Instagram API but it's like the most restrictive API I have ever witnessed so had to fallback to A Thing
edit: It became Barely A Thing: https://github.com/petetnt/ascii-shot
Basically I wanted to create an terminal version of Instagram but it's pretty much impossible without breaking all of their rules of usage.