/wdg/ - Web Development General

What are you working on?

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

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_camera_phone.jpg (451x437, 45K)

Other urls found in this thread:

github.com/kriasoft/react-starter-kit
othersite.com
gist.github.com/kyle-rb/9a6d54a26ca07d32f8f9be22e7e807a0
neocities.org
salva.neocities.org
youtube.com/playlist?list=PLcoE64orFoVsxAam_BuQBrNC8IO238SwH
baeldung.com/rest-with-spring-series
callicoder.com/kotlin-spring-boot-mysql-jpa-hibernate-rest-api-tutorial/
vertx.io/
flask.pocoo.org/docs/1.0/api/#flask.url_for
stackoverflow.com/a/14032302
railstutorial.org/book
twitter.com/NSFWRedditImage

>pic
fucking kek, you doin' it son!

What's your recommendation on php bulletin board which login process can be overridden?

Attached: 1533692498185.jpg (680x757, 37K)

in react when should I used this.props.children (pass through composition) rather than just pass everything through normal props?

like if I was building a list, and I had a ListContainer and ListItem(s), it would make most sense to pass an array of props to ListContainer, and then in ListContainer, map each to a ListItem, but I've seen some code where they just everything explicitly as children

with react should I make my css classes PascalCase?
like


or

react seems to use the first option by default but I'm not sure what the benefits/downsides of this are

>my-class
is bad practice my_class is better, the - sign is the subtraction sign in programming and that could get in the way at some point

>be zero experience devlet
>want to make SPA that does image editing in the browser
>instead of hosting functions on server or as a lambda, im going to turn it into webassembly and run it client side
is this stupid

No. That's exactly the sort of problem wasm was designed for.

Webdev is for fags
t. Cnile

just pick a convention and stick with it camelCase is norm in js/css.

i have a question about this boiler plate that im using for an app github.com/kriasoft/react-starter-kit

It seems like a great way to get an idea of webpack bundling and isomorphic design but theres so much wack stuff, why are they bundling the server code aswell as the client? why have they got custom scripts for bundling, copying and cleaning? ins't webpack meant to handle that stuff. Half the project is just configs, is this overkill for a starting project?

Attached: 1523221304181.jpg (480x360, 54K)

If I use the class for css, I use bem.
If I'm gonna use it for js, I use camelCase, I always separate classNames for js and css. I'm not sure if it's a good practice though. I'm not an expert.

>react
>redux
Making the shift to Redux on my intro React application. Can you use Redux states with stateless React components created like this?
const Index = (props) => { return () }

thanks user. now i just need to learn golang to figure out how to use caire

>use
Probably should have been more specific.
This component is stateless itself, but reads the state of a global Redux state.

Just some advice for my /wdg/ senpaitachi who are on the job hunt, apply for literally everything even if you don't fit the requirements. I got offered a position as an Angular Developer where the job requirements said "3 years of Angular Development required" when I had like 1.5 years React at best. What really won them over was they just loved me during the actual interview and thought I was passionate. I'm a complete social autist and lolicon but I also love developing as much as I do loli and that came through to them. So believe in me who believes in you.

Also yes I do have to learn Angular in about two weeks but I got this.

Attached: 190 - fUvJHQd.jpg (462x492, 107K)

yeah

>Also yes I do have to learn Angular in about two weeks but I got this.

Attached: inhales.jpg (500x826, 37K)

thanks

Man, it's good to hear you are getting the jobyou wanted.
Meanwhile I had to accept a help dck job after failing an interview for a we dev job but for some reason they offered me other job.
Should I just give up on web dev (been practicing vue.js + php/laravel for half a year) and go full IT Help Desk?

Angular vs React vs Vue
which one should I learn?

Can you show sample of your resume?

CORS


Is there a way to avoid it? i'm using an external api (i can't modify it), but it gave me cors error, i installed a chrome extension to dev and it worked, but i want to deploy it to heroku.

I'm using react... is there any trick? like doing the request with node and then deploying the react and blabla

>i'm using an external api (i can't modify it)
That's the point. You can only access the API if you're whitelisted. If you can't modify it, then it means you're not supposed to be messing with it.

Congrats on the job user!

I'm applying for jobs now and I've absolutely been applying that methodology.

