/WDG/ - Web Dev General

>Previous thread
>Free 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)
developer.mozilla.org/en-US/docs/Web - General documentation for HTML, CSS & JavaScript
freecodecamp.com/
codecademy.com/

>Further resources
github.com/iRaul/awesome-portfolios - Portfolio examples
github.com/kamranahmedse/developer-roadmap - Roadmap
stackoverflow.com/ - Developers asking questions and helping each other

>Tools
jsfiddle.net/ - Use this and post a link, if you need help with your code
caniuse.com/ - Check browser support for front-end web technologies

Other urls found in this thread:

jsfiddle.net/b8cxuk3g/1/
getbem.com/
udemy.com/git-a-web-developer-job-mastering-the-modern-workflow/
udemy.com/the-web-developer-bootcamp/
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
bitbucket.org/jvillar657/kur-full
aws.amazon.com/ses/pricing/
vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratch
dolibarr.org/
twitter.com/SFWRedditVideos

...

...

Why is mobile the cancer killing websites?

People are installing mobile website apps rather than using their browsers. How can we stop this madness and this pointless overwork of having to translate a website into an app?

clicking on a "shortcut" is easier than typing in the address bar, besides, people does not go to many other sites besides facebook and youtube (wikipedia if they have kids).

>People are installing mobile website apps rather than using their browsers
Companies are creating mobile apps instead of ensuring their site works on mobile. It makes sense since you then have access to a lot more user data when your app's permissions include everything possible.

>people really believe this
kek. it will take ages for wasm to catch up with all the stuff that has been produced in the JS world for the past 6 years or so. plus the support from companies like google, facebook and microsoft.

JS literally exploded in popularity out of nowhere. we won't see this at all with wasm.

How the fuck do I call a function passed as a parameter, when said function takes no parameters?

It's /wdg/ - Web Development General fa/g/got

a = function()
function2(a)
???

what?
you mean you pass it to a function, that takes no arguments? That doesn't make sense.
If you use it (call it) inside the function, then the function must be designed for it and therefore has an argument for the function.

Otherwise it's just

outerFunc(passedFunc){
passedFunc()
}

/wdg/- WDG's not a Dev General

Is BEM a meme? I can't find a single website that uses it and official docs are useless without a broader context, I need some real life examples.

Is there a simple setting in MySQL that makes it so that you can only enter a value initially? For passwords as an example, once you enter it, it can't be changed without certain checks?

just do progressive web apps
add background js script + json manifest file to website, make sure you have https and you get a mobile application version of your website for almost free with offline caching and shit

window.onclick = run(1000, () => console.log('running...'));

function run(time, fn)
{
const wait = setTimeout(() => {
if(typeof fn === 'function') fn();
clearTimeout(wait);
},time);
}

idk guys

you want to do this at the application level, not the db level
if you really have to you could try setting up some shitty pl/sql script

and whats the problem?
You can also just do
function run(time, fn){
const wait = setTimeout(fn,time);
}
run(1000, () => console.log('running...'));


or even

function run(time, fn, ...args){
const wait = setTimeout(fn,time,...args);
}
run(1000, console.log, 'running');


maybe switch order of parameters to match timeout.
Did you initially mean, that you couldn't pass arguments to setTimeout?

I tried binding your first suggestion to the window's click event and it's not working wtf

Looking at getting into web dev what is the best development languages don't want to use javascript but will accept defeat if it is the best answer, Been looking at ruby and ruby on rails but what else is there?

Until Web Assembly becomes fully supported by browsers your only option on front-end is Javascript. On back-end you can use anything you want.

how do I code something like this the fastest way?
colortemperature.com
maybe some CMS and template modification or vanilla js + html/css would be cooler way?

Code what, the entire site or a specific section?

If you're talking about the video portion, I can help you with that, the other stuff seems straightforward at first glance.

jsfiddle.net/b8cxuk3g/1/

I'm doing the "git a web developer job" udemy course and the guy keeps using things like "testimonial__title" but other times he'd use "feature-item-title" and I can't even figure out why he would change the naming of classes

Is he trying to do it like this

name1__name1-name1
name1__name1-name2
name1__name2
name1__name2-name3

