/wdg/ - Web Development General

Previous thread: >Beginner Roadmap and Overview
github.com/kamranahmedse/developer-roadmap
youtube.com/watch?v=UnTQVlqmDQ0

>Free beginner resources to get started
Get a good understanding of HTML, CSS and JavaScript.
developer.mozilla.org/en-US/docs/Learn - a good introduction to HTML/CSS/JS and Node.js or Django
freecodecamp.org - curriculum including HTML/CSS/JS, React, Node.js, Express, and MongoDB
javascript.info - curriculum providing a strong basis in JavaScript

>Further learning resources and documentation
developer.mozilla.org/en-US/docs/Web - excellent documentation for HTML, CSS & JS
hackr.io - crowdsourced collection of tutorials from across the web for learning languages and libraries (ignore sponsored stuff, look at upvotes)
learnxinyminutes.com - quick reference sheets for the syntax of many different languages (generally not sufficient on their own for learning something, but very helpful)
pastebin.com/gfBPg24A - Everything PHP

>Asking questions
jsfiddle.net - Use this and post a link, if you need help with your HTML/CSS/JS
3v4l.org/ - Use this and post a link, if you need help with PHP/HackLang

Attached: wdg_ibm_monitor.jpg (640x480, 74K)

Other urls found in this thread:

bettermotherfuckingwebsite.com/
learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments/
twitter.com/SFWRedditVideos

>Anyone know any resources for x?
Read the fucking docs.

>tfw have to be able to give a notice to poorfag clients so your servers accept SSLv3 and TLS 1.0 with weak ciphers but force them into a separate jailed environment that just gives them a "you need new browser" notice
>vuln testing scores get pinned at 'you suck'
It hurts.

Hello I'm just starting out to be a web dev and the main question I have is that: Do I need a bachelors degree to be successful ?

Attached: Looking+at+all+that+freedom+made+me+think+it+was+_f8cfed574d4f0512d7ccdee7ac232319.gif (300x115, 154K)

not really
I know developers with no degree earning 75k+/yr

I see , thank you . I'm kinda conflicted on getting a comp sci degree online but many people say you dont need it for web dev. I guess they aint lying

>75k+/yr
I don't want to be poor.

Any good web dev news/related sites out there

I mean, you don't need it at all, but having it opens a lot of doors and at least you learn more than just coding from experts
Without it its harder because you'll need a good portfolio and learn a lot of stuff on your own.

My Junior position at a startup gave me 35K

I see well once I get some money I'll invest it into an online uni

Would it be really stupid to have an SQL column that stores a JSON object/stringified array rather than a one-to-many relationship? Let's say writing an imageboard where multiple file uploads are supported, done via

CREATE TABLE images (post_id int, filename text);


When someone loads a thread, for every single reply you'd have to run

SELECT filename FROM images WHERE post_id = `reply.id`

so just one person causes say 300 queries, now if 5 people open the thread...

When someone loads a thread, you also load all the replies with their images.

In order to load those replies with the images, you have to make several hundred queries to the images table in order to get the filenames...

No you don't, learn SQL joins.

jesus im fucking retarded
select * from posts inner join images on post.id = images.postId where parent = `parent`
that simple

What's the preferred way to develop and deploy PHP web applications today?

A decade ago I used to use Apache with mod_php and a MySQL database with no external frameworks.

Started a jr dev position 6 mo ago after doing FCC and some side projects for a year. $69 starting, $80k now.

No one needs a degree in web dev.

what state?

