[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/wdg/ - Web Development General

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 314
Thread images: 24

File: wedege.jpg (161KB, 824x553px) Image search: [Google]
wedege.jpg
161KB, 824x553px
>Getting started
Get a good understanding of HTML, CSS and JavaScript.
MDN web docs offer a good intro (independent of your browser choice)
https://developer.mozilla.org/en-US/docs/Learn

>Free online courses
https://www.codecademy.com/
https://www.freecodecamp.com/
https://www.bento.io/

>Roadmap
https://github.com/kamranahmedse/developer-roadmap

>Resources
https://developer.mozilla.org/en-US/docs/Web - General documentation for HTML, CSS & JavaScript
https://stackoverflow.com/ - Developers asking questions and helping each other
https://caniuse.com/ - Check browser support for front-end web technologies

>Youtube channels
https://www.youtube.com/user/TechGuyWeb - Traversy Media
https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ - freeCodeCamp
https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q - funfunfunction
https://www.youtube.com/learncodeacademy - codecademy
https://www.youtube.com/derekbanas

>in-depth comparison of VPS hosts
https://www.webstack.de/blog/e/cloud-hosting-provider-comparison-2017/
>>
>>61977920

>Help me. How do I make the following code print 8 instead of 4?
function () {
var x = 1;
var y = 1;
x = 3;
Promise.resolve().then(y = 5); // some async call before setting y = 5
console.log(x + y)
}


new Promise(
(resolve, reject)=>
{
x=1;
y=1;
x=3;
somethingAsync(
(err, five)=>
{
if(!err)
{
y=five;
resolve('is five now');
}
else
{
reject("not attributed, %s", err);
}
});
}).then(
(cool)=>
{
cool=='is five now'
?
// use five
:null;
},
(uncool)
{
// rejected
});
>>
>>61979983

you have to scope out x and y though, cobbled it up together don't worry
>>
>>61979983
either move console.log() into then()
or replace it with async/await I would say
>>
>>61979983
Are you kidding? That answer is disgusting. I already posted the best solution.

function () {
var x = 1;
var y = 1;
var z = 1;

var p1 = Promise.resolve().then(y = 5);
var p2 = Promise.resolve().then(z = 2);
x = 3;

return Promise.all( [p1, p2] ).then(() => {
console.log( x + y + z); // prints 10 as expected
});
}
>>
>>61980284
but does any code after that function execute until both promises conclude?

Shouldn't it be
 return await Promise.all... 
>>
>>61980105
>either move console.log() into then()
NO, because that's a hack unscalable solution. On top of breaking if you add another promise to the mix, it could also move the logical end of the method to the top of the function, which is insane. I'm sorry, but the last code to be executed should be at the end of the function, not in the middle or the top.

That is why my solution here >>61980284 is the best.
>>
>>61979656
redpill me on vuejs
>>
>>61980309
What function? If you're talking about function() itself, like

function()
console.log("hello, world");

// Output:
// hello, world
// 10

So, YES you can execute code outside the function before the promises are fulfilled. Or you can do
function().then((res) => { console.log("hello, world"); });

// Output:
// 10
// hello, world


So you have full control.
>>
File: slp.gif (2MB, 200x259px) Image search: [Google]
slp.gif
2MB, 200x259px
Anyone else read this today?

https://news.ycombinator.com/item?id=15050841

RIP React.
>>
>>61980474
What does this mean? Anything I write with React doesn't belong to me?
>>
>>61980360
It's good.
What do you want to know?
>>
>>61980586
What about vuetify? Is there any better alternative?
>>
I already know the basics of html and css but I find it hard learning js, any tips anon?
>>
>>61980610
There is this list for potentially interesting stuff
https://github.com/vuejs/awesome-vue#responsive

Personally I am fine with Bulma though
>>
>>61979983
new Promise(
(resolve, reject) =>
{

Fucking gross, dude.

new Promise((resolve, reject) => {
>>
Want to check out vue js but just the core and router is over 100kb.

Webdev was a fucking mistake. Somebody needs to nuke California
>>
>>61980810
vue-router.min.js 18.45 kB
vue.runtime.min.js 58.4 kB

28Kb gzipped

am I being memed?
Do you usually serve non-minified non-gzipped JS?
>>
>>61980926
First: lets just nuke California anyway

two:
https://github.com/vuejs/vue/blob/dev/dist/vue.runtime.min.js

https://github.com/vuejs/vue/blob/dev/dist/vue.runtime.min.js

50 + 60 kb
>>
>>61980946
>>61980926
Sorry second link is supposed to be: https://github.com/vuejs/vue-router/blob/dev/dist/vue-router.js
>>
>>61980530
No, if you launch a product that directly competes with facebook and try to sue them, you lose.
>>
>>61980951
That's not the minified router version.
Though even using a non minified version, uglify or babilify would just shrink it down again.

https://github.com/vuejs/vue-router/blob/dev/dist/vue-router.min.js
https://unpkg.com/[email protected]/dist/

but yeah, vue-router.min is actually 24kb. Must have checked the wrong version
>>
>>61980946
vue + vue-router = 2 files.
react +react-dom + react-router = 3 files
>>
>>61981031
But with a loose definition of "directly competes with facebook", they own all my code right?
>>
>>61981201
nope check the faq
>>
File: nightlz.png (67KB, 673x374px) Image search: [Google]
nightlz.png
67KB, 673x374px
>>61981201
They kept it so incredibly vague, that your average dev had no clue what's exactly going on with the license and no idea under which circumstances FB could or would revoke it.
>>
>>61981320
In the time it took you to save that image, you could have read faq.
>>
animate.css vs velocity.js vs animejs?

https://github.com/daneden/animate.css
https://github.com/julianshapiro/velocity
https://github.com/juliangarnier/anime
>>
>>61981350
Whatever works best for you.
>>
>literally every single developer job in my region is either PHP or C#

Fucking kill me.
I don't want to start a new language from scratch but I doubt any company would hire a remote worker with no experience.
>>
>>61981627
>I doubt any company would hire a remote worker with no experience

I doubt that very much too.
>>
>>61981350
all three, they are just animations. Take what you want and add them to your own css.
>>
>>61981627
If you already know one or multiple languages, learning a new one isn't actually that difficult. The foundations rarely if ever change, instead just the details.
But, a company isn't going to hire someone who knows a bazillion languages but has zero real world applications of them. Learn php, create shit with it, and start applying.
>>
>>61981350

I've used velocity. It's nice. Easy to nullify too.
>>
>>61981350
julians really love animation huh
>>
>>61982242
Thanks for the advice.
I'm inclined to avoid PHP for obvious reasons but beggars can't be choosers I guess.
>>
working on an a "modern" imageboard
currently truing to add functionalities like up/down voting threads
any ideas/suggestion?
>>
File: Madoka_Expert.jpg (161KB, 400x450px) Image search: [Google]
Madoka_Expert.jpg
161KB, 400x450px
>>61982838
One button that points up.
Another button that points down.

Ideally somewhere in the vicinity of the image.
>>
Finish the webdev learning path /wdg/
>HTML
>CSS
>Javascript
>...
>>
>>61982838
What language you using? Reddit uses Python :)
>>
>>61983049
i'll up/down voting for the threads only cause adding voting to comments would seem way too reddit-ish
i thought since it gonna be a small slow website, showing popular posts on the homepage would be interesting
any other ideas to implimant?
>>61983107
php,js and mysql, using a tiny parts of vichan/tinyboard for now until we write our own ( gonna be open source ofc )
>>
>>61983079
>Vue/React
>Node
>>
>>61983079
>ruby/go/c# or something else that's actually useful for back end that isn't cancerous js
>>
>>61982740
It's not bad honestly, especially if learning it puts you at a better position in life.

>>61983079
Depends on what kind of webdev. If you'll be touching the front end, you should absolutely brush up on design theories and perspectives, for instance.
If you're working on your own projects and don't care about being hired or what have you, just knowing html, css, and javascript will accomplish pretty much everything.
>>
>>61983079

Not claiming this is the correct path, but it was my path. I would feel comfortable developing just about anything.

Basic
> html / css
> javascript / jquery
> php

Tools
> gulp / sass / npm / webpack

Libraries, extra
> react/ react-native
> meteor

Graphics
> Canvas / webgl / three.js / svg
>>
>>61983257
Someone please finally explain why JS is supposedly so horrible.
>>
>>61983359
have you used it? honestly I just hate using it because it has so many terrible quirks (js-fags will tell you these are "features") and gotchas. It's like it's trying to be several different things at once.

Also, the callback hell is real which makes it fucking horrible to read.
>>
>>61983359
Fun fact, all tools and languages called 'horrible' by /g/ aren't actually horrible and rather the anon just doesn't vibe well with them. Which is fine, having your own likes/dislikes of things, but rarely is the tool/language/platform actually horrendous.
>>
>>61983431
are you serious? I would normally agree but js tooling is actually fucking terrible and requires almost as much effort to stay up to date as it does to learn the language.
>>
>>61983452
You just backed up my point. It's a system you don't vibe with due to requiring more effort to 'keep up', so you call it cancerous.
>>
>>61983452
Just use create-create-app.

Anything more difficult than this is not worth learning.
>>
>>61983487
i'm arguing that some systems are objectively worse to deal with (whether it's because of the community or the language or w/e). Objectively.

>>61983501
way to avoid my argument through criticism that has nothing to do with what I said
>>
>>61983431
Also fun fact: people only use js because they are forced to. No one will use that piece of shit when web assembly arrives
>>
>>61983359

It's not.
>>
>>61983413
>have you used it?
yes.
Used some C++ and Python for small hobby projects in the past and now mostly JavaScript for webdev related things.
Don't really have complaints with any of these

>so many terrible quirks (js-fags will tell you these are "features") and gotchas
eh some are I guess, like implicit type conversion. Can be convenient, but also can cause an error if someone is unaware of it.
You mean things like 0.1 + 0.2 = 0.30000000000000004, typeof(NaN), hoisting, var/let scope, const object mutability?
Where is the line between quirks and normal learning of language syntax though.

>callback hell
That's just bad style on the devs part though?
Not like you can't make other languages hard to read with overusing certain concepts.
Promises and async/await exist for a reason.

feel like the JS defense force here..
>>
File: current_situation.png (162KB, 1855x1056px) Image search: [Google]
current_situation.png
162KB, 1855x1056px
/routes/users.js
var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/users', function(req, res, next) {
res.render('users', {title : 'How are you senpai'});
});

module.exports = router;


/views/users.jade
extends layout

block content
h1= title
p users page


Particular sections inside app.js
var index = require('./routes/index');
var users = require('./routes/users');

&

app.use('/', index);
app.use('/users', users);


Pic related is the outcome of directing the browser to the url.

What could be the issue?
>>
should I use pusher or socket.io if I want to create a private messaging app?
>>
>>61984174
Post app.js, I have a feeling it may have to do with the path of the views folder.

>>61984180
Socket.io is definitely easier (never used Pusher) but I like Websocket package. I've read that socket.io is like the jquery for websockets
>>
>>61984375
app.js
https://pastebin.com/yXx3xUnb
>>
>>61984458
Just noticed from your first post, in you app.js you declare '/users' for your users router, then in your user router, you add '/users' so the route is looking for 'localhost:3000/users/users'
>>
>>61983413
>>61983890
Eh, honestly I feel type conversion/loose typing is more of a decision on JS's part than a 'fault'. You may dislike it, and that's perfectly fine, but calling it an objective 'fault' seems a bit of a stretch.
As for 0.1+0.2 != 0.3, I believe that's a consequence of floating point arithmetic in general, and not just JS.
Yes, callback hell can be a real pain. However, as Anon said, Promises and async/await do exist. I feel this is a consequence of the environment in which JS was created. It ain't JS's fault. He a good boy.
>>
Got fucking lowballed for a frontend job. $90 for a full site design including several pages. I need the money anyways so I'm somewhat happy.
>>
>>61983565
>No one will use that piece of shit when web assembly arrives
LOL

>>61983544
>Objectively.
Don't bother using terms you just can't understand.
>>
>>61984174
router.get('/users' ...); 


This actually matches '/users/users'. The first /users comes from the line

>app.user('/users', users); 


So, you don't actually have a /users route. To fix this, put

router.get('/', ...) 


in your /routes/users file. This will match /users.

Also, these functions (router.get(), etc) send responses (you call res.render(), etc), which means there is no need for 'next' to be passed in your callback. This is what next is for:

myMiddleware(req, res, next) { 
console.log("hello");
next();
}

router.get('/', myMiddleware, function (req, res) {
res.render(index);
});


There's a chain of functions that router.get() calls: myMiddleware and then your function(req, res) callback. This callback is at the end of the chain, so it doesn't need a next. myMiddleware() is not at the end, so a next() call is needed to move the execution on to the next function in the chain, which is why you need to include 'next' in (req, res, next). See what happens if you comment out next(). Your server will never reach res.render(), so your browser will be waiting for a response forever. You will see the browser's loading spinner go on forever.
>>
File: 1501610803305.gif (2MB, 380x285px) Image search: [Google]
1501610803305.gif
2MB, 380x285px
>>61980474
>BSD+ patent license
>software patents

what did they mean by this ?
>>
>>61983079
>sql
>spring
>>
>>61983302
>you should absolutely brush up on design theories and perspectives, for instance.
Elaborate on what you mean by this.
>>
I'm working with HTML imports (https://github.com/webcomponents/webcomponentsjs) and I've run into a problem I can't find a solution to.

My header has ~20 imports in it, and for some reason the last one isn't importing properly. If I move the last import in line to the second or first position it works fine, but any other position it won't import. The truly bizarre thing is if I move that last import statement up the list, the link that's now the last link still imports perfectly fine.

Anybody got any ideas?
>>
>>61989688
5 imports is a lot, 20 is retarded
>>
>>61989688
Your import is throwing an error and not loading or doing whatever hence why the position is irrelevant.
>>
>>61984932
Typescript & observables.
>>
File: Selection_337_001.png (120KB, 1134x773px) Image search: [Google]
Selection_337_001.png
120KB, 1134x773px
Javascript experts, I need your help. I'm looking at the minified source of some abandoned browser extension and it basically allows you to control the volume of audio on the page with a mouse scroll wheel.

I'd basically like to reverse the way it behaves so that when I scroll the wheel up, the volume increases (and vice versa). Current function is wheel up, volume down.

Here's the function... I've beautified it as much as I could from the minified form:

https://jsfiddle.net/jzmp1zys/

(4chan won't allow me to post the function here for some reason... even when enclosed with code tags.

Could someone tell me how to modify it so the wheel up increases the volume and wheel down decreases it?

I'm not a JS programmer and don't know how JS wheel functions work but by hunch is that I could just switch + and 0 signs on "b += c.gap;" parts... Anyone know for sure?

Thanks!
>>
>>61991033
Yeah only first 12 lines matter.

Checks for chrome and Mozilla mouse movement so a is an event.

You can inverse the b += to -= to get what you want.

It is pointing to something obviously though so be aware of that when it changes volume.
>>
>>61991456
thanks anon! just wanted to make sure. I'll try it out as soon as I finish watching a lecture in my browser tab.
>>
>>61991559
No problem, I checked again and e is referring to an embed HTML element. Only thing you can call setVolume on.
>>
I'm using express js and mongoose/mongodb. i'm wanting to figure out how user profiles generally work. can someone help me?
>>
>>61991720
Thanks! BTW, if you take a look at the code above, what is 'b-c.gap : b+c.gap' doing on line 3? should I change those around as well? line 6 & 7 is the obvious part to swap around...
>>
>>61991960
Good spot.

Yeah reverse those + and - operators. The if statement does the same as the Else but executes when browser is chrome.

Mozilla and chrome have slightly different event objects, it's annoying.
>>
>>61991960
The if statement gave me a headache lol, the Whiskey isn't helping though.

If (expression)
B = parseint(e), a = e.something || -1 * a, b = some ? Fuckingweird : ternaryshit;

So assign multiple variables with comma OR do expression, expression?

Learn something new every day with js.
>>
File: 4dChess.png (32KB, 624x441px) Image search: [Google]
4dChess.png
32KB, 624x441px
>>61991838
to do things with node you google "npm thing" in this case you want passport. npm passport.
>>
>>61992664
just restarted the browser and it works!! Thanks for the help anon.

>>61992779
I don't know if this is the work of a minifier or someone actually wrote that convoluted code.
>>
>>61993148
I was just surprised it even compiled.

Turns out that the comma (,) is actually an operator not just used for separation.

Var a = (1, 2)

A is one and then two because it executes all the expressions then returns the result of the last expression.
>>
Javascript rockstar wizards, how do I implement a toggle effect in basic JS? I'm stuck.

https://jsfiddle.net/p17608zw/
>>
>>61990109
>5 imports is a lot, 20 is retarded
What should I use instead?

>>61990560
The issue was actually that the import had an id that was the same as a div in another import, so getElementById was fetching the wrong element. Order did matter, but only because it meant getElementById would see the import before the div.
>>
>>61994509
https://jsfiddle.net/p17608zw/2/
>>
>>61979983
>>61980284
... Are you guys testing any of this code?
>Promise.resolve().then(y = 5);
That's not how you do callbacks. The y=5 part will be run immediately, and then 5 will get passed as the callback to that promise and ignored.
>Promise.resolve().then(() => { y = 5; });
>>
>>61986037
I'm charging $2500 for something similar, and I'm doing him a favor because he's a friend of a friend. Nigga, what are you doing?
>>
Don't know if it is related but after i tried configuring MongoDB as a Windows Service mongod doesn't work at all.
Tried reinstalling a few times, didn't help,
After clicking mongod.exe it shows a window with a line that it is trying to connect to port :27017 and after brief moment mongod window exits.
Does anyone have an idea why I can't keep mongod open?
Pick related.
>>
>>61994919
Exact Promise syntax is unrelated to the question being asked. All you need to understand is that y = 5 after an asynchronous call, which ".then(y = 5)" clearly means if you're capable of abstract thinking.
>>
need help but 4chan thinks my post is spam and I've no idea why so dropped my question on pastebin instead https://pastebin.com/QMmR3gNc
>>
>>61991838
You keep a database of users.
You have a route for a template profile. (ex: "/profiles/:user")
Client asks for the template with a specific user. (ex: site.com/profiles/alice)
Server serves template and perhaps a JSON object containing user information, which it pulled from its database.
Client fills template with user information and displays template.
>>
>>61996400
nevermind it was image0.jpg fixed it
>>
>>61996400
>https://pastebin.com/QMmR3gNc
use console.log() before/after the lines you think are causing problems. Print the relevant data.
>>
Where i can learn how to create Magento 2 extentions quickly?
>>
What are some good arguments for using PHP in a completely new project without any existing code base?
>>
>>61997163
lot's of resources on how to online
>>
>>61997163
It depends on the requirements of the project.
>>
>>61980474
Shit. I just bought 2 React udemy courses yesterday.
>>
>>61979656
what software did you guys use for programming ?
>>
>>61998094
what do you mean exactly?
Editors, Frameworks, Tools?
>>
>>61981031
I can't use technology someone has developed to try to ruin that person's business. Got it. How unreasonable.
>>
>>61998214
Editors anon sorry for misunderstanding.
>>
>>61998692
I like vscode.
Previously used atom, which was also fine.
>>
>>61998791
I used VScode pretty comfy to use, thank you anon
>>
I need a modal dialog window that doesn't disable background in react. How do?
>>
>choose Go to write my new web application
>one service for each domain
>have tables with many to many relations
>Go can't map tables with many to many relations to structs without using a huge-ass ORM

FUCK this shit.

Coming from Java, I never realized how good I had it. I could write clean, nice SQL queries all day, and map them to whatever Java objects I wanted. Java objects with collections and lists, no problems, Java has great (and optimized!) frameworks and libraries that handle this for me.

But nooo, Go doesn't have anything as nice. It's a meme just like node.js is.
>>
>>61983079
C++
>>
I swear I read this question being answered here before but do you guys still recommend using
include 'header.php'; include 'footer.php';
at top and bottom of your php files? Or is it wiser to move away from including header and footer sections for speed and performance reasons?
>>
Does anyone use Angular? Can you give me a quick rundown on the philosophy of Angular and how it structures web applications?
>>
>>62000498
Use a template language instead.
>>
>>62000514
Use Vue.js
>>
>>62000583
What's better about vue?
>>
>>61996187
So I was actually dealing with this yesterday, but I decided to go for a VM route instead. Not sure if that helps at all, but if you run an ubuntu vagrant box, you can just run a mongo container and forward the port to 27017 so you can have access to it on your host machine.
>>
>>62000514
It's been a while, so sorry if this isn't entirely correct.

Angular's big draw is that it's incredibly simple to utilize two-way data binding to make reactive single page apps. It utilizes MVC (Model-View-Controller) design patterns so that you can separate the concerns of your data, your html, and the code to interact with the two.

Data is generally scoped to a controller. So if you wanted to create a navbar element, for instance, you can create a navbarController which maintains its own state with the $scope object. State is able to be bubbled or cast down by using Services and dependency injection, which allows you to create scope in outer functions that can then be injected into other controllers.

You're also able to create your own HTML elements by using directives. In Angular2 moving on, I think Components are replacing directives, but I could be wrong on that.

Really, the main three (React, Vue, and Angular2+) are all going to have similar design patterns so you it's going to be harder to pick which one to go with. But React is the most popular framework/library at the moment, so if you plan on being hirable en masse, then I'd go with that. We're using it at my shop now.
>>
>>62001318
Found a fix, just needed to create data/db in the RIGHT folder.
>>
>almost eternal september
>vueshilling still isn't a bannable offence
zzz
>>
Remember /wdg/:
>"Comparison is the thief of joy" - Theodore Roosevelt
>>
>>62001767
Everybody's hopping on Vue's dick while Facebook is fucking around with React (and all their open source stuff) licensing.
>>
>>62001487
Thanks for the elaborate post.

There's still something missing, I can't really say it "clicked" in my mind. What is the philosophy behind a Service? I guess Modules are for bundling functionality and creating maintainable code, Components are basically units of application logic that are represented as custom HTML tags, but services? No clue
>>
My mind has been tainted by years of reading about how bad PHP supposedly is.
Can't bring myself over the edge to start learning it and always rationalized it to myself, that PHP would surely die out soon enough and everyone would hop onto the Node train.
Yet the current ratio of PHP to Node jobs feels like 20:1.

What's a good PHP guide to go through?
>>
>finish college with a marketing degree
>realize I don't have any social skills and interacting with people is a nightmare
>one of my friends suggests I start learning webdev
>after only 2 months of learning some HTML, CSS and JS I apply for an internship
>somehow get accepted
>somehow get hired after 1 month
>4 months into the job I feel like an impostor and I don't even know if this is the right career path for me
Thoughts? I'm not passionate about web development, the only reason I started learning is because there's high demand where I live, the pay is much better than for other jobs and I don't have to interact much with people in this environment. I feel like this is the wrong mindset though, everyone seems to be really passionate in this field and truly love what they're doing. I just want an 8 hour job that pays the bills, but will I resist in this field if I don't necessarily like it?
>>
>>62003556
Perhaps you can be made to like it. What do you like and what don't you like about it?
>>
>>62003556
might make it hard to keep up with the rapidly changing technologies. You don't want to become the dinosaur dev, that just goes through the motions.
>>
File: intro-bokeh.png (713KB, 2038x1472px) Image search: [Google]
intro-bokeh.png
713KB, 2038x1472px
Does anyone have experience with plotting with Python Bokeh?
>>
>OH BOY LETS PICK AN ORM/DB TOOL FOR THE RDBMS I SELECTED FOR MY GOLANG PROJECT
>WOW THIS ONE IS POPULAR
>LAST UPDATED 4 YEARS AGO

fucking BULL SHIT
>>
>>62003592
What I like is everything that doesn't have to do with coding itself. I like the environment, the people, the flexible schedule and the money.

I don't hate the work itself, but I can't say I like it either. It's just work to me.
>>
>>62003640
Do you at least like styling and structuring stuff? If you're not into solving (logic) problems, then do you at least like applying some aesthetic feel to the product? Perhaps become a UI designer or something.
>>
>>62003637
>using Go
serves him right, he trusted a Pike
>>
>>62003764
I actually enjoy the styling/aesthetic part, yeah. Might have to look more into the design part of things in the long term, any suggestions what I should definitely learn well? Photoshop is a given I guess.
>>
Should I grow a beard, /wdg/?
>>
Is this book "The Definitive Guide to HTML5" by Adam Freeman any good? There are better book?

I want a book for HTML and CSS from beginner to advance . I already did some tutorial, practices, toy web pages. But now i want to read a complete book.

Also, JavaScript books advice are welcome.
>>
Could anyone recommend something like tinyMCE but free?
I want to create blog page with similar content management as on wordpress?
>>
>>62004278
Is tinymce not free?
>>
>>62004278
>>62004434
TinyMCE is free and open-source, the paid version is for support and maybe some extra features
>>
>>62004118
>buying a book to learn web dev
excusable
>buying a book to learn html
kek
>buying a book that ONLY covers html
absolutely horrendous
>>
>>62004702
need to register to get a key to use, I don't like that.
>>
I have an issue with linear-gradient()
If you can, check out this fiddle in both Chrome and FF

https://jsfiddle.net/cepnyuyg/3/

FF renders both gradients perfectly fine.
Chrome renders the edges blurry, when there is more than one color-stop and on the other hand slightly aliases them, when there are only 2 colors.

Am I doing something wrong? (except not utilizing SCSS to its fullest here)
Or is there a hacky workaround for this?
>>
>>62004936
It looks like you don't need an api key; it's only if you want premium plugins if I understand correctly.

Also you can host it yourself and load it from your own server.
>>
>>62005305
now i feel retarded. Thc though, will definetely use it.
>>
Do you criticise yourself a lot with the work you produce, /wdg/?
>>
>>62005902
Why wouldn't you?
>>
>>62005960
I do. But I wonder whether it is actually better not to judge my own achievements so harshly.
>>
>>62004118
read thread description
>>
Forgive me if my post sounds stupid, I was never keen for mathematics.

What is a good px width for an entire page like 960px but more than that? I understand 960 was designated to be a good number since it divides so well. But it is so small for today's display resolutions. What is the next number up like that?
>>
>>62006120
depends on the width of the screen.
Just look at the breakpoints of Bootstrap, Foundation, Bulma and so on
>>
If I'm learning and just creating some throwaway projects to build a portfolio do I actually have to have them online or is it enough to have proof like code and pictures?
>>
>>62006418
>my server sends some extra data
explain
Are you not requesting the data already if the server sends it over?

>>62006510
of course it's better to have a live version.
>>
>>62003090
So let's say that you have a specific function that you want multiple of your components to have, like isLoggedIn(). You can include a function within a service that checks localStorage for a user's auth token and pass that service within multiple components. So if, for instance, you ever change how you're handling the way you're checking if a user is logged in, you only have to change the code in the service and not every component that it's used.
>>
>>62005986
You can let your co-workers criticize you, if you'd like.

In all seriousness, I spend a lot of time seeing how to optimize my code, and every week we do a peer review at my shop.
>>
File: Screenshot_36.jpg (77KB, 528x566px) Image search: [Google]
Screenshot_36.jpg
77KB, 528x566px
>>62006568
Sorry, I deleted the question because I was wrong.

Once the server gets a request for the home page. It renders an HTML page (using some extra input data) and sends it back to the client. See Example 1, where the extra data is the JSON object containing a title.

The key is that the server does the rendering server side, so it only sends back HTML. I mistakenly thought otherwise.


Anyway, what I am trying to do on the client is to show either a "Welcome!" panel or a "Login" panel when the user first loads the site. I am using React, so the server does not render any panels, just a root div. React runs client side, so it has no idea whether the client is logged in or not.

My current solution is to have React make a request to obtain the login status of the client, but I HATE this, because it means I am making TWO requests to load a page when there should only be one.

I want a 1 request solution, but all I can think of is having the server render something onto the HTML page that I can use to tell whether a user is logged in or not. See example 2.

Then I could have React see which element got rendered and not have to make a request to check the login status, but this seems incredibly hackish to me, so I'm not sure if I should do it.
>>
>>61979656
Should I start by learning PHP or Javascript?
>>
>>62008610
JavaScript. PHP is for old websites from the 90s.
>>
>>62002855
>>62002855
>>62002855
It was nice knowing you kiddos.
>>
>>62003931
Only if you write Ruby and JavaScript exclusively.
>>
File: 1502833321868.jpg (49KB, 736x691px) Image search: [Google]
1502833321868.jpg
49KB, 736x691px
>>62009966
everyone knows there are no mods on /g/
>>
File: 1420099814802.jpg (13KB, 250x239px) Image search: [Google]
1420099814802.jpg
13KB, 250x239px
>>62009966
not going to happen here. anime is seasonal, so generals make less sense off season. It's different here, though. /dpt/ and /wdg/ specifically need the generals, otherwise we'd be exposed to the rest of the retards on this board who only faff about with gaming pc hardware.

Either way /a/ just fucked up really badly. Now that the containment threads are gone, that board is going to look like /v/ circa katawa shoujo release. Reminder that the end result was creating an entirely new board for generals, primarily just to contain one game.
>>
>>61981627
C# is tolerable
>>
>>61997163
if you have to host it on a basic shared host with no shell access
>>
>>62003637
I ended up using pg. no problems with it so far
>>
what's the simplest virtual server solution for node?

I'm thinking running a master server which loads others as modules depending on request header host (domain).
>>
>>62011521
virtual host*
>>
>new to web dev
>learn HTML and CSS on Codecademy
>already master JavaScript since I can add and remove element onclick
What should I master next? Node?
>>
>>62013211 UX or backend stuff.
>>
>>62013248
looking for a junior web dev job
>>
>>61980474

I told you to use Vue, mang.
I told you.


>>62013211

The JS ecosystem is pretty cancerous, rather learn some solid backend language like PHP, Python or Ruby. Or even Java. It's pretty easy for beginners to get into a MVC framework and it does a lot of work for you.

Do you know how to protect yourself from XSS / XSRF? Did you even avoid directory traversal attacks? No?
Than you better have a framework which does this for you.
>>
>>62013268 Then UX might be harder to get into. You'd have to actually get more experience and luck to get a design job.
>>
noob question, doing a website for a friend:

he gave me some logos and shit in .ai format, what's the usual practice of dealing with these files? export to png? i don't have illustrator but i guess i can pirate it.
>>
>>62007820
you could have the client rely on a cookie or JWT in localStorage or something.
Depending on that show either the welcome or login elements.
Optionally you can still make a request to see if the users client-side login status is still accurate. Otherwise simply rely on server-side validation, the next time the user interacts with log-in restricted features on the page.


>>62013277
>The JS ecosystem is pretty cancerous
In what way do you mean that?
>>
File: license.png (64KB, 732x554px) Image search: [Google]
license.png
64KB, 732x554px
>>61998524
way to misrepresent it
>>
>>62013588

>In what way do you mean that?

JS in itself is pretty bad. A huge bunch of langauges (CoffeScript, Typescript and waht not) exist only because JS is so flawed. The newest ECMA script is not even great, but it's how JS should have been designed in the first place.

Then you have a huge bunch of frameworks, libraries.. you know the "rewriting your website every month" meme?


>>62013877
>>62013901
>>62013955

Read the sticky, man:
What are code tags?

>>51971506
>>
>>62013997
use code and /code tags in square brackets
https://www.4chan.org/rules#g
>>51971506 →
You can also delete your duplicate posts

>>62014011
eh, ES6/ES7 sure is a pretty good step forward
>"rewriting your website every month" meme
probably the same people that install a new distro every month.
Lots of options isn't necessarily a bad thing, but it definitely is confusing when one doesn't know where to start from.
You don't have a fucked up "car ecosystem", just because there are so many to choose from.
>>
>webpack

https://webpack.js.org/guides/migrating/

are the devs legit retarded?

module
rules
{ //plural
test
use
loader
loader
},
{ //singular
test
loader
},
{ //plural chaining
test
use
"_-loader"
"-_loader"
"_-loader"
},
{
test: /\.css$/
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader",
publicPath: "/dist"
})
}