is that the idea?? I just don't fucking get it and he never explains his naming process at all

It's BEM, he should've explained that.

getbem.com/

And he does in CSS Architecture section.

udemy.com/git-a-web-developer-job-mastering-the-modern-workflow/

You need a wrapper function around run(), because right now you are setting window.onclick to undefined as your function doesn't return anything.

I wanted to make a "todo list" using js, so I put an input on the page. My question is, how can I get the text I type in and add it to the list?
I know I can append a to my using jQuery, but I don't know how to get what I type in the input.

what a faggy naming convention. these "best practices" things are often arbitrary or subjective.

drop jQuery.
Being dependent on it, even for something simple as a todolist will bite you in the long run. No reason to use it anymore.
Read the documentation on MDN for input fields.

$("input").value

but do what said and start learning vanilla js

or $("input").val(), it's been a while, just console log it to check which one works

If it was up to me for naming everything I would literally do it this way every single time

a__b-c-x-y-z
I just don't get why anyone would ever do anything else

If the whole point of it is to have the __ be used so you can shorten things and make it easy to read why would you ever go back to "normal" CSS and just name things a-b-c randomly

i'm so confused holy shit

As a complete beginner to web dev, would you guys recommend udemy.com/the-web-developer-bootcamp/ course on udemy? I searched around on the net and people are saying that its a pretty good course, but I don't know if they are shitters or not.

it gets recommended all the time, even here.
Not the worst investment you could do, when it comes to paid courses.

Is it common to use flexbox to make menus/responsive mobile?

I'm trying to understand -when- people tend to use flex more, or if it's just everywhere.

Sanity check: am I correct in assuming that the former will perform better than the latter (if only on a microscopic level)? If I understand things correctly, the former b() will only ever be instantiated once while the latter b() might be redundantly instantiated.

function a() {
b();
}

function b() {
alert(1);
}

a();

function a() {
b();

function b() {
alert(1);
}
}

a();

>Nesting functions
Don't.

He's a great teacher and it's set out more like a school course where you have a bunch of small lessons to introduce you to things and a big lesson to put them to use, rather than most other 'courses' where you are just following along as they do something very big as a whole.

it's good. you should always look for the docs though because the way he writes the code is outdated sometimes. he uses "var" all the time, no promises, some things changed in the libraries he uses.

I'm doing this one right now. Seems decent so far, I only paid $10 for it.

Can WA easily 'interface' with JS libraries?
So could I write the core of a site with WA and then use some other JS files or libraries like socket.io or moment.js for certain components?
Or would it be a good candidate for the underlying architecture of Vue & React, where you then build your own components on the super fast core?

If given the choice between developing websites in Javascript, and developing websites in literally any other language, 99% of developers will choose JS for documentation, portability, market penetration, and ease of use. Who the fuck wants to write JS in C/C++?

I got my first freelance project! I get paid 80 Shekels for it!

PIZZA MONEYYYY

What do you have to do

Simple drop in on a manufacturer's website for customers to calculate how much of an antifreeze they need to use based of weather conditions for the week

coincidentally i just got rejected by all freelancers that i invited to work on my project!

now i'm fucked beyond belief! yayyyy

What's your project? Technologies used?

What's a good micro-framework that is simple to learn and minimal? I want to be able to start making websites real quick but any framework I see has like 100 pages of documentation and a shit ton to memorize.

i made a webapp, frontend uses vue and backend java with spring boot. it kinda works, but i had no idea what i was doing so the code is probably shit and i need someone to tidy it up

You don't need a framework to make websites real quick. Just know JS/jQuery at minimum plus HTML/CSS

>You don't need to know JS/jQuery at minimum plus HTML/CSS to make websites real quick. Just buy a template

How much time does it typically take to learn a framework? I would just use html/css if my website was just a bunch of static webpages.

it depends on the framework. i was told vue has the easier learning curve, but i can't judge for sure

What's involved in setting up a custom domain email for a client? (ex. [email protected])


Can it be done for free? What's the cost? Do I need to pay for a spam filter? Do I need to monitor it?

well you don't need to learn a framework 100% with all the minute details, to start making stuff with it.
But yes, Vue should be fairly good, since the docs are excellent.

you don't have the time to redo it or are you just looking for a second pair of eyes to doublecheck things?

Sinatra

>Can it be done for free?
no
>What's the cost?
at least a small vps, but even though I don't know how to set it up manually I can tell you, that you will fare way better with a paid service like GSuite or something else, if you shy away from the google botnet, than if you try to do it yourself. Think it's 10$ a month.

>What's involved in setting up a custom domain email for a client?
I setup an email for myself. I bought a domain and then used Zoho Mail which allows for free email hosting so long as the volume is fairly low.

Prior to that I attempted to run my own email server but apparently that gets you blacklisted real quick and all your emails get deleted before they even make it to a spam filter.

const data = [1, 2, 3]

data.pop();

console.log(data);


what the fuck?

Thanks guys, appreciate the answers. Ended up buying it.

How far along are you and how are you finding it?

developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop

both. i've got a job now so i can only look into it on weekends but on top of that i'm kinda sick of it. it's by far the biggest project i have ever done, i had never done a web app or even used javascript in my life, it was hard as fuck for me

is this another "js sucks because i don't know it" post

Why does it work on const variables?

const only "consts" the binding, you can't assign another value to data but you can mutate the value if it's an object

developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const

I'm already paying for a VPS. I sorta understand how to install SMTP but I don't know how to finalize everything. I would like to run it through gmail, but paying $10 a month for the G suite is too much since the hosting is already $10 a month.

Can you make entire websites using Vue? It's written frontend on their website.Also what about JS is cancer meme?

const for objects (and all variables rly) means, that you can't assign a new value to it, not that you can not modify the object.
You could add new properties to a const object for example, but you can't assign a completely new object to the same variable.

The variable is a reference to the object, and you can't change the reference.

that's the price for pain free custom domain email though, unless you know what you are doing.
Always a wager between your options. If it's worth the time, you would otherwise have to spend setting things up manually and possible fix any upcoming issues.

what is it, got a git link?
sounds interesting.
Good on you, in any case.

>Can you make entire websites using Vue?
You can either use it to create smaller components, that you can include in an existing site here and there, or you can also make a single-page-app, where everything is made up of Vue components, with client-side-routing, state-management and all the whistles.
>Also what about JS is cancer meme?
different people, different opinions.
Use whatever you like and don't take shitposts as facts.

>Always a wager between your options.
I'd like to invest the time into learning how to set up emails properly. I just can't find any resources that coherently cover everything I need to know. If I could figure it out and keep costs to a minimum my client, then that'd be great. I plan on going through this email stuff over and over with all of my future clients, so it'd be worth the investment to learn how to do it myself.

If at the end of studying, I come to the conclusion that it'd be better to pay for a service, then I'll do that. But at least then I'll fully understand what I'm paying for and why.

I have no problems using UNIX and shit, I have the technological savvy to do shit if I'm given the resources.

running your own mailserver is completely possible without being blacklisted, but its a complete pain in the ass to do right even for an experienced sysadmin.

Gsuite is 10$ per user per month and includes a lot more than just mail (i.e. unlimited Drive and other stuff)

Sounds like your best bet would be a commercial mail provider, that is if your host does not include email.
Some recommendations given your budget are mailcheap and mxroute, plus they scale well.

>Good on you, in any case.
well, i'm happy about the job, but this is part of my end of degree project and it's not ready. i guess i'll have to postpone it again.

i don't think you'll manage to build it but there you go, i'll set it back to private in a while. keep in mind you should use branch "testing", not master, i was also learning git at the time
bitbucket.org/jvillar657/kur-full

forgot about Amazon SES, which can be even cheaper depending on your use case
aws.amazon.com/ses/pricing/

ah yeah checked it again.
basic is 5$ and business plan is 10$.
isn't SES just for sending out emails from your backend and not for personal accounts?

Thank you so much, I really appreciate it. Now uh, let's say I wanted to use Gmail's server but wanted to use some SMTP relay so that I could use a custom domain for that gmail account. Would there be any way to do that other than paying for the Gsuite?

Sorry if it's a stupid or redundant question, I'm just seeking clarification. Email shit is where I really fall short.

>isn't SES just for sending out emails from your backend and not for personal accounts?
its certainly more suited to that, but it works for both

no, gmail doesn't support custom smtp relays

zoho is free or gmail business if you actually need functionality

of course you can, with additional benefits. but in this case vue is the only one of the big three frontend frameworks that actually isn't bloated and can get you up to speed quickly.

it would be nice if it could compete against react and angular in the job market, outside of the internet world, but sadly it probably won't be the case because money speaks louder.

don't know about java. Only looking at the frontend part right now, but I see what you mean.
'Tidying up' would probably mean rewriting a good bit of it?
Some unwieldy parts in there like "setState: function(nextState){", where the way it functions, it doesn't really seem to make proper use of a view library like Vue.
And also the components, that all have duplicates of each others state properties.
Some state management or even a simple single source-of-truth-object might be useful there.
vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratch

A simple webpack setup could also be good to replace those global variables across the various separate JS files. (have a clear require() or import structure)
vue-cli has a simple setup command for that, but it's also not too hard to do it manually, with the added benefit, that one knows how it all works together.

>vue is the only one of the big three frontend frameworks that actually isn't bloated
Anybody know what he meant by this?

Anybody here legitimately *no memes* provide both standard images and webp for their visitors?

How much bandwidth do you save per month?
Does it offset the storage penalty?

Im in the process of learning/evaluating different frontend frameworks. So far my impression of Vue is good in that it is a very small library that creates a virtual DOM, it doesnt need a templating system but access html elements directly but doesnt litter the html as much as Angular does. These are just my first impressions, my opinion may change as I get more into Vue

Oh, you're just leaving react out of your "big three" for some reason, despite the fact that it has far larger market share than Vue.

"big three" are always React, Angular and Vue.
Don't think user denies that React exists and everyone knows, that Vue is nowhere near the usage share of the other 2 (at least here in the west)

Hi /wdg/.
I'm making my first site.
What's the size of background do you recommend I use?

I think the React hype of reactive programming where a virtual DOM is constantly being updated and recalculated. But Vue also has a reactive virtual DOM, and it appears to take less code to connect data to the virtual DOM, so I think that the React hype will die down after a while especially considering that React only handles a view and requires extra stuff to do model/controller programming.

Senpai
The size of the background is the size of the user's browser window minus the size of your content
You don't really have any say in the matter

My point was obviously that react is far, far less bloated than vue.

>React only handles a view and requires extra stuff to do model/controller programming.
>model/controller programming
You're doing it wrong.

>You don't need to buy a template to make websites real quick. Just hire a developer

don't see how either of them are "bloated". The word has almost lost all meaning now it seems.
Vue compiles its component/templates, React compiles its JSX.
Both have their rendering functions, lifecycle hooks, optional router and state management.
I haven't used Angular, but from what I know it apparently tries to cover much more than those two out of the gate.

>vue is the only one of the big three frontend frameworks that actually isn't bloated

All I'm saying is that this statement is retarded no matter which way you slice it.

insightful quote

i have a very small sports club and i want to store member info in a server. i have pretty much no funds, so my idea is to run everything in an old machine and access it in a web browser.
is that possible? i just need basic functionality like create new member, list all members, register some payments...
do i need a program running on the server (besides the web server and db server) to make it work or can all the db operations be done (with a simple gui) directly on the web browser (maybe with javascript)?

honestly don't bother and type everything into a spreadsheat or an access db
do it in google docs or similar botnet service if you need it to be online

if you really need more features look into some prebuilt solution like this for example
dolibarr.org/
you should be able to run it on an old machine or a cheap vps, it would be a pain to admin tho
don't try to program your own solution

Look into responsive design.

Just a tip.

thanks for your comments, the other reason i wanted to work with a real dev is to learn how to properly do it. i don't understand most of what you say, ill look into it tomorrow.

i did make another setup with webpack, using real .vue files and all, but it was a mess keeping frontend and backend in the same project, building and running it took like a full minute. what bothers me is that this stupid shit that takes me hours to find out by trial and error would be so simple for the right person

I just created an Artisan command that reads your database tables and its columns, and creates index, create, edit and delete (CRUD) Laravel templates based on the data. I'll post it to github soon

/r/ some good productivity tips and software for devs.

Right now I'm just writing to-do notes on a block of paper.