Docker is pretty standard now for php development (at least if you're in a team). Vagrant was a good solution a few years ago but firing up a virtual machine for dev work is hard on laptop batteries and ram, so most have moved to docker.

Docker often gets pegged as unneeded hipster tech but imagine a new dev starting on your project, they could be on any OS, `docker-compose up` and they're productive. Without docker I've seen new devs take 2 days to get set up.

I believe docker in production offers some benefits too (helps with CI/CD and scaling) but I have less experience there.

I've worked on a Symphony project that seemed okay, but was poorly built, and a Laravel project that I loved. Would definitely do Laravel again, seems like just the right amount of batteries included.

'straya

unironically webdev subreddit
It's the only thing I find useful on that site and gives a good collection of articles, news, library updates, and so on.

Whats FCC m8?

eh, webdev subreddit is average at best. it's usually shitty medium lists of things you ought to know for x, the 10 projects about y, how to become z and then it's just people's shitty bootstrap portfolios and self posts from people who """made it""".

by far the best thing i've found for finding good articles/updates is a twitter acount. just make twitter account and follow the top people in the area you are interested. chances are they will retweet a rad blog or an article or something. you are a lot more connected to the source of cool shit rather than the curated breadcrumbs of redditors

Anyone have experience with Perl web frameworks?

I've used Catalyst before for a larger project, but I'm wondering if I should switch to Dancer2 or something else for smaller projects.

If I want to learn and try Docker and only have a windows partition, but mainly use WSL for webdev.
Would you recommend to use the windows installer for docker or install the linux packages on WSL?

babbys first sql

joins are quite difficult for a beginner, no need to act like a prick

you gonna cry too?

yes

How to make a web crawler bot? What is the most simple ways to the most complex ways? I heard you could use curl but I'm pretty sure there is many more than that.

>web crawler bot
what a broad term

crawling what?

Why is Elixir so perfect?

Is it possible to make a living off making websites while outsourcing all the work to indian/chink freelancers? What can go wrong here?

Attached: serveimage.jpg (373x521, 30K)

Is it worth becomming a wordpress developer in this year?
I feel people are now moving to something else like Magento, Prestashop or Hubspot

they are different shit
avoid WP at any cost

Probably yes, if you just want to get into the industry.

Let's say news articles. So basically text.

you just want send out get requests and then use something to parse the html to get the text you want. you could probably build something in javascript relatively simply. just use the native fetch api and whatever random package for parsing the html. real easy mode would be to just use nokogiri but ruby sucks

the issue really comes from how you are planning the source articles to crawl. if it's one site, you can look at the site structure and determine where the links are for articles and pagination and then programatically crawl it. if you want something to just somehow crawl a bunch of shit, idk. i don't imagine many sites have an update to date site map so it won't be that easy

Why does only one of my scroll event listeners fire when I resize the window. It doesn't even happen all the time. It's a bug I have trouble reproducing. It would just fire for the last element in the list and always for the same, never for the others.

Sometimes I would scroll down and the element is visible, even though it shouldn't be. Anyone had a similar experience?

Attached: 1549201757520.jpg (739x710, 130K)

could you at least post your fucking code?
we are devs, not freaking fortune tellers

what the fuck am I looking here?

its a window.addEventListener("scroll", this.function), with the function performing a className change from opacity: 0 to opacity: 1, the other thing I'm doing with the element is display:none (with the :last-child selector), between 800px and 500px, so the elements go from a 5x2 grid, to a 3x3 grid, and then to a 2x5 grid as the screen resizes,

Why the fk there are none text editors besides Phpstorm's IDE, which support Heredocs in PHP??!

Is there a way in chrome?firefox? to see which child element causes the parent width/height to be what they are?

Bump?
I guess I will try it with WSL.
Post a jsfiddle, if you really want someone to have a look.
The element inspector in the devtools?

where in element inspector?

Aaaaaargh

Attached: Untitled.png (947x268, 14K)

everywhere
You hover over an element and it highlights it on the page, so you see where it extends to.
Or you check its Layout/Computed tab to see the applied values for content, padding, border and margin.

right column

I asked if there was a feature which showed it to me, not how to manually do it.

Attached: 1548274185251.jpg (335x285, 31K)

is it really that hard to mouse over elements until find the widest one

>I asked if there was a feature which showed it to me,
what do you think the dev tools are?
Do you want some voice command
>computer, tell me why this div is so big !!
>yes master, it's because you set this child element to take up 50% of the screen width, beep boop

Attached: 1546695566479.jpg (562x750, 55K)

You gotta learn how to use the inspect element console, it's really useful, and not really rocket science

>alexa, find my widest div and play summer time sadness by lana del rey

What do you think is the best backend language in 2019?

> PHP (some comeback with version 7)
> Java (you know)
> C# (ASP.Net Core)
> NodeJS (seems to have some bad rep)
> Python (what framework?)
> Ruby (anything out there besides RoR?)
> The kids on the block: Go, Elixir, etc.

Absolutely clueles brainlet's opinion coming through:
C# :^)

I was thinking about this, but is it stills seems like if you choose .NET you are dependent on Microsoft. Many libraries don't have native support for .NET and I don't know how it performs on non-Windows systems.

It's just personal preference and there will be almost no one, that has used them all and be able to compare.
For me it's Node, because I like fullstack JS and being able to stay in the same language front&back, but that doesn't mean someone might have more fun and build things better with PHP or Python.

Elixir without a doubt.

Yes I'm sure ridiculing an honest question gets you some internet points from the other users on this tuvan throat singing forum.

c'mon now, the dude was asking for an addon for his fucking inspect element console

This right here is your standard enterprise stack! Needs more abstraction!

I can't think of an alternative way to find out about elements, that wouldn't make things more complicated.
The dev console is as straightforward as it gets.
How would an 'automated way' even look like in that case?

PHP is great, works everywhere and I'll probably use it more once it's got proper typing
Node.js is okay but I'd only ever use it for personal projects. Single threaded processes that could easily crash and drop all connections in production sounds like you're asking for trouble.
C# seems pretty cool and there isn't as much vendor lock in anymore

freeCodeCamp

This. I'm in the middle of nowhere and I make that much without a degree. I've turned down jobs for more too. Also just had a phone interview where I asked for 120k and the hiring manager is calling me Monday.

I've been doing web dev professionally since February 2017. So almost 2 years I went from 10 dollars and hour to 120k a year (maybe) with no degree or professional experience.

what did you know how to do when you entered the market?

what stack did you learn and work with day-to-day?

I knew LAMP stack but didn't even know OOP when I started. What you know is important, but how you interview and express interest in the company is the most important part. I failed a lot before I figured that out.

Every job so far has been LAMP.

interesting, did you know much about Apache or just PHP MySQL?

My Linux and Apache knowledge at the time was just the DigitalOcean step-by-step LAMP install guide. With MySQL/PHP I knew a good amount at the time, but I didn't even learn how to curl until after I got my second job where I was titled API Integrations Specialist. I had only done it once before with Amazon Product Search so that was the code sample I gave them.

nice nice, thanks for answering

Would anyone be interested in being fake interviewed and then sent a report on where they did good and areas that need improvement?

sure

What's the point of CSS when you can just hse tags and breaklines and tooltips and stuff?

>What's the point of HTML when you can just hse plaintext and linebreaks and wordwrapping and stuff?

Attached: 1519300330332.jpg (1129x1200, 118K)

bettermotherfuckingwebsite.com/
>"You're a fucking moron if you use default browser styles."
>- Eleanor Roosevelt

interesting take really

Took the code test at interviewing.io

I completed all test cases in the allowed time. Last one was pretty difficult.

It gave me a 0% score with 0% performance on the first question and a 42% with 0% performance on the second question.

What an absolute joke.

what ere the question for those that don't want to login in that website?

It was like a girl has an array of integers, she has to give her brother half but she wants the most unique ones and wants to give him the duplicates. You're supposed to figure out how many different types of candies she can get.

I figured out I could give sally array_unique. Brother gets count(original array) - Sally's unique array. If brother has less than count(original)/2 then subtract from count Sally and return.

that's it?

how?
Tried to sign up in October 2017 and got an email saying, that they are in private beta and they will put me on a waiting list.
Just signed up again and got an email thanking me for signing up once more, but that they are still in private beta and will inform me once it's ready....

>If brother has less than count(original)/2 then subtract from count Sally and return.
Subtract what exactly from count Sally?

I think the easiest way to do this is to take array_unique like you said. Then in the best case, Sally gets all of array_unique plus some duplicates, in the worst case she gets a subset of array_unique. So you just take min(count(unique), count(original)/2). (Possibly rounding up her half of count(original), depending on the specification.)

Brother has to have half of the original array.

So if after giving Sally array_unique and subtracting that count from the original then her brother needs more, so you subtract how much he needs from Sally's count and Bam you know how many different kinds of candy she will have.

IDK maybe try a new email.

They told me I sucked though so fuck em.

i don't get it. didn't you solve the programming exercise ?

what exactly was the problem?

I can't code on my phone, but subtracting array unique from original tells you amount of duplicates. You give brother that. Then subtract his count from original count to see if he has too many or too little subtract it from Sally's count. It's possible she may lose unique candies so can't just array unique.

It was like 5 pages long.

Sally has a bag represented by an array (T) of candies represented by integers (N). Sally has to give her brother half of her candies, but she wants the best variety of candy. Return the amount of different candies Sally can get after giving her brother half. Count of T is always an even number.

So if T= [0,0,0,8,7,0,7,6,3,10] then Sally can have 5 unique candies

I'm going through the FCC tutorials and just got to the query lesson of JS. The solution looks like this:
function nextInLine(arr, item) {
// Your code here
arr.push(item);
var removed = arr.shift();
return removed; // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

I've got a few questions:
Where it says function nextInLine(arr, item), is it both declaring a new function (nextInLine) and two new variables (arr and item)? I assume that this is what's happening but no where before did they explain that you are able to do so.
Next, where it says var removed = arr.shift();, how is arr.shift() a value?? I thought shift and push were methods of changing arrays and yet here they are somehow assigning the value of an action to a variable.

Any help is appreciated and I'll move this to /sqt/ if it would be better suited for that thread.

Attached: 47b.jpg (665x574, 25K)

??
original array : [0, 0, 0, 8, 7, 0, 7, 6, 3, 10]

sally takes the unique ones: [8, 6, 3, 10]

the brother gets the remains of the original array [0, 0, 0, 0, 7, 7]

what now?

why is the answer 5? Sally can take 0 or 7...

Ok, I think your method works, but you get into the weeds a little bit with all that subtraction.

You don't really need to care about how many the brother is getting, just consider Sally's, and make sure she doesn't exceed the maximum number she is allowed.

Here's some code that does that:
function sallyUniqueCount(candies) {
let uniques = candies.reduce((set, candy) => set.add(candy), new Set()); // add all candies to set
let sallyMax = Math.ceil(candies.length / 2); // sally can have at most half, rounded up

if (sallyMax > uniques.length) { // if sally can have all the unique candies
return uniques.length; // then return that number
}
else { // if she can't have all of them
return sallyMax; // then she can only have half the total (but that half is made entirely of uniques)
}

// this is better represented by: Math.min(uniques.length, sallyMax);
}

This is the one where you learn about function arguments: learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/passing-values-to-functions-with-arguments/
7 lessons before yours it seems

it's calling the shift() method of the array, which returns the first item in the array. The returned value is then assigned to 'removed'

>Math.ceil
>T is always an even number

It wasn't in the initial vague spec and I didn't read the full version thoroughly. Anyway, defensive coding and shit, better safe than sorry.

nvm i get it

>This is the one where you learn about function arguments
According to that example, both a and b are defined later in the script. Neither parameter (arr or item) are defined in the Stand In Line script later on.

Dammit, im so used to firefox, i dont know how to use console on chrome. How do i check erroers and info messages??? double click dosn't help

Attached: chromesucks.png (1483x550, 33K)

where are they defined later?
'a' and 'b' are parameters of the function.
Then in line 3, 'b' is subtracted from 'a' and the result is logged to the console.