>Whatever happened to consistency you fucks

>>62014011
>>62014050

ty
>>
hey /g/ how to locate my image in folder?

it should be like this ?
body{
background-image : url(img/picture.png);
}
>>
>>62014168
there is no one universal folder structure to adhere to.
Entirely depends on how your site is structured.
>>
File: calculator.png (23KB, 1918x1015px) Image search: [Google]
calculator.png
23KB, 1918x1015px
How does my calculator look so far boys?
>>
>>62014420
>Can't do calculus

Into The Trash It Goes
>>
>>62014425
any ideas what can be better? any input is welcome.
>>
>>62014420
that's a number layout like on a phone, not as you normally have it on a calculator
>>
>>62014225
Cool because the element checker said the image located at /css/image/picture.png instead of image/picture.png
>>
File: flat,800x800,075,f.u1.jpg (96KB, 800x737px) Image search: [Google]
flat,800x800,075,f.u1.jpg
96KB, 800x737px
>>61981350
me again

went with anime.js
http://animejs.com/documentation/
that frenchie guy made one amazing library there
>>
>>62014420
like shit
>>
File: image.jpg (192KB, 960x960px) Image search: [Google]
image.jpg
192KB, 960x960px
Hey /wdg/ please help me understand how to make the transition from front-end to back-end, I currently know the essentials (HTML, CSS & JS) plus I have a good level on React, what's next? I've been trying to learn NodeJS with Express but don't quite understand the real use for it besides just data bases, I also don't quite get when people say they're going to create a Node app or an Express app, does that mean that's all they're going to use? How are all the tools connected?