Anyone help plox
it can't be done i think as browser make new get post request if i want to keep track of it i would have to use sessions i guess.

You can use your server as a reverse proxy. CORS is a limitation of the browser, so your server is free to do whatever it wants.

Basically you just have an "make request" endpoint. So from your frontend you do:
yoursite.com/req?url=othersite.com (except you'll encodeURIComponent that embedded URL)

And then on the backend you'll extract that othersite.com url from the request, send that request yourself, and simply forward the request back to your frontend.

Actually, I have code that does exactly this, so here's a gist:
gist.github.com/kyle-rb/9a6d54a26ca07d32f8f9be22e7e807a0

It's also a static file server, so some of the code is just for that. The stuff you care about is mostly in the "pathname === '/req/'" section and the related makeRequestAndRespond function.

Congrats, Angular is way better than React.

What did they ask during technical interview

sounds like something that'll be abused.

Is there anyway to make vscode sidebar look like atom? It's literally the only thing that prevents me from switching. I don't all those crap, holy fuck let me customize it.

When I write literally anything that works

Attached: brain.jpg (800x450, 55K)

I used to use atom but switched it for vscode.
What do you need it to look like, what's missing?

I'm also trying to switch right now.

I love how the search panel appears in bottom at Atom.

I also love how simple the sidebar is.

Vue

I have a question. What's a good way to start my own website? I don't plan on running ads or having any sort of financial plan or anything. I want to try making something like an old early 90's style websites where I just write articles about random stuff, write short stories, make text written lets plays for dwarf fortress, post game development progress and stuff like that. Just a personal "myspace" for lack of a better term but I don't want to have a social media site or anything. As long as I don't store any personal info on it I'll be safe right?

that boilerplate seems like a nightmare to work with, probably some retards shit pile
use different repos for back/front, or it will become a nightmare

any good and cheap shared hosting + a domain and install wordpress you are good to go.

I'm looking at wordpress right now but all the layouts are website designs that I don't like. I just want something that looks like basic PHP like pic related. I don't care about phone users at all.

Attached: phoenix-game.jpg (1260x713, 131K)

neocities.org

any specific reason for a 90s style website?

I can't serialize my Python into JSON in Django and I don't know why. The schema is basically:
[[{obj}, [nums]], [{obj}, [nums]],...]

but when I try to serialize it in Django I get "list object has no attribute _meta"
Why is this happening? Is Django just not able to serialize JSON in any way you want or something?

I like the simple aesthetic. I think an actual left aligned topic index is significantly more functional than any sort of dynamic scaling minimalist dynamic expanding UI. I also literally don't care about mobile users at all, I don't really care about money or the volume of traffic and I have a pretty strong bias that mobile users are fucking retards that actively destroy anything they touch and that the audience that prefers that type of interaction are the same audience that practices speedreading techniques or just fake reading shit by looking at spark notes. Its the same audience that thinks reading something and convincing someone that you've read something are equal in value when I think that they aren't.

I want a webpage that is suited for the type of content I plan on posting and the type of audience I would like to read it. I also don't see a point in making a webpage take longer to load or more resource intensive when it doesn't need to be.

then you can create your own theme

Could someone explain horizontal and vertical scaling to a retard?

Unironically this or Netlify

Literally just upload your html/css/js and you'll have your own shitty site likes this one
salva.neocities.org

Use neocities

I'm trying to learn backend Java (Spring Boot).
How do you plan your classes, methods and variables when you don't know the scope of the project? I'm trying to design a basic webpage based on Spring Boot, some SQL and basic html/css3. I want the user to input something, then Spring Boot-based backed passes it to an API, receives a JSON and then does stuff with it before sending some data to the frontend, presenting it to the user and possibly saving it to a database (in the backend) How do you plan a piece of code like that?
Are there any books on the subject?

You actually have no idea what you are talking about, kiddo, and it really shows. If you can't make a site mobile friendly without requiring bloat then your site is not about content but presentation of content.

I'm also curious about the technical interview.

I've always wondered how a web dev interview compares to a SDE interview.

Attached: gregormendal.jpg (1280x720, 118K)

>Back-end
Okay
>Java
Why would you do this to yourself

Also from the sound of your post, you seem to just want a simple CRUD application that would take literally minutes to prototype in some frameworks.
If you're interested in books, the best publishers are Oreilly and Manning. A quick search gives me "Spring in Action 5th Edition" that you might want to check out.

If you're just a hobbist, Vue would probably be the most fun to learn. If your goal is just to get a job, then React is much better. Make sure to search "vue", "react", and "angular" in glassdoor just to be sure.

Not that user but what's the best way to learn react without dealing with boilerplate and stuff like webpack/babel? Or is there no way around dealing with all of these?

Also nice trips

Attached: lrg.jpg (500x656, 70K)

Danke schon!

Also if anyone else is interested I just googled this books title + "pdf" and the first result was the book for free.

At what point can you call yourself a code artisan?

When you can solve fizzbuzz

Don't listen to this retard . There's nothing wrong with Java. I think you're looking for something like this. Just ignore the Vue part youtube.com/playlist?list=PLcoE64orFoVsxAam_BuQBrNC8IO238SwH

t.Boomer maintaining legacy apps

Also check this out baeldung.com/rest-with-spring-series

Legagy? What the fuck is legacy about Spring Boot? Are you retarded?

You can use Kotlin if you're one of those brainlets who can't into Java 8+ callicoder.com/kotlin-spring-boot-mysql-jpa-hibernate-rest-api-tutorial/

And if you're into "muh modern frameworks" usw vertx.io/

I've been studying programming and I decided I want to be a backend webdev, thing is I don't know which server-side language I should start using for projects. I've looked job search sites up and figured c# and java has much more jobs than php, nodejs, python, go but I believe learning their ecosystem, specially java's, will take long time compared to say php's or nodejs's ecosystem
programming simple web apps to understand the basics/fundamentals then build something bigger joining all knowledge I've gained from building those web apps is what I have in mind; by "something bigger" I mean:
>a social media website where people could create an account or login with their gmail account, make posts, comment posts, like/dislike posts
>ecommerce website where clients can add products to cart and pay using paypal
>a small CMS

which programming language should I go with, /wdg/? I'm inclined choose either nodejs or php then once I've learned enough I'll be moving to c# or java

nth for
- redux is just glorified global state
- react two way binding is fucking awful

in some cases yes, the case being the person has a super shit tier computer that can't into run it clientside

repost it again instead of linking it

Google for "react starter". There are plenty of starter projects on github for any framework that you can fork to avoid the boilerplate

any good books on webdev?
preferably more general instead of focusing on a single library, technique etc

>any good books on webdev?
yes, harry potter

Go

it's called job security sonny boy
almost no developer at facebook could justify their salary without reinventing everything and making this intentionally difficult and over-engineered

I've been trying to get a job, ANY job no matter how small in freelancer and upwork and I just can't get any. I can get a job IRL, can't get a job online, debt is pilling up, I'll have to sell my car to pay for rent. All I want is to hang myself, I can't deal with this anymore.

at least you got quads

> I can get a job IRL
so what's the problem?
freelancing is over saturated anyway and you need experience for that

have you tried not living in india? no one hires indians on upwork anymore

>sonny boy
fuck you boomer

You're on the right track. The fastest way to learn how a web app
works is node/express. Tons of third party packages to abstract
away concepts you don't need to understand yet.

Keep making new simple apps that use less and less third party
software, and eventually make a move to c#/java.

Once you know how to architect your backend logic for testing,
or simply readable and good organization, you can apply it to any
language.

Your reasoning for not learning c#/java first however is flawed.
When an interviewer gives you a technical interview, in essence
he's just testing if you can sit on your ass 8 hours a day and learn.
That you think something will "take too long" means you are
impatient. Also, front end will be learned on the way. All backend
devs are also front end devs.

>express
use Koa

So I am learning flask and i have a form. I want to stop it from resubmitting the form on reload.
All I can find from search around was to use Post/Redirect/Get pattern or use ajax to submit the form.

fuck i can't figure out how to use Post/Redirect/Get on flask.

@app.route('/')
def index():
return render_template('layout.html', long_url=session['long_url'])

@app.route('/new-url/', methods=['POST'])
def new_url():
long_url = request.form.get('url-input')
return redirect('/', code=307)

have you considered becoming a lyft/uber driver?

No, use express. More tutorials and more solutions to problems.
Express is just a middleware package that makes handling "boring"
stuff easy. That's kind of the point.

angularJS contractor

kill me

warning: I don't know flask or whatever language that is.

Instead of redirecting to your routes path you should use url_for and redirect to the methods name with the url as a parameter.
in your index method add an optional parameter for the url.
then check if you have an url and return your template with it.

flask.pocoo.org/docs/1.0/api/#flask.url_for
stackoverflow.com/a/14032302

making a webapp to display some data aggregated from the api's of other websites but im getting cockblocked by CORS
i dont have access to those other api's, is setting up a backend to proxy the requests my only option?

> whatever language
snek lang
> url_for
i know about it. redirect works both ways by using that url_for method or by providing endpoint.
I think i will use ajax now.

it's just when you redirect to / and your applications runs in a subdirectory it'll redirect wrong and you need to change the code.
where as url_for (hopefully) prepends its working directory first.

ok will try

Question about directory structure /wdg/. For my TypeScript project, a standard to-do list project, I have all the files in /src. Components are what the user can see, so I have files like 'Form.class.ts' and 'TaskDisplay.class.ts' in the /components sub-directory of /src.

These classes have static methods, they're not instantiated. But the 'Task' class should be instantiated. It'll have properties of name, description and whether it is urgent or not. However I cannot put 'Task.class.ts' into the /components sub-directory because it's not strictly a component and it doesn't follow the same rules as the other class files in the page, i.e. having only static methods.

So where would you put 'Task.class.ts' if you were me? So that I can refer to it in other files by instantiating it in the standard way ('const task = new Task("This is a task", "It is to do something", true').

ok i tried it but doesn't work.
Can you explain how can i Post/Redirect/Get

post your code, no one can know what you did wrong

>kill me
address?

LOLLLLLLLLLLLLL nah j/k great work on having a job man :)

@app.route('/')
def index():
long_url = request.form.get('url-input')
return render_template('layout.html', long_url=long_url)

@app.route('/new-url/', methods=['POST'])
def new_url():
# some db operation
long_url = request.form.get('url-input')
return redirect(url_for('index'))


i want to send that long_url to index function so that i can pass it there.

do

railstutorial.org/book

during the Technical interview they first drilled me on a lot of React + Redux since thats what I knew, the CTO was one of those "I can do literally everything" guys so he had all the questions. So things like describing times in my projects where I made re-usable components, what kind of function is Redux and how does it work? (answer is pure function btw), how does data flow work, how do props work etc. Then some behavioral questions, the generic kind like describing a recent project I was proud of. I'd say the best thing for these kind of questions is to just know your stack well and know how to explain your projects. Also have projects even if they're just personal ones.

The whiteboard problem was balanced brackets which was easy cause I practiced it before during my whiteboard grind. The point of a white board problem though is to communicate your thought process though, it should be more of a conversation than just like a test. I had a lot of fun with this cause the CTO asked me what would be a situation where you could use the balanced brackets function to solve a problem? For example you could use it to find an unbalanced < in HTML. I said you could use to to find and color an open bracket and mentioned I used a plugin called Colorizer which "might" do something like this, and then he said he used colorizer too and then we talked about VSCode and IDE in general for a bit literally in the middle of the white board problem. Like just have fun with it, having fun is the best thing you can do to show your personality.

I'd probably rate this my easiest technical interview in terms of difficulty but I think it was my best performance just because of how natural it went. And honestly I am pretty scared though cause they picked me over more experienced people (over 100 resume were submitted for this poisition) but I deserve it I guess. And you know what, you deserve it too /wdg/ so do your best!.

Attached: 1544901227846.png (357x768, 329K)

Ruby on Rails is old news, sorry grampa

unironically this

>Java bad
When will this dumb hipster meme die

just from personal anecdotal experience, literally everyone uses PHP but learn Express first just to get your feet wet, you can learn the basics in ltierally a day

No one uses that anymore

Fuck mobile, you can easily make a site mobile friendly but I actively don't want the 70% of the traffic. I'd never port a game to mobile either because I actively want phones, tablets, and laptops to cease existing forever. If it's not a giant desktop tower with dozens of cables hanging out everywhere then I don't want it.