/wdg/ - Web Development General

Regular OP has been sleeping for the last 14 hours edition.

Previous thread: >COMPLETE BEGINNERS GUIDE
github.com/kamranahmedse/developer-roadmap

>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 (independent of your browser choice)
freecodecamp.org
codecademy.com
hackr.io
theodinproject.com/

>Further resources
developer.mozilla.org/en-US/docs/Web - excellent documentation for HTML, CSS & JS
github.com/kamranahmedse/developer-roadmap - Frontend+Backend learner-path suggestions
youtube.com/watch?v=Zftx68K-1D4x [Open]

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

>PHP resources
pastebin.com/gfBPg24A

Attached: wdg_dog_thinkpad.jpg (600x399, 60K)

Other urls found in this thread:

codepen.io/PACSR/pen/jXbyPm
medium.com/@HolmesLaurence/integrating-node-and-python-6b8454bfc272
freetutorials.eu/
developers.google.com/web/fundamentals/primers/promises
twitter.com/NSFWRedditVideo

It's fucking beautiful, thanks man.

Hey guys so like someone here suggested me to do a todo list in javascript. So now I have done simple apps like calculator and todo list in js.
So what should i do next? Should I move to learn backend now? Or should I do some more project? Or learn a front end framework?

Learn framework. Pick between React and Angular. Rebuild your previous apps using framework

Thanks user. I am now pretty comfortable with js now but I haven't done any OOP in js.
My roadmap is like this
is it ok or i need something mopre?
JS -> Python (Flask) -> React/Vue -> Python (Django)/Node(Express)

and what should i do with that oop part

Shouldn't he learn backend before a js framework? I always thought that was the proper order.

If I was you I'd do some PHP + MySQL, the basic stuff, do a CRUD api and try to build a mini CMS. But I admit that I'm not in a position to school anyone, I'm a brainlet, but hey that's what I'd do.

You're right, he can create basic database and get familiarize with APIs first.

hey look at is my roadmap good? or should I do something else?

What's the best way to add a small blog to an existing website? My site is a tool, and I'd like to add somewhere that I can post updates on it. It's built on Java/Spring, if that makes a difference.

a static site generator like hugo

Road maps should not be so python centric.

Do a tutorial in something easy like react/node that includes
authentication, communications between users, some ranking
thing. There's lots of them. From this youll understand the parts
of an app from a high level.

Builds simple, similar apps, going down in abstraction. Meaning,
don't use 3rd party librarty for sessions.

From node you should go to a typed language like c#/java. People
mention golang here, but this is used almost exclusively by
startups in NY/CA and otherwise is dead.

So far you've made 3-4 apps, which include vanilla and react
and your own css "framework" written bem style.

Give yourself 3-4 months to finish this.

Start looking for jobs, and going through sort/search algorithms
courses, then into trees. This will give you an understanding
of the DOM, of react's diffing algorithm, etc.

From then on do some work on projects, do some leetcode
problems each day, but mostly look for work. If you have all day
to do this, it's a 6-8 month journey from newbie to hirable programmer.

ok thanks user for advice.
I though of using flask because i already know python.
> communications between users
You mean like a chat app?

i am getting confused between python/nodejs which one should i choose?

I want to build and host a blog on either github pages or AWS, what kind of database would be best if I'm using Node/Express?

how are many to many relationships done in django? do both of the models need to have a manytomany field with the other?

e.g.
a group contains many users
a user can be part of many groups
does that mean that user needs to be a field in group and vise versa? or only needs to be present in one?

afaik you can only host static pages on github. I f you want to host static page on github look for gatsbyjs

Node has more jobs and tutorials

If you "know" python because you do algorithm exercises, that's
basically all the python you "need" to know.

What's more important than which language you use is whether
you understand testing, what a session is, what to use local storage for,
how to organize css code so it's not a mess.

Django/flask exist because why not. Node exists because, even
without node, javascript is the biggest language in the world. It's
meant for building things, and it's in every web app ever.

Don't do random exercises, actually build things. If you can
explain all the major parts of an app to a five year old, and you
can build most of a binary search tree without much help, you're
good to go.

If someone asks you what oauth is, and you freeze, or if you are
asked to write a function that tests if a string is a pendulum you reverse
the string then compare, you are not hirable.

If when asked how react works, you talk about fiber diff alg parsing the
virtual dom and keeping track of current node to see if it needs
to send it to requestIdleCallback(), so that the event loop can smoothely
take the next piece of animation off the render queue because the
js stack is not busy, you will pass the phone screen every time.

once again thanks for your reply user.

An user posted his calculator a week ago. I'll admit I did copy some of CSS/HTML but the rest is my doing.

codepen.io/PACSR/pen/jXbyPm

I posted it.
It looks good user.

I think I also should have used switch instead of if else. It's more clean

Thanks man, I was tired of thinking what to build.

A to-do list is next.

I also build one yesterday.
Best of luck user

I'm learning myself react now. I'm conflicted with how my folder structure should be. Do you store your css with every component folder or just a styles folder with all the sass file for every component?

brainlet here
what is difference between
function test() {
// some stuff
}

let test = function() {
// some stuff
}

nvm figured it out
shit now i feel like a brainlet

So let me get this right, Electron is basically taking the front end of a site and putting it into a desktop app?

I'm a "normal" programmer (C, Java, Python, etc) that became a webdev

How do I use variables in CSS and, more importantly, can I concatenate strings?

I wanna have like

--Path = '[website]'
--Files = var(--Path) [concat] '/files'
--Images = var(--Files) [concat] '/img'

and so on
(or is this not recommended thing to do in CSS?)

yes + it can interact with your os

>if a string is a pendulum
???????????????????

what was it?

So would be any difference from, for example, a vue app with a node js as the back-end compared to a vue app with a Django as the back-end as Electron apps?

Attached: 367373467.jpg (477x477, 41K)

REPLY YOU MOTHERFUCKERS

WHAT THE HELL IS "tests if a string is a pendulum"

do you mean palindrome?

>Regular OP has been sleeping for the last 14 hours edition.
Lol, sorry. I haven't been checking the thread; busy with finals.

finals about what? CS?

Hope you're fine, OP

function isPendulum(str) {
return (str.toLowerCase().includes("pendulum")
&& str === Array.from(str).reverse().join(""))
}

is that the same as is palindrome or...?

lol
i thought it was another thing

you could've said "test if a string contains the word pendulum in it"

I think what you're meaning to say is palindrome?

Yeah, CS major. Yesterday was computer security, today is networks.

It was a joke, I'm not the guy who originally said it. This tests if a string contains the word "pendulum" and is also a palindrome.

I misspoke. Obviously I meant palindrome.

Correct palindrome test actually checks first, last char, then increments
first, decrements last, checks again, etc.

If you can't do this, you havent spent a lot of time sitting on your ass
and reading documentation, which is essentially what programming is.

what I did was turn to lowercase, remove spaces, and just compare it to a reversed version of itself iirc

Don't do this.

I have to use a for?

why? it just works

Think different

while loops are probably better

first is always 0

last is string.length - 1

compare first to last

if not equal, return false

decrement last, incremenet first

check again

when do we stop? If length is odd, first and last will converge on the same index

if length is eve, they will corss. first will be bigger than last

so as long as last is bigger than first, we should keep checking

when you were first asked this question, you went in this direction, but
you didn't know how to implement it. someone who doesn't think you need
a job then showed you you can reverse the entire string, and you thought
that's much less code than I was thinking, thank you my clever competitor

makes sense, thanks for the explaination, I'd still need to do some sketching in paper to pull this out though

If I were asking this in an interview, I would specify that reversing a string isn't a valid solution, and that the solution should use a loop (since ability to use a while loop is the only thing really being tested with that question).

If someone gave me a technically correct solution done a way that doesn't demonstrate the thing I was looking to test, then I don't think I could really fault them for that. I'd probably just adjust the constraints and ask for a different solution.

>someone who doesn't think you need a job then showed you you can reverse the entire string, and you thought that's much less code than I was thinking, thank you my clever competitor
Not really though. IMO it's just more clear what the code is doing, at the sacrifice of performance.

looooooooooooooooooool

>If I were asking this in an interview, I would specify that reversing a string isn't a valid solution, and that the solution should use a loop (since ability to use a while loop is the only thing really being tested with that question).

Hmmmm

I've seen a solution to palindrome checking in a 2 lines function, it required an extra parameter that I didn't get though, I think it was the length of the string, but it used the entere numbers (rough translation, what I mean by this is that 5/2 = 2) with some weird operator, I believe it was >> it was pretty cool, but I wonder if that extra parameter was an elegant solution or it was just requested as that in the interview.

That question def test more than can you use a while loop.

The correct answer is "most people will reverse the string, but"...
demonstrate understanding of time complexity
"this is how I answer this question"
"and btw, you now have a reference to individual chars that
you can run .toLowerCase() on."

In an interview reveal all the data you got about programming. Even if
your "correct" answer is still not optimal, honesty is highly appreciated

if someone asked me to use >> I think I would just go into fight or flight mode

Can i somehow link a Python script to a Node express site? Like could i for example run a Python script that requires a number and i pass that number throught Node?

Attached: 8985239823598.jpg (640x640, 66K)

medium.com/@HolmesLaurence/integrating-node-and-python-6b8454bfc272

Thanks, i don't understand shit and he says it isn't production ready but thanks

I think it was for the extra autism points

I take that back, it was to make the "entire?" division, that one where 5/2=2, so 5=2. That's to know the limit of numbers you have to iterate through, because if it's 5 the third character you don't have to check against but the 2 first and last ones you do.

It's not that complicated a function, it should be too long in any case. Here's a 3 line (excluding the signature) function doing it the exact way described:
function palindrome(str) {
var i = 0, j = str.length - 1;
while (i < j) if (str[i++] !== str[j--]) return false;
return true;
}


And here's a one line function doing it an arbitrarily complicated way:
const pal = (str) => Array.from(str).reduce((valid, c, i) => valid && c === str[str.length - i - 1], true);

I don't get how a while without the brackets work, and how the true and false values don't overwrite eachother

the second way I won't even bother

if you only have 1 statement you don't need brackets
while (i < j)
if (str[i++] !== str[j--])
return false;

Don’t listen to this idiot. Solving a palindrome problem by using a loop or reversing a string is no indication of what makes you a programmer or even a good programmer.

LMAOing @ anyone not doing web dev

how fuking stupid does someone have to be to not work in web dev

bullshit free, plenty of free libraries to make programming a joy and lots of money

is it at all useful to know linux for web dev?

fuck no. are you retarded or something

A while without braces means that it's a one line loop; just the next line is the loop. But you can put the "next line" on the same line if you want. Same deal for the if statement. That one line can be expanded to
while (i < j)
if (str[i++] !== str[j--])
return false;

But in practice you should only omit braces if you're including the "next line" on the same line.

The second function is left as an exercise to the reader :^)

i've always been told that i'm pretty dumb :=( thats why I'm studying web dev now

Django vs Node my niggas

The Complete JavaScript Course 2018: Build Real Projects!

watchandcode

has anyone done either of those?

you have to know it, don't be the guy "help this doesn't work when I run it on node.js in windows"

what's a job I can get that's web dev but pays less because I can't seem to get hired and all these jobs pay $80,000. All I want is $35,000 and be able to write code, doing some customer support stuff along with it is also fine. I have portfolio, github contributions, do well on coding tests, but no college and only 1 year professional experience.

some kind of Analyst? QA? Tech support for some software company? I'm literally a good coder but can't even seem to get an interview as a dev, and nobody will hire me for less money apparently because they assume someone willing to work for that much wouldn't be good.

nah

Where do you live?

/*Free udemy courses*/
freetutorials.eu/

Thanks for that

ikr who doesn't want to do webdev

probably retarded or something

gtg

minneapolis but I've mostly been looking at remote jobs, did apply with local recruiters but they haven't found anything.

omg why did you leave

im all alone with these losers lmao

How do I pass back a variable from the server to the user's webpage? A user fills in info in a form and submits it. The backend will create a UUID and store it and the form info in the DB. How do I pass the UUID to the webpage so it can redirect them to /status/ so they can check the status of their form? The page will periodically check for status updates from the backend.

Scss has variables and you could build a sort of base url folder path structure variable thing but you're making it kind of fucky wucky

Ajax request on an interval to hit your handler that will query the database?

how expensive is to buy a domain and host a site so I can have a personal blog and deploy a few small projects? which are the free options apart from github pages?

For now yes. Obviously websockets would be ideal but an Ajax request every 15 seconds up to 40 times (10 minutes) is fine for now. My database is on an SSD and is small enough to fit in RAM so it shouldn't be that big of a hit to performance. Do I have to redirect them with a backend script in PHP or can I have the webpage client do it?

Static or with a backend? Firebase is an option if its static

I guess with a backend for projects. I want to build a small portfolio and document every step of mine on each project. I'll use jekyll, maybe hugo, for blog and projects has to do with crud apps, signup/signin that kinda stuff

I want to start making some money already. I've been applying to jobs for months, to no avail. I'm probably a mid to senior level developer, but without any professional experience. I don't think I even want a job. How can I make shit and make money from it? Or just make money in general on the web?
(have a book published, making shekels from that, but pennies(like $100 every few months)).

Is 000webhost good for hosting a small php and myqsl web service? I only need it for a few days and it's urgent

>Node has more jobs and tutorials
tutorials yes, jobs not even close

I should post it at /wdg/ not /dpt/.

Attached: sittingAtDesk.jpg (400x400, 15K)

Dunno why I put this off, but Maniwani escapes HTML in posts now. REST-based clients have to escape HTML/render Markdown themselves, but that's by design. If one of you anons want to take a crack at implementing a night theme, please go for it; it should be a lot easier with Sass in the build chain now.
I was in /dpt/ while /wdg/ was down and got WebP support working too, so that's nice.

I've been putting off OAuth2 for forever. I should really bite the bullet and figure out how to implement it once and for all.

Attached: Screenshot_2018-12-12 Maniwani - HTML gets properly escaped now, right .png (1550x791, 271K)

I have such a small workload this week that I literally spent most of my working day whipping up a small app for stealing videos from ifunny.

Kill me.

Just don't do anything illegal LOL

that's the hard part. i just started advertising for my website, just to see what would happen. google placed my ads during the times people are sleeping and all my clicks are from india.
so i fixed the hours so they can't do that, gotta wait some more now.
but for now i'm applying for jobs again

I'm also planning to place ads on my site but I'm kind of lost and I don't know where to start.

i already got rejected for adsense twice. i think unless you're already pulling in steady views no one will care to advertise on your site.

Promises are a solution to what's called "callback hell", where you have a bunch of nested inline callback functions and the innermost one is indented 20 spaces and it's awful to look at. Promises let you make that tree of callbacks into a flat list.

But if you've never seen a callback tree like that, I can see why it just seems like unnecessary weird JS-specific black magic.

If you want to learn more about promises though, this is a great guide. It assumes you already have some knowledge of some browser APIs, but even if you don't it shouldn't be too hard to understand.

developers.google.com/web/fundamentals/primers/promises

How different would web development look if we had the chance to re-create everything (let's say everything that runs in the browser - CSS, JS, HTML) from scratch instead of painfully updating old technology over and over?

It would take forever to create something that looks like a shitty geocities.

Maniwani can thumbnail text files now. This is a pretty big deal for stuff like uploading code, and for literature as well. Instead of having to copy-paste a lengthy bit of source code or some other text, you can upload it as an attachment just like you could with an image or video, and Maniwani takes care of the rest.

Obviously the imageboard owner will have to allow text file uploads, but I plan on allowing them in /code/, /write/, and /sub/ on Futatsu.

Attached: Screenshot_2018-12-12 Maniwani - Text thumbnailing .png (1562x791, 122K)