I know it's kinda stupid to ask this but I've been only able to find online articles that confuse me even more, if you have any thoughts, articles, links, suggestions, things to google it will be greatly appreciated.
>>
>>62015352
Let's say you want to make a website with a chat feature.
You need a backend that tells you who else is connected to the server, forwards your message to all other clients, lets you know when someone else posted anything new, keeps a history of messages in a databases like you mentioned, and so on.

"Node app" means just that, you have some backend code running via Node.
Express is just a node package that lets you more easily run an HTTP server in Node for various purposes. For example if you also want your Node app to serve HTML files to the browser and not just provide socket connections for the chat clients to connect to. (compared to serving the static files via apache or nginx and then having the it forward everything related to the chat app to Node)
>>
>>62015352
>Hey /wdg/ please help me understand how to make the transition from front-end to back-end
learn how the internet actually works
skipping this step makes everything else useless you dumb fuck
>>
>>62004118
>I want a book for HTML and CSS
Fucking why?
>from beginner to advance
Fucking whyer?
Stop reading books. The time between an author writing a book, publishing that book, and getting the book on the shelves is long enough that whatever's in the book is gonna be outdated. Just learn from websites - freecodecamp, etc. - and practice.

Most of what's in books is gimmicky anyway. It's either stuff you could find for free easily online or it's "hey, look at this one tiny trick no one will ever use!".
>>
>>62008610
JavaScript. PHP7 is decent, but JS can do PHP's job anyway as well as other stuff, so you'll need to know it at some point.
>>
>>62008610
I realize you're getting mixed answers but:
You need both. Modern websites have both a front and back-end. I'll explain why.
PHP can touch a database, JS cannot.
PHP is going to be slower going page to page, JS will be as fast as it gets (very responsive).

PHP is not a bad starter back-end language because it's very point and shoot. You can pretty much just have 1 file and throw requests at it, no types or classes to worry about. Other back-end frameworks like .net are more full fledged and likely to get you a job, but they're harder to get into
>>
>>62016919
>PHP can touch a database, JS cannot.
>I have not done anything with modern web development in the past 5 years.
NodeJS sez hi
>>
>>62017088
Well then bring up NodeJS as an option, no need to be disrespectful about it.
>>
>>62017088
NodeJS !== JS itself
>>
somebody educate me

const saveButtonStyle = {width: 50, height: 17, cursor: 'pointer', border: '1px solid black', background: 'lightGreen', color: 'black', fontSize: '10px', float: 'right'};
const cancelButtonStyle = {width: 50, height: 17, cursor: 'pointer', border: '1px solid black', background: 'lightGray', color: 'black', fontSize: '10px', float: 'right'};


only difference is background color. How do I not copy paste like this? This is in ReactJS
>>
>>62017206
And browsers running JS != JS itself either

There is nothing in the javascript language that prevents it from accessing a database. The browser is what prevents you from doing so easily
>>
File: hacker.jpg (30KB, 600x400px) Image search: [Google]
hacker.jpg
30KB, 600x400px
Is...is it common practice in PHP not to close the code with ?> if it is located at the bottom of the page?
>>
>>62017382
literally who cares
you're being deluded again, anon
>>
>>62017335
What are you having a problem with? I don't understand
>>
>>62017389
You must have responded to the wrong person because I have absolutely no idea what you are talking about
>>
>>62017335
can't you use normal css classes?
jsx was a mistake.
>>
what webapp should i make
>>
>>62017335

const baseButtonStyle = {width: 50, height: 17, cursor: 'pointer', border: '1px solid black', background: 'lightGreen', color: 'black', fontSize: '10px', float: 'right'};
const saveButtonStyle = baseButtonStyle.background = 'lightGreen'
const cancelButtonStyle = baseButtonStyle.background = 'lightGray'
>>
>>62017745
something which is like facebook but for _____
>>
Bruhs I can use PHP and MySQL

I am a coding wizard
>>
>>62017745
what is your level of experience/confidence?
>>
>>62017145
Sorry, but >>62016919 completely doesn't answer the question. >>62008610 asked whether they should START by learning PHP or JS. The more productive answer is JS, since it covers both back-end and front-end. If you then want to broaden your back-end (lewd...), which is a very good idea, THEN learn PHP.

>>62017206
No, NodeJS isn't JS per se, but it's pretty close. In addition, many of the essential concepts of JS (and particularly, modern JS) are part of Node. A node/express server is basically just a crapload of async functions. Either way, it's close enough imo that learning JS and then learning NodeJS isn't a horrible way to go.
>>
>>62017745
Make a WOW killer
>>
who else here /beenpostinginthisgeneralsinceitsinception/
>>
>>62005902
Code reviews are great for improving yourself, try and find someone to review with even if you're working on your own.
>>
>>62017382
You shouldn't close if it's at the end of the file, which is always should be since you shouldn't mix PHP and HTML.
>>
how do I know which npm modules I need for my application?
>>
>>62018560
what? do you not know what your application does?
>>
>>62018560
start with the en pi em docs you doofus
>>
>>62017382
never close it unless you have to because of code mixing
when you close it, sometimes it can fuck with cookies or sessions and stuff like that
>>
>>62018560
that's a really strange question. It's like asking, "How do I know what I should I get from the store for my house?"

The answer is to look around and decide what you need. Idk how else to answer your question
>>
Help me to decide /wdg/.

I started studying web developement like a couple of months ago on my free time after work (like 1-1.5 hours/day). I've gone through the basics of HTML and CSS, diggin on JS now, already made a couple of simple websites.

The thing is, I wanted to explore this because I don't like my job, it pays like shti and I wasted my potential at college.

Now the important choice comes, I have a friend that works at web dev, he's responsible for hiring people as well, and a couple of days ago told me, "If you're serious about this, let me know and we'll work out something, I know you have potential".

I know next to nothing, should I take the chance?
>>
>>62019183
>The answer is to look around and decide what you need.
How do i know that what i need is in a npm module?
>>
>>62019493
npm is just a store for programs. If you want the capability that a program offers and it's listed in npm, you can add it to your app via npm. If you're content with writing functionality yourself and you don't want to use someone else's program, you don't need an npm module
>>
>>62019340
Yeah, the market is starving for web devs. I myself got hired without any experience a couple years ago for 60
>>
>>62018285
>since you shouldn't mix PHP and HTML
m8, what about messageboards, blogs, etc. where do you output the data from the server if not in their desired places in the page structure which is built with HTML
>>
>>62019632
By using Twig or any other template manager.
>>
>>62019959
That isn't base PHP you're talking about. Just as Node.js is not base JS. Buncha stupid frameworks honestly
>>
>>62019984
You go write your monstrosities then, having a closing tag on the end won't make a difference.
>>
>>62020071
I'll go write my monstrosities so that I can get internships at local web development and design companies to further my experience and knowledge of web development and hopefully secure some full-time employment while learning all about the latest trendy frameworks and artisan PHP templating fairy concepts on Shekelstein's dime :^)
>>
>>62016386
>PHP7 is decent,
Where does this opinion come from? That version of the language hardly fixed shit. It's a bit faster (but still one of the slowest languages) and you now have broken type hints for scalar types that should have been included together with class, array and callable type hints in the first place.

And in order for them to actually do what you expect, every caller's file (not your function's ) must use that retarded declare strict types shit.

PHP 7 is just as broken as the versions before it were. The language is so fundamentally broken that it can't even be fixed, even if the core devs had the skills or will to actually do it.
If you're using libraries to abstract away PHP's ridiculously broken standard library, you might as well just use any general purpose language that has an HTTP library.
>>
I need to be able to sign URL parameters with spaces.

I've sent it with a space, with a + instead of a space, and with %20 and with %25%20

None work. What the fuck does it want?
>>
>>61981031
To be more precise, if you use React and Facebook infringes on YOUR patents, they will ban you from using React if you sue Facebook for it.

So you better don't do anything stupid unless you want to rewrite all your frontends if Facebook infringes on your rights, goy, or do you want to rewrite everything you have???
HEHEHEHEHE

Good goyim use react for their website and react native for their phone apps.
>>
>>62020405
Rewriting to move away from React would be really easy because React in itself is so conceptually simple and all the more complex parts like redux are owned by third parties. Just about anything else would be more difficult to move away from, including vue and angular.
>>
Super simple PHP / MySQL question

When submitting data from a form into a MySQL database, how do I get the date it was submitted?

I have a column in the 'posts' table labelled 'date'. Here is a piece of the .php page which handles the submitted data:
$subject = $_POST['post-subject'];
$content = $_POST['post-content'];
$datetime = $_POST[date("Y-m-d H:i:s")];

$sql = "INSERT INTO posts (post_subject, post_content, date) VALUES ('$subject', '$content', '$datetime');";
mysqli_query($dbconn, $sql);

There is no field in the submitting form for the user to input the time and date themselves of course, I just want to get the time and date that the data was submitted to the database. I am assuming the date part is incorrect but I can't find any good help through Google. Would much appreciate your assistance /wdg/.
>>
>>61981350
web animations API.

Use the platform. Chrome and Firefox both support it natively, so you only have to ship the polyfill code to inferior shit browsers while 80% of all web users will get the best world of having to download 0kb for your animation library and having native animation performance (no requestAnimationFrame loops with inline style changes).

For most animations I do, I found css transitions to be more than sufficient, though. Also remember that you should not animate anything but transforms and opacity. Especially not width, height, left, top etc.
>>
should I use classes in js? because everyone is yelling it is a bad habbit.
>>
>>62020459
>$datetime = $_POST[date("Y-m-d H:i:s")];
wut

$datetime = date("Y-m-d H:i:s");


This just gives you server time.
>>
>>61983079
svg.

Seriously, it's useful.
>>
>>62020556
So no requirement to 'post' it then? Is the SQL part ok?
>>
>>62020459
Read up on sql injections and prepared statements before you do more stupid things.

$_POST is just a global variable containing the data that the client sent you.
>>
>>62020535
Like OOP, prototypical inheritance type classes? No. JS is a functional language and you should use functions. If you're going to use classes you should only do so if using ES6 "class" syntax, you should never use inheritance unless implementing against a library for which inheritance is part of the API (don't create your own inheritance trees), and in general you better have a damn convincing case for classes. If you want to use classes because you saw an example of classes that was like "this is the Animal class and it has a Speak method, and the Dog class inherits from it and overrides that method so that it outputs Bark" etc., then you should NOT use classes.

>>62020582
>So no requirement to 'post' it then?
The $_POST global is a way of accessing the parameters of a POST request, it doesn't actively "post" anything in a verb sense. The values were POSTed when the user pushed the submit button and the HTTP POST request was sent to the server, PHP parsed that POST request as it came in, and made its parameters accessible in the $_POST global for you to read from. In your snippet, you're gathering pieces of data to be inserted. Most of this data is from POST parameters, but the date should be something that you generate when you're processing the request. It will be the server time when your application processed the request, as in the example I gave.

>Is the SQL part ok?
Emphatically no. Whenever you are using string concatenation like this to write SQL then you are a shit programmer who doesn't know the very first thing about web. The very first thing about web is sql injection, by far the most prevalent exploit in web, and the one that PHP made famous by being shit.

PHP is garbage, mysql is garbage, and you're garbage. Don't ever put any code that looks like this into a production environment.
>>
>>62020660
Soon as I make this thing work then I will study on how to make it cleaner and better overall.

>>62020718
Thank you for the info. The last line went a little too far, it is only my first day with PHP and MySQL after all. They're both still kicking it in the webdev industry and I want to get hired.
>>
>>62020824
I'm someone else but please tell me, what tutorial are you following that told you to use string concatenation to create an SQL query?

You have to stop watching that pajeet tier content immediately. Any article that doesn't immediately mention prepared statements is faulty.
>>
File: kill yourself.jpg (296KB, 1280x881px) Image search: [Google]
kill yourself.jpg
296KB, 1280x881px
>>62020824
>went a little too far
>>
>>62020869
mmtuts' PHP tutorial videos on YouTube. He seems an alright fella.

https://www.youtube.com/watch?v=XhLAB1wwzNk

He states that he doesn't use prepared statements in that video as a video on that topic would be posted later on, which it has been.

>>62020876
/wdg/ is a friends' club, no bully please.
>>
>>62020935
>PHP tutorial videos on YouTube
Fucking millenials.

>/wdg/ is a friends' club
This is the problem with /wdg/.
>>
File: phpforumproject.png (48KB, 1318x372px) Image search: [Google]
phpforumproject.png
48KB, 1318x372px
I am so proud of myself bruhs.
>>
Should I learn PHP or is it a meme?
I already know some Java.
>>
JavaScript is really comfy when you get used to it

[spoiler]Or I'm suffering of Stockholm syndrome[/spoiler]
>>
>>62014420
Learn how to let users only use the keyboard if they want. onkeyup listeners and shit
>>
>>62021178
comfy, but I can smell the vulnerabilities
>>
What do you do if you're the best programmer at work? Not being boastful or anything, legit question. I have actually reviewed co-workers code and am not just blowing my skirt up
>>
>>62021654
What do you feel being the best programmer at work makes you entitled to?
>>
>>62021672
I meant to reply to the post recommending code reviews as beneficial. They've asked me to review code but not the other way around
>>
so, udemy is having a sale (again).

Any recommended PHP course?
>>
File: hypeu.gif (831KB, 267x495px) Image search: [Google]
hypeu.gif
831KB, 267x495px
>>62021654
>What do you do if you're the best programmer at work?
Suck your own dick my man.
>>
>php virus
Take yourselves out of the gene pool.
>>
>>62021696
Code review can still be valuable even if you're the best one there. Sometimes trying to explain code to someone who's still learning can really help you understand what you did in a more complicated way than necessary.

Also don't take code review too seriously. It can be helpful but IMO "let's walk through every line" is a waste of time. If one programmer on a team doesn't do code review it's not the end of the world.
>>
>>62022076
I am also curious
>>62022799
yes, but what do you do, if that's what is in demand?
I honestly like JS and would much rather stay purely with Node...
>>
>>62020299
Spoiler alert: I actually don't have much (read: any) experience with PHP. I just said
>PHP7 is okay
because I didn't wanna sound like a JS fanboi.
>>
>>62023301
>but what do you do, if that's what is in demand?
>looking for a job
>being a newfag
>bandwagoning too late into a flooded market because you heard it was booming
May as well neck yourself.
>>
>>62023301
>I honestly like JS and would much rather stay purely with Node...
If PHP and JS are all you know then I feel bad for you son. Try picking up a language people aren't forced to use at work.
>>
>>62023365
why are you so butthurt?
>>
Looking at this developer roadmap and toying with a bit of basic webdev, what I want to know is, what do you do when you have a site that has maybe 10 or so pages, all with the same header and footer?

The site is not large enough to justify using a big backend framework, but copy and pasting the header and footer in every page seems like a bad way of doing things.

How can I improve?
>>
>>62023650
Because you and people like you make these shit threads.
>>
>>62023365
>May as well neck yourself.
Who doesn't consider that at some point. Should have gotten my act together like 10 years ago and now I suffer the consequences of NEET existence.

>>62023387
I don't know PHP at all and am not really interested in using it regularly.
Just want to get on a good level, so I am not completely helpless if I ever have to work with some PHP code.
>If PHP and JS are all you know then I feel bad for you son.
eh, I tinkered a bit with SFML in C++ and also some Python. Pretty much only JS now.
For hobby webdev purposes I feel like I can build everything I would want. (HTML, CSS/SCSS, JS, Node.js, Vue.js)
Job market looks different though, especially when it comes to the last 2.
>>
>>62023657
How are you presenting the site now? Almost every templating engine has a mechanism for extending some base template. If you're just using static files you can look at "static site generators" which are scripts that run some kind of templating system before you deploy so you can reuse things like headers/footers and spit out a fully baked set of static files where the reused code is effectively "copy pasted in" by the script.
>>
>>62023180
Cool, thanks anon
>>
Do any of you guys have advice for combining React and Ruby-on-Rails?

I would like to learn React, but I'm not sure how it integrates with RoR, and I would like to learn how to make a separate react app and a separate rails app that communicate through APIs.

Does anyone have example code I could look at for how to do this?

Or any help / suggestions?
>>
>>62023657
To reply to the other guy, a PHP template engine would be something like Twig
>>
>>62023943
Assuming you don't care about serverside rendering (a big selling point of react for some, but a lot of people just don't care) it's quite straightforward.

Most people use react for single page apps so your ruby setup looks a little different, you'll only have one controller that renders an actual template and all the others will return JSON. Since you only have to bootstrap once it's reasonable to load homepage data via AJAX as well so your template could well be static.

It's entirely possible to not do the single page design as well, load react and bootstrap a different route or app after navigation.

Really it's hardly anything different from either the Rails or React perspective, a lot of people think React is glued to node because the build system is such a byzantine mess everyone clones the starter project and never takes the time to figure out how it works, but you run react/bable on their own, despite webpack's best efforts to make you believe otherwise it's not a requisite component.
>>
>>62023954
Who needs template engines when your whole languages was designed for the exclusive purpose of running as CGI scripts?
>>
>>62023943
React and RoR are so far apart from one another they are effectively completely independent.
>>
I just read about React's BSD + Patents stuff. So, what should I use instead?
>>
>>61983359
it used to be shit and you'd have to do hacks like
let that = this;

to get around the crappy OO it offered.

however, recent versions (ES6) have fixed most of the problems (or offered work-arounds, e.g. now you can use arrow functions instead of the above) and JS is much nicer to work with.

the people who bash it usually aren't aware of recent developments...
>>
I'm going to start teaching classes.

Is it ok if I'm not a super dev following autistic CS practices set in college?

I want to be the guy that's like "hey look, I did it without a degree and this is what I do. You can do it to"
>>
How would you improve this code?

_getNextDateWithAvailableInventory: function() {
// just grab all these suckers
const dates = [].concat(...this.variation.stock_items.map(v => v.quantities))
// pretty irrelevant if they're 0, and this is a cheap operation
.filter(q => q.quantity)
// we no longer care about the numeric quantity portion of these as we know all
// the records remaining match our criteria, so let's just work with the dates
.map(q => q.available_on);

// date parsing is gonna be the expensive part, so let's try to keep it to a minimum
// maybe there's availability right now
if (dates.includes(null)) return new Date(); // right now

// the maximum number of date parses that can happen in this method is one
const availableDate = dates
.filter(d => d) // throw out nulls as we've already dealt with those
.sort() // sorting these as ISO date strings or js `Date`s is effectively the same
[0]; // grab the first one, which will be the earliest date

return availableDate ? new Date(availableDate) : null;
}


>>62025271
You especially. Prove your worth.
>>
>>62025323
Oh, and the ridiculous amount of comments is because I'm reviewing a method written by a junior dev. Ninety percent are obviously unnecessary.
>>
>>62025323
Replace all the shitty one-letter object names with something descriptive and delete all of the comments because they are terrible.
>>
>>62025348
Also put conditionals in braces because when using git you shouldn't be doing extra work like adding braces. There is a good chance that someone will add to that conditional in the future, so it needs braces.

Also fire him if he thinks this is python and non-braced conditionals are ok.
>>
>>62025365
Also why are they lining out availableDate but not the dates array? I don't like inconsistency, so I would explain whatever the standard is and tell them to follow it.
>>
>>62025348
>>62025365
>>62025384
So you'd prefer this:

_getNextDateWithAvailableInventory: function() {
const dates = [].concat(
...this.variation
.stock_items
.map(stockItem => stockItem.quantities)
)
.filter(quantityRecord => quantityRecord.quantity)
.map(quantityRecord => quantityRecord.available_on);

// if there are nulls then there is current availability
if (dates.includes(null)) {
return new Date();
}

const availableDate = dates
.filter(date => date)
.sort()[0];

return availableDate ? new Date(availableDate) : null;
}
>>
>>62025498
I would prefer everything with the const on one line. Also the tabbing of dates is 1 too many.

The return statement...if availableDate is true then new Date(true) else null?

wtf
>>
>>62025551
oh nvm, I get the return.

Yeah then seems ok. I usually newline my opening braces for readability, but that's up to wherever you're working.
>>
>>62025551
Which indentation are you suggesting?

A:

  const dates = [].concat(
...this.variation
.stock_items
.map(stockItem => stockItem.quantities)
)
.filter(quantityRecord => quantityRecord.quantity)
.map(quantityRecord => quantityRecord.available_on);


B:

  const dates = [].concat(
...this.variation
.stock_items
.map(stockItem => stockItem.quantities)
)
.filter(quantityRecord => quantityRecord.quantity)
.map(quantityRecord => quantityRecord.available_on);


C:

  const dates = [].concat(
...this.variation
.stock_items
.map(stockItem => stockItem.quantities)
)
.filter(quantityRecord => quantityRecord.quantity)
.map(quantityRecord => quantityRecord.available_on);
>>
>>62025620
C.
>>
>>62025668
_getNextDateWithAvailableInventory: function() {
const dates = [].concat(
...this.variation
.stock_items
.map(stockItem => stockItem.quantities)
)
.filter(quantityRecord => quantityRecord.quantity)
.map(quantityRecord => quantityRecord.available_on);

// if there are nulls then there is current availability
if (dates.includes(null)) {
return new Date();
}

const availableDate = dates
.filter(date => date)
.sort()[0];

return availableDate ? new Date(availableDate) : null;
}


I disagree with several of your choices, but not strongly enough to argue with you about them. You seem to know well enough what you're talking about.
>>
>>62025620
refactor, all those implementations are slow and loop through an array multiple times when you can do it with one for loop
>>
>>62025699
Most choices are down to either personal opinions or standards, depending on your dev level.

Being in this field, I wouldn't expect you to agree with me on literally anything when it comes to formatting.
>>
>>62024158
You should quit development entirely, we just don't need anymore illiterates.

>>62022076
Avoid udemy at all costs.
>>
>haha we all hate JS and PHP haha they're shitlangs
>ZOMG are you doing PHP ? REALLY ?
>by the way a client wants a webshop quick what's a fast solution
>well magento or prestashop, full PHP
>wow nothing else is even close to them in quality
>also Angular React Vue SMEGMAScript2017Boogaloo
im going to sleep
im tired of this shit

t. future fucking magento and zend certified dev if this continues
>>
>>62024158
Whatever. I'm still learning it just because.

I think now is the time to specialize in porting Reacy apps to something like vue. Infinite billions if that's your business strat.
>>
>>62025769

> avoid udemy

any suggestions?
>>
>>62025779
>tfw everything I do is 100% javascript talking to a php backend.
>tfw more views per day that most will get in their life
>tfw those views are only from 1 of my 8 active sites
>tfw I'm talking about the lowest viewed site.
>>
>>62025735
>sacrifice the simplicity of data-oriented for statistically non-existent performance gains
This aint systems programming. Optimizing too early is retarded when it's more important to iterate quickly and for anybody to be able to look at the code and immediately understand what it does. Turning this into a MEGALOOP in order to optimize away my three loops over five array elements would be a huge step backward.
>>
>>62025840
are we finally at the stage where a for loop is considered complex, hard to read, and premature optimization?

t-thanks javascript
>>
>>62025875
Loops are suboptimal for readability when there are good functional solutions. If I refactored this into a loop I would introduce multiple mutations, several variables to keep track of, and a bunch of real programming work. That's a dumb thing to do. It adds multiple orthogonal overlapping complexity domains for the reader to reason about, instead of very tightly encapsulating complexity.

Would it actually be "complex?" Would it actually be "difficult to reason about?" No. Any half-decent programmer wouldn't have a hard time reading about it. But it would certainly be MORE complex, and MORE difficult to reason about. The function as it is now does basically nothing, and has the potential to do basically nothing more than what is absolutely necessary. It is an expression of the simplest possible transformations with the fewest possible side effects applied to a dataset.

Just because you're an incomparable genius programmer who can instantly comprehend any fat looping scheme doesn't mean that the cheap junior dev who just got hired out of a bootcamp is. Why write very slighly better optimized code that might be confusing for somebody rather than very slighly worse optimized code that could never possibly be confusing to anybody?
>>
Anyone want to work on a project with me?

Making time keeping software for developers in positions where their time is billable. I know exactly what to do and it's easy. I could do it myself, but I'm tired of doing things myself. Currently running almost a dozen sites and 3 apps with combined users in the 100s of thousands in the last few months.

Going to sell this shit at 1k initial yearly with required hosting of 50 a month. If they want to host it themselves then it's 10k and it's theirs. Additional programming is at 100/hr. Will sell module additions as extras from base package.
>>
File: 1489628781857.jpg (15KB, 240x320px) Image search: [Google]
1489628781857.jpg
15KB, 240x320px
>mixing markup and server code in the same file
>>
>>62026068
What's the offer here? A partnership? For how much stake?
>>
>>62026068
>>62026111
And what's your role?
>>
>>62025790
RTFM
Updated text based sites
Udacity
Pluralsight

Avoiding video content will go a long way though because it's the slowest to update and therefore you aren't really getting good shit.
>>
>>62026034
I'm not trying to make this an argument, I was more just poking fun, but you should be aware of the downside of most functional programming. Unless you're pipelining it and doing lazy execution then you're most likely extremely inefficient and that can cost you in certain circumstances.

You can split up the for loop into sections just like you would in a functional composition style, while also only having to loop through once. Just because you might not know how or don't think it's possible doesn't mean you can't actually write an elegant for loop with a lot of moving parts that is also readable.

A good example is your date.includes(null). In a for loop you could just exit the function early, in a functional manner you could be adding an entire extra O(n) if your function doesn't end up filtering everything out.

This stuff especially adds up on the backend where it could be the difference between $50 per year server costs or $50 per month
>>
>>62026068
I'd be interested, what stack?
>>
>>61979656
>bento.io
>requires google or facebook account
into the trash it goes
>>
>>62026151
I'm very very aware of the inefficiencies. Let's use your example:

> This stuff especially adds up on the backend where it could be the difference between $50 per year server costs or $50 per month

Assuming this were backend code (it's not), your numbers are ridiculous. Maybe if I wrote every line of code in a complex application in naive functional parlance that would be a feasible figure, but the application would have to barely run because it would spend so much CPU time in application processing. Statistically speaking, it's far better to optimize hot-spots and bottlenecks as they present themselves in testing, even ignoring the fact that any half-decent programmer can recognize 75% of potential bottlenecks before they hit git.

In real terms, trying to write everything in terms of loops instead of functional programming, and in a performance-optimized fashion rather than a simplicity-optimized fashion is very quickly going to cost you more in effort-hours than it is in hosting costs (again, if this were, in fact, backend code). If you pay a junior engineer $20/hr and he spends an hour reasoning about or refactoring the code of this method because it was written in a more complex way, then you've definitely offset any potential monetary gain from a more performant solution, a problem that becomes worse in a linear fashion as the size of your time increases.
>>
>>62026034
Not him, but coming from a js functional programming nerd, your code could be a lot more readable. The spread operator feels too tricky here. I understand what your code is doing, but your terseness isn't translating to readability. The biggest improvement would be to extract the contents of concat into a separate variable with a useful name.

Also, as >>62026151 points out, you can do elegant/readable for loops. Learning how to do them isn't going to hurt you, even if you prefer the functional way. It's just another tool in your toolbox. And speaking from experience, a bunch of small functions cobbled together can often be harder to refactor than a blob of for loop brute force. Better to have no abstraction than the wrong abstraction. The code you posted is fine, of course. I'm just giving you some advice I wish I had gotten a year ago.
>>
>>62026111
My role? Lead and money. I pay the marketing girl 15 an hour with a 250 sale commission out of pocket. Already have her onboard.
I'm not sure about percents. You would be within 5% of me though. That would be a hand-signed guarantee.

>>62026174
This one would be LAMP with jQuery communicating with a PHP REST API. Only because I know that stack so well I can make the thing in probably a week.
>>
>>62026345
>Lead
Which entails what? And what would a partner's role and responsibilities include?
>>
>>62026345
>>62026358
>>62026174
>>62026111
>>62026068
>>>/craigslist/
>>
>>62026345
is there demand for this kind of stuff ?
i made a similar project a while ago using desktop app to get active window through system calls & browser plugin to get active tabs

it's a home project and not production quality tho
>>
>>62026358
As lead, I dish out the tickets because I know what how the software should work.

The other devs role and responsibility would be completing the tickets in a timely manner and hopefully offer suggestions if they think something won't work.
>>
>>62026439
Yes, there is a huge demand for it. Most jobs I have worked for use excel sheets with custom functions for time and bill calculations. It's pretty nasty currently.
>>
File: 1502640255185.png (38KB, 500x308px) Image search: [Google]
1502640255185.png
38KB, 500x308px
>>62026480
fugg i need to start working on this again
>>
>>62026480
>excel sheets with custom functions for time and bill calculations

What software is there currently out there that solves this problem? Why are these companies going to use your software instead of an alternative? Why aren't they using one of those alternatives now? A lot of people at those companies are used to their excel sheets and prefer them to the stuff already out there.
>>
>>62026576
don't need as many data entry monkeys putting shit into excel spreadsheets if you automate the process entirely
>>
>>62026576
not him but benefits are obvious, you could integrate time tracking with issue tracker, set hourly price according to issue type and of course automatically keep track of time spent instead of rough guesses after issue is resolved
you can also get graphs and stats about how much devs works and for which kind of work
downside would be you can't as easily mess with timesheets
>>
File: 1468795484682.gif (486KB, 387x368px) Image search: [Google]
1468795484682.gif
486KB, 387x368px
What do I need to know to be hirable with C# (skillset)? What kind of projects should I aim for for my portfolio?
>>
This is a dumb question but am I suppose to know which packages I need and how to get them set up before I start a node project? I just started learning it and it seems like every package depends on another and I have to set up a million things before the app even starts. I know is a learn-by-experience thing but it's kinda annoying when you leave one small thing out and the entire app doesn't work
>>
>>62026718
>leave one small thing out
What packages are you using here? You're using npm (or ideally yarn), right? Dependencies should be install automatically.
>>
>>62026628
Yeah, there's a little more to it that I don't want to get into, but there are some serious benefits to using the software I'm planning.

Also having competitors is ok, many competitors suck balls and don't even attempt to sell anything. My main competitor has a 1990s website and testimonials from over a decade ago.
>>
>>62027033
>many competitors suck balls and don't even attempt to sell anything
ye quickly searching either showed me generic attendance tracking stuff or personnal productivity / single user stuff
if you manage to integrate with jira or whatever services clients use you're gucci
i started mine to send myself notifications to take and return from breaks

good luck anon
Thread posts: 314
Thread images: 24


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.