/wdg/ Web Development General

lazy fucks

>old thread
>Discord / IRC
discord.gg/wdg
#Sup Forumswdg @ irc.rizon.net
Web client: rizon.net/chat

>Getting started
Get a good understanding of HTML, CSS and JavaScript.
Everything you learn will have these as their base.
The Mozilla Developer Network offers a good intro (no matter your browser choice)
developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web

>Online courses
codecademy.com/
freecodecamp.com/
bento.io/

>Further reading/viewing
youtube.com/watch?v=sBzRwzY7G-k
github.com/kamranahmedse/developer-roadmap
github.com/getify/You-Dont-Know-JS
github.com/vhf/free-programming-books/blob/master/free-programming-books.md

>Code challenges
codewars.com/
hackerrank.com/
codefights.com/

>Useful resources
developer.mozilla.org/en-US/docs/Web - General documentation for HTML, CSS & JavaScript
libraries.io/ - Discover and keep track of open source libraries, modules and frameworks
stackoverflow.com/ - Developers asking questions and helping each other
programmableweb.com/ - List of public APIs
caniuse.com/ - Check browser support for front-end web technologies

>Useful Youtube channels
youtube.com/derekbanas
youtube.com/learncodeacademy - codecademy
youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q - funfunfunction
youtube.com/user/TechGuyWeb - Traversy Media
youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ - freeCodeCamp
youtube.com/user/shiffman - coding train

>cheap VPS hosting in most western locations
digitalocean.com/
vultr.com/
linode.com/
scaleway.com/
heroku.com/

an in-depth comparison of hosts
webstack.de/blog/e/cloud-hosting-provider-comparison-2017/

Other urls found in this thread:

kingdomofloathing.com/
urbandead.com
combats.com/
travian.com/
forumwarz.com/
yoworld.com/
en.wikipedia.org/wiki/Peer-to-peer_(meme)
javascript30.com/
jsfiddle.net/4vg0mdam/
gist.github.com/anonymous/d0973381fe840896c678b95097fa94fd#file-a-js
gist.github.com/anonymous/d0973381fe840896c678b95097fa94fd#file-a-sh
gist.github.com/anonymous/d0973381fe840896c678b95097fa94fd#file-a-go
bees.ai/
twitter.com/SFWRedditVideos

>Web
>Development

Is it feasible to build an online RPG with PHP and SQL? A choose-your-own-adventure sort of thing but with stats on health and all that shit. This sounds like a fun project for me but it also sounds like it could be a pain in the ass.

>projectmanager
>management

Nothing wrong with that, but what are you gonna do for graphics? Or is it just gonna be text based?

Ogame was built like that and had a few thousands of players back in
>1999

finally learning html using codeacademy. is this true lads?
>Unless your text editor has been configured properly, the "TAB" key on your keyboard should not be used for indentation.
ive been using tab the whole time ive started learning

Had no luck with this in /sqg/, does anyone here know?

most editors convert tabs to spaces if soft tabs option exists and enabled, tabs are superior btw

This.

Tabs masterrace

>Ogame
Speaking of which, there's a guy who released a really slick-looking Ogame clone a few months ago, although it hasn't really taken off. I was helping him debug it a while back. Goes by "Astral Conquest".

everyone shits on codeacademy so maybe its time to change the OP and add actual decent sources for newcommers?

>Also I've been writing this stuff for only about 4 months and I only use PHP as a method of interacting with a db, so an API.
So you started programming 4 months ago with PHP? You could have used anything else bro.

Why would you choose to do this with PHP?

Is The Odin Project a decent free online course?

>he's not an asynchronous developer

>Hes async isn't enabled by default in the framework

Yes. Most browser-based MMOs, including MMORPGs, are all written in PHP:
- kingdomofloathing.com/
- urbandead.com
- combats.com/
- travian.com/
- forumwarz.com/
- yoworld.com/ (RIP)
- etc.

Because if the devs knew how to write real code they wouldn't make a shitty MMOs

I don't like your game because it is too real-time. And I don't like the graphics.

what is the best stack and why is it vanilla PHP + SQL + vanilla Javascript/Ajax?

>vanilla PHP + SQL
At least you got 1 correct.

I just don't get the point of spaces. Tabs are 4x more efficient.

Tab devs are fully optimized.

Are you me?

How is Ajax part of the stack? It's just part of JavaScript; what alternatives even are there?

technically any technology you use is part of your stack, technologically speaking, technically

Tabs are shit because they are far less portable. Spaces are infinitely portable, tabs have portability problems, end of comparison.

what's the difference?

I guess so, it just seems irrelevant.

You could also include TCP, IP, HTTP, and ethernet. But that's pretty much expected, because by default you're not serving a website over torrents with a wifi-connected server.

en.wikipedia.org/wiki/Peer-to-peer_(meme)

I'm still figuring out all the details like that. As in what the game actually is, lol. I'm no real game developer, webdev is my biz.

I don't know what else to do it with.

Thanks for the list of examples, I'll check them all out.

C#, v8 and jQuery

Remember, responding really fast can be a low level ddos protection.

Learn c#! Or Java and spark or spring framework, or node.js, or literally anything that's not abhorrent or fastcgi hacks.

It's not pretty.

Slow client side code, like jQuery, is fine, especially if you can avoid it at start up.

BLUEHOST OR GODADDY FOR WORDPRESS?

Calling experienced web developers.

Any warnings against companies looking to contract you up asap? What is your experience?

>vanilla php
learn a framework you scrub

honestly mvc is where its at

Fuck Godaddy, these cunts are again net neutrality!

>MUH I WANT VANILLA EVERYTHING BECAUSE USING FRAMEWORKS IS CHEATING/BLOATED

Anyone who uses this argument is most likely a programming newshit.

Anyone with a brain is against net "neutrality"

Theoretically, how bad would it be if I used tags in HTML? WIll it automatically blacklist my name from all future employment opportunities in web development? I just want to center one div /wdg/.

Experienced developer here.

I've never taken contract work.

Hope that helps.

kys

margin: 0 auto ya dingus

Yes. If I were to see any styling outside of the head or script tags then into the trash it goes.

Vanilla is the best way to learn and frameworks only make sense in a work environment. Easier to learn frameworks when you know the vanilla language really well. Actually OOP in general only makes sense when working in teams. Functional and procedural in vanilla is where it's at.

i can't decide between codeacademy, bento and fcc, please help

that doesnt help shit tbqhsenpai

I disagree. Learning programming is language agnostic. Most logic and design paradigms are shared between languages, half of them are based on C in some way or another, anyway. I know fuck all about Javascript/Typescript but Angular provides MVC structure that I'm familiar with, for example.

Learning Javascript right now. I know I've seen people here say that jQuery is getting long in the tooth, but what should I be learning instead?

theres really no way to disagree. It's a fact learning base languages first better prepares you and gives you a fuller understanding of programming itself

Absolutely. I built a (crappy one I don't wanna show, .send(pie)) in MEAN-stack JS, so I don't see why it shouldn't be possible to do one with PHP/SQL.

I'm not gonna say which is superior, but most editors should be able to convert em. My sublime, for example, has a prettifier extension that can auto-space/auto-tab stuff.

On another note, is coeacademy REALLY that bad, folks? I used to love telling people to use it as a useful (tho narrow-minded) resource, but... I'd rather stop if I'm leading people down the wrong path. I feel I might not be a very good judge of it tho, since I probably know everything from it already?

>most likely a programming newshit
I wish I could agree, but sadly... a lot of whom I see this coming from are actually 'older' programmers who were never very good at what they do, and have adopted this suicidal "learning new stuff is bad!" mantra. Most newbies I've met that are against frameworks just right out and admit that they find them confusing or difficult.

It's fine for learning the basic syntax of a language, but beyond that it doesn't really do anything.

Why would you tho? The point of HTML isn't styling - even the and elements are used for emphasis, not specific text decoration - so using a tag shows more than that you're being lazy here. It shows a lack of separation of concerns.

Im actually doing this too. Only with jQuery added in.

Just so you know, mixing PHP data structures with Javascript json objects, is a pain in the ass to handle.

actually its the easiest thing ever and it lets you do async stuff

Oh okay, thanks. So compared to like freecodecamp, or something like that that is ALSO free, is it still acceptable?
My major issue with codeacademy for a while was that it was, as I said before, narrow-minded. Their interpreter (compiler?) would often have one specific way for you to complete an exercise, when there were realistically multiple ways to do it. Worse yet, the 'expected' way wasn't ALWAYS the absolutely clear way to do it. So you'd get a bunch of peeps on the forums like "I tried to do exercise ABC, but it's not accepting my code! What did I do wrong?", and they ended up coding perfectly fine.

Maybe im doing it wrong, but i find myself parssing way to much data from one method to another

What are good resources to learn towards doing OOP and building modules in JS?

In what lang ? JS does not support async by definition

Just made my first pull request on an open source project on Github. Hope them fuckers accept it...

fcc, huge community, lots of help and actuall code reviews for free

Just glance over JS OOP, after that move to JS Functional programming.

It is more useful in real world and less prone to bugs.

you parse with JSON.parse(), thats it

ajax is js

javascript30.com/

Anyone have done that ?

>js not async

woot

ajax and all the sub js stuff does not support actual async like C++ does for example. look it up what I mean, sure you can "manage" to "make it look like" and by definition it sure is, even in vanilla JS, but under the hood its not.

thanks

he's right, async is related to functions that use io so they don't block execution flow wating for the OS api to return, nodejs could have been implemented to be sync, it has nothing to do with the language itself

>javascript30.com/

Nope but it looks interesting

Mates. How do I align #flagbox and its variants to center of first cbox-cell? I've been sticking align-items and justify-content everywhere, to no avail.

jsfiddle.net/4vg0mdam/

If you expand the cramped viewing window then the flagboxes will rearrange themselves to suit...except on the left rather than in the center.

How do I change the request type to a rest all with php?

Say I want to UPDATE. How?

with promises & async/await it's non blocking, which is quite good enough for normal-scale general use

IDs should be unique, use classes

.cbox-cell:first-of-type {
flex: 0 0 30%;
flex-wrap: wrap;
background-color: #eee;
display: flex;
justify-content: center;
}


that markup and css is a bit of a mess with the :first-of-type and :last-of-type

Thank you! It has all worked out. I've been laying down everything today CSS-wise, should give it a nice clean.

guys i want to make a website but its my first time learning web dev, i already know python, Java and C++, what stack should i learn?? i want something with python

well if you know those languages then you really shouldnt have any troubles learning web dev

MEAN or LAMP, I guess...

for python you have Django as the most popular framework, followed by Flask, which is a lighter version. Then you have Bottle, Pyramid and other stuff. I'd say Django. For servers, Apache and Nginx, of course, but maybe you wanna try Zope, which is a python-based server.

If you want to get a job later on, Django is your best choice within Python.

what do you guys think about front end frameworks? should i learn one or stick with vanilla from scratch?

don't learn a stack. You don't even know what the individual parts of the stack even do yet and how they compare.
Seriously, someone says it's his first time getting into webdev and you bombard him with "Nginx, Django, this stack, that stack"

The only thing you should do is focus on HTML, CSS and JS
Then after a while, when you feel like there should be some communication of your site with some kind of backend, you can think about stacks and serverside languages/frameworks/libraries

>what is the best stack
what is "what is the best stack"? it is a disqalifying question.

Having a local programmable http server to use while developing is essential and really can help learn about the protocol.

what do you think about this

>The only thing you should do is focus on HTML, CSS and JS

yeah, dude, but you get through HTML>CSS>JS in one week, specially since this guy already knows how to code

Once you got the very rough basics down I would say, that there is nothing stopping you from trying out a frontend framework.
The "big 3" are React, Vue and Angular.
Check out their "getting started" docs to get a feel for them and pick one.

Learn vanilla js first, when you feel comfortable about the DOM api like how node, elements, events and the html attributes play in there you can start picking front-end frameworks.

How many people still use 1024x768 in 2017? I'm wondering whether to cater to them for bespoke responsive CSS or to just ignore them in favour of mobile users

as many people, as there are tablet users

How do you do this in go?
gist.github.com/anonymous/d0973381fe840896c678b95097fa94fd#file-a-js and heres a shell version gist.github.com/anonymous/d0973381fe840896c678b95097fa94fd#file-a-sh
And what I really mean is how you make the last line happen in go (ignore the long comments in the files I only added them for padding), because I know how to get the stdout and everything but how do I run the goroutine without blocking literally everything after it

This is how I'm trying to do this in go
gist.github.com/anonymous/d0973381fe840896c678b95097fa94fd#file-a-go
and obviously the last line doesn't get printed because the waitgroup is waiting for the goroutine to finish before continuing but if I don't add it then the main function kicks off the goroutine, then prints "dadasdasd" and then the main function is done and it terminates the program with the whole goroutine and that's it

So basically I want to know how to run a go routine in the background without blocking everything that comes after it and without terminating the program

Please recommend a nice PHP ORM. I am sick of writing queries in my PHP code. Doctrine and Propel seem too much for my projects, on the other hand I would like to have good documentation and community support. Any ideas?

eloquent

>Finally applied for 4 junior/front end positions tonight
>Another 3 on angellist
>Just realized how inadequate I actually am at webdev and I'm actually just a retard who's only made a few shitty projects

Fuck

anyone here who tried both Vue and React and decided to go with React for everyday projects?
Can you briefly explain, what made you choose that one?

I picked up Vue initially (quite happy with it) and am now trying to add React to my skillset as well.
Not a friend of the need to call "this.setState()". (I know there is MobX, but why isn't the state observed by default. Can't see a reason where you wouldn't want that, but I might be coming in with the wrong mindset here)
Also JSX feels really hard to "keep clean and readable".
Have not given up yet though.

this is my new favorite website

bees.ai/

Is it possible to play with reactJS without resorting to all the node/npm stuff?

I just want to load a script tag and get running,

What kind of things would or should a frontend developer be able to if asked on a junior job?

Common things so far I've got:
-Image carousel
-Sticky up arrow to top of page
-Mobile navigation
-Dropdown menu
-Prototype a site with foundation/bootstrap from PSD
-Fallbacks for browser compatability
-Pagination

anything I can add?

i used both. in .vue components the markup is on top, scripts at bottom. in jsx components the scripts at top, markups at bottom. you cant unsee that. vuejs has watch:{}.., react doesnt. react has longer code lines. i dunno. i just pick any of them depending on the fanboys that surround me in my workplace. if im surrounded by vuefanboys i use vue. else the other one. imo vue is more solid. react is starting to get really overrated. but i just swap between them. sometimes i mix vue and react to shutoff the fanboys

you need a jsx to es5 converter, hence the node modules

I feel like he gave me something really helpful but I don't know what to do with this information:

body {font-family: MS pgothic !important;}

what should i do this this?

You would put that in a custom user agent stylesheet. Apparently Chrome stopped allowing you to modify them natively, so you have to use an extension to do so.

Just look up "custom stylesheet" in the chrome app store.

How do I into UI?

No, you need to learn that stuff.

do a wireframe

or if you're new, just go into paint or gimp and draw what you want, where you want it, colours etc, then build it.