[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/wdg/ - Web Development General
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 24
File: 1431344258923.png (747 KB, 824x553) Image search: [Google]
1431344258923.png
747 KB, 824x553
Death to PHP

> IRC
#/g/wdg @ irc.rizon.net
Web Client: https://www.rizon.net/chat

> Tutorials & Resources
https://www.codecademy.com/ — Learn to code.
https://www.bento.io/tracks — Start here if you’re new.
http://www.theodinproject.com/ — Alternative to above, focused on Ruby on Rails back-end.
https://developer.mozilla.org/en-US/Learn/Choose,_Install_and_set_up_a_text_editor — Choosing a text editor.
https://libraries.io/ — Discover new open source libraries, modules and frameworks.
https://www.coursera.org/browse/computer-science — CompSci courses.

> Getting Hired
https://pastebin.com/4YeJAUbT/ — NEET Guide to Web Development
http://elliotec.com/how-i-got-a-job-in-web-development/

Previous thread: >>51415730
>>
Sometimes I wonder if PHP is even more comfy than Perl.

I mean, at least that language knows the difference between actual arrays and hashes instead of just using ordered hash maps for everything, but treating them completely differently when they keys are numeric and form a gapless Range from 0 to to the number of items - 1.

And the standard Library also can't be much worse. Regex is built in... Where does PHP excel, compared to it?
>>
I'm sure there has to be a prettier way to implement this while in PHP, but I can't think of one.

while ($_index[0] && $_index[1] && $_index[2] == "" ||
$_index[3] && $_index[4] && $_index[5] == "" ||
$_index[6] && $_index[7] && $_index[8] == "" ||
$_index[9] && $_index[10] && $_index[11] == "" ||
$_index[12] && $_index[13] && $_index[14] == "" ||
$_index[15] && $_index[16] && $_index[17] == "" ||
$_index[18] && $_index[19] && $_index[20] == "" ||
$_index[21] && $_index[22] && $_index[23] == "" ||)
{}
>>
>>51469741
Does PHP not have for loops or something?
function () {
for (let i = 0; i < 23; i += 3) {
if (index[i] && index[i + 1] && !index[i + 2])
return true
}
return false
}
>>
Neet edition
>>
I have a question, what is the reason to use a framework for php.

I've built a basic cms with comments and login, signup with nothing but php (and parsedown for markup).

I'm still quite a noob so all I've heard is people blabbing about requests per second and crap.
>>
>>51469955
>reason to use php

no
>>
>>51469955
PHP is a largely unattractive language vanilla, so people use frameworks that reinvent half of it to scrape by. Performance-wise vanilla PHP is faster, but still slow in comparison to other languages.
>>
>>51469955
anon, ruby
ruby, anon
>>
>>51469894
Fuck me, it's so simple now I see it from another point of view, thanks.
>>
>>51469368
- Support: there's always somebody who know the answer to your problem.
- Cheaper hosting
- New actually usable libraries poping up all the time: perl has great libs but diminishing userbase so inovation halted at least until the perl 6 meme becomes reality.
- Easier to hire codemonkeys: even teenagers know the language.
- Easier to hire people who actually know what they are doing: perl gurus are dying from old age while it's easy to find relatively young php gurus with 10+ years of experience.
>>51469955
- Maintainability, productivity, support
>>
>>51470014
>PHP
>slow
kek
>>
>>51469955
PHP is a slow as shit language.

However, it is also really, really uncomfortable for web development, despite being made for it.

That is why Frameworks in PHP are a little problematic. Yes, of course you should use them. Unlike PHP, they don't make it easy to have huge security holes in your application. Unlike raw PHP, they make it easy to handle requests in a structured manner. You actually get good, tested components to handle common things. They're not full of surprises like the PHP standard library.

However, PHP being a slow as fuck language is a huge problem. These frameworks are abstracting much, but abstractions in PHP are incredibly expensive. Each function call, each class instantiation, even implemented interfaces add a rather significant overhead, and you get tons of those with every request. Who would want every request, even those that don't even hit the database, to take more than 150 milliseconds?
>>
File: 1420662258211.jpg (790 KB, 1920x1080) Image search: [Google]
1420662258211.jpg
790 KB, 1920x1080
>>51470146
Okay I think I fully understand now.
I think I'm going to just keep learning NodeJS since it's more modern.
>>
File: Screenshot_3.png (668 KB, 1919x901) Image search: [Google]
Screenshot_3.png
668 KB, 1919x901
hot or not
I decided to make two different concepts for the search bar. Which one in your opinion looks good, or alternatively how can I make it fit the theme better?

http://162.243.82.237/work-in-progress/streaming/
http://162.243.82.237/work-in-progress/streaming2/
>>
>>51470215
Don't listen to tards saying node.js is shit cuz they heard it's shit from other /g/tards, they can't think for themselves, it's perfectly good for low to medium demands
>>51470146
What other languages would you recommend for the server side?
>>
>>51470146
Ruby and Python are a bit slower than PHP.
But when you are dealing with http requests, response speed does not really matter, and if it does, your name becomes Twitter.
PHP is good for prototyping, and for people who do not expect 100000 users per second on day 1.
>>
>>51470146
nice bait. 10/10 made me post.

>uncomfortable for web development
dude i wanna see you devving in ruby or python without your meme frameworks to see what 'uncomfortable' means.

>slow as fuck language
what the fuck man, "python" and "ruby" are only now catching up with php when it comes to serving webpages to a huge number of users. ruby performance was absolute garbage until 1.9, which was largely ignored for years because of the gem breakage.

for the people reading this:
don't see this post as a turn off, you can use python and ruby and still have a big website with milions of accesses just fine, but you'll have to work on making it fast for your users. there are tons of tools and methodologies to help you with that. so just use what you feel like using and don't go with /g/ memes.
>>
Serious question: how do I implement TLS/SSL?

>>51470082
PHP: The language that would completely suck if everyone realised how much it completely sucked.

Every point you've mentioned is only true because PHP is popular... so is C#.

>>51469741
>>51469894
Sometimes I wonder if PHP devs are just deranged.
>>
>>51470233
the first one is better. make the search box background darker when the user clicks on it.
>>
>>51470108
Every benchmark in existence shits on PHP. Deal with it, faggot.
>>
>>51470427
yo not the other anon, but who gives a shit? its just a few miliseconds and isn't noticed at all on the userside. PHP is easy, great and works.
>>
>>51470268
>Don't listen to tards saying node.js is shit
Node is crazy awesome, if I wasn't hellbent on writing my own framework I'd definitely be using it.

>What other languages would you recommend for the server side?
C#

The most comfiest language for webdev.

>>51470146
>Who would want every request, even those that don't even hit the database, to take more than 150 milliseconds?
150milliseconds? Ohohohoh, try 1 millisecond, that's the average response time of a well implemented C# web server. Also, node too (did I mention that node is actually pretty freaking awesome?).

>>51470361
You shouldn't make posts like this on /g/, we actually have a handful of extremely experienced developers. In fact, the entirety of 4chan really is a den of underachievers.

>>51470427
The exception being when PHP is compiled into essentially C++ fastcgi code. But then you're really writing C++ that looks like PHP...
>>
>>51470390
The second one is not PHP. Good work.
>>51470427
Really? Does that means people do not use stuff slower than dynamic languages? I wonder why.
>>
>>51470215
I'd go with either node, python with pypy or elixir in your place.
>>
>>51470453
>The second one is not PHP. Good work.
I knew that, but having that many checks within a while condition is truly deranged. I wouldn't stop until I found an alternative, and this anon: >>51469894 found it in under 10.

>>51469741
>
while ($_index[0]  && $_index[1]  && $_index[2]  == "" ||
$_index[3] && $_index[4] && $_index[5] == "" ||
$_index[6] && $_index[7] && $_index[8] == "" ||
$_index[9] && $_index[10] && $_index[11] == "" ||
$_index[12] && $_index[13] && $_index[14] == "" ||
$_index[15] && $_index[16] && $_index[17] == "" ||
$_index[18] && $_index[19] && $_index[20] == "" ||
$_index[21] && $_index[22] && $_index[23] == "" ||)
{}

There is no way this guy can handle more than 15 requests a second if he has shit like that in his code.
>>
>>51470451
The issue I have with node.js and javascript in general is the userbase and tooling. I can't keep up with these hyperactive teenagers. I have to choose between earning money and staying up to date with the newest shiny library developed by a team under entirely different requisites that everybody uses.
>>
>>51470549
Then I ask you, does PHP has for loops?
>>
>>51470556
>is the userbase and tooling. I can't keep up with these hyperactive teenagers.
Stop. Take a step back, realise how elitist you sound.

>>51470569
http://www.w3schools.com/php/php_looping_for.asp

Seems like it?
>>
>>51470569
Since you are not getting my point, writing in that style of code is bad, but that is not PHP's fault.
>>
>>51470549
That's why I'm asking for help before implementing, thanks for stating the obvious
>>
>>51470556
I can understand that. The plethora of 101 DSLs, declarative/immutable/whatever meme frameworks and libraries does not aid in helping find your comfy spot. For me it's very light and time-tested utility libraries + ES6/7.
>>
>>51470592
I don't mean to, really, but it's really what it looks like. Maybe I'm too old for this shit and should go back to nativedev. The younger devs here come up all the time with "lets use this groundbreaking tool to help us with X, Y and Z" then the manager asks them how that thing will help us attend the customer requisites and they stay silent or mention that google/facebook/some new startup is using it and therefore we should too. It's like they are not in the real world.
>>
>>51470687
I have little conception about what you're talking about because I'm likely not in your timezone, let alone at your workplace, let alone from that specific meeting you're referring to.

My main argument for node is that it can handle around 2000 requests a second and most PHP implementations struggle for triple digits. As >>51470082 pointed out, the best reasons for using PHP is that everyone else is using PHP, which by itself is a ridiculous argumentum ad populum.

>The younger devs here come up all the time with "lets use this groundbreaking tool to help us with X, Y and Z"
I actually totally understand when it comes to front-end frameworks. If you feel "too old" to write good code, here is something you should recognise:
#include <iostream>
#include "fcgio.h"

using namespace std;

int main(void) {
streambuf * cin_streambuf = cin.rdbuf();
streambuf * cout_streambuf = cout.rdbuf();
streambuf * cerr_streambuf = cerr.rdbuf();
FCGX_Request request;
FCGX_Init();
FCGX_InitRequest(&request, 0, 0);
while (FCGX_Accept_r(&request) == 0) {
fcgi_streambuf cin_fcgi_streambuf(request.in);
fcgi_streambuf cout_fcgi_streambuf(request.out);
fcgi_streambuf cerr_fcgi_streambuf(request.err);
cin.rdbuf(&cin_fcgi_streambuf);
cout.rdbuf(&cout_fcgi_streambuf);
cerr.rdbuf(&cerr_fcgi_streambuf);
cout << "Content-type: text/html\r\n"
<< "\r\n"
<< "<html>\n"
<< " <head>\n"
<< " <title>Hello, World!</title>\n"
<< " </head>\n"
<< " <body>\n"
<< " <h1>Hello, World!</h1>\n"
<< " </body>\n"
<< "</html>\n";
}
cin.rdbuf(cin_streambuf);
cout.rdbuf(cout_streambuf);
cerr.rdbuf(cerr_streambuf);

return 0;
}

13000RPS

This is what pure code without any frameworking should look like. Nowadays, it's even what PHP looks like when you go deep enough.
>>
>>51470772
You can't build a web dev team of C coders, it will fall apart after a week.
The main bottleneck in http requests is the database access, and incorrect cache implementation.
>>
>>51470832
I mean, in web applications.
>>
>>51468957
I made a one-way data binding library, so you can do shit like this:

var fragment = document.getElementById('product').content
var bindings = bind(fragment, {
name: bind($('.name')),
details: bind($('.details'), {
size: bind($('.size')),
vendor: bind($('.vendor'))
})
})

document.appendChild(bind(data, bindings))


http://simulacra.js.org

[autism]made it because react.js is sluggish, bloated garbage. it's also literally the systemd of webapps, as more and more new shit is tightly coupled with it, even stuff that doesn't have to do with rendering dom elements like react-router.[/autism]
>>
>>51470832
>You can't build a web dev team of C coders, it will fall apart after a week.
No, it won't, it was done all the time before runtimes became popular.

>The main bottleneck in http requests is the database access
No it's not, plenty of databases are real fast, like redis or mongo.

>incorrect cache implementation.
pfft, not even Microsoft knows how to implement a cache correctly. Provided you have a quick way to load and store hashes, as well as a quick way to hash, it's reasonably infeasible that caching is your bottleneck. In actual fact, reading and writing to a network stream is extremely tolling, so if you can get away with writing 0 message content and a 304 you're better off than writing kilobytes of data with a 200.

PHP was never meant to be more than WordPress scripting. You weren't seriously meant to use it at your serious big shot company, depending on the era you were meant to use C++ or Java or C#.

That's what's epic about node: it's just as fast as what I just mentioned, or rather fast enough for people to stop caring how fast it is, and it's not a bigboy language that makes people think their team is going to "fall apart" if they use it.

Seriously, who the fuck is your workplace hiring? C++ is taught to all engineers.
>>
>>51470937
Redis is just a temporal key/value database, and NoSQL databases can't be used in every project.

I'm not answering your asumptions, but how much a web store would cost in C++?
>>
>>51470910
>because react.js is sluggish
My experience has been completely different. The angular version of my application was much slower, not to mention all the blinking every time I updated something. The react version is much faster both in my 7 year old computer and my new mid-range windows phone.
>>
>>51470427
lol, "hello wrold" benchmarks?? who gives a fuck about those.
>>
>>51471073
Show a non-hello-world where PHP is not raped by anything half decent.
>>
>>51471109
Omg, 0.1ms vs 20ms! But the http request from France took 300ms. Pity.
>>
>>51471109
I fell for the meme of "php being slow" once, then I tried django.

It surely was faster, until i connected a DB to it. Then it became same speed as my php app. So of course I dropped it and returned to PHP.
>>
>>51471056
that's like comparing morbidly obese to moderately overweight. both frameworks take a non-trivial amount of time to even load and the performance is significant worse than hand-writing dom manipulation code.

simulacra.js is actually faster than appending innerHTML (not that it's the most efficient way to update the dom, just a comparison), because it provides "offline" mutations by default, working with dom nodes that exist in memory but not in a live tree.
>>
>>51471143
Have you never heard of pypy?
>>
>>51471159
Does Pypy increases network speed between the client and the db server and optimizes queries?
>>
>>51471175
No, it's a JIT compiler.
>>
>>51471189
Oh, interesting :^)
>>
>>51470772
Well, popularity is THE selling point for PHP. There are lots of better languages out there but PHP is just "good enough" and already used in a bazilion places so adoption of other things is hard as fuck.

What good is for a business if it uses the best language ever yet hits a wall every time a new issue pops up or, even worse, can't hire any experienced programmer?

How many places have replaced Linux/BSD with plan9?

>>51471148
Well I have an entire chain of tools working in my favor, maybe that's why things aren't so bad for me. My "vendor.js" has jquery, react, react-dom, moment and pikaday and is 1.6MB in development mode but ~250kb in production. There's some aggressive caching too so after the first load the user only really downloads it when something changes or when the browser cache is cleared.
>>
>>51471228
>Well, popularity is THE selling point for PHP.
That would be fine, except it's PHP's ONLY selling. You wouldn't use it at all if it wasn't popular because it wouldn't have any strong points at all if it wasn't popular, again, argumentum ad populum: the language.

>can't hire any experienced programmer?
There are plenty of better languages which are similarly popular. Beyond a few disgruntled children "falling apart" from big boy languages, Java and C# are both popular and have the potential to look elegant.

>How many places have replaced Linux/BSD with plan9?
That comparison would be like comparing C# with Vala, with PHP being Windows server.

>My "vendor.js" has jquery, react, react-dom, moment and pikaday and is 1.6MB in development mode but ~250kb in production
Jesus.

Why do you need this?

>>51471206
Don't get too excited: it doesn't work with all python networking libraries.
>>
The best local VPS hosters seem to be completely unmanaged. As if I'd want to deal with that shit. And the managed ones can't deal with high traffic.

What VPS host would you recommend? Or should I just learn about debian/centos security and get an unmanaged one?
>>
>>51471228
i work with react + redux + webpack + babel on a daily basis and it's total clusterfuck.

keep in mind that it's not only the upfront cost of requesting that much code, it must be compiled to execute (slow on shitty mobiles), and a 250kb payload is a no-go for spotty internet connections.

also when you've got to debug and look through react's shitty stack traces and dig through their 40k loc codebase, good luck. it's a pile of unnecessary, bloated abstraction created by "Senior Front-end Engineers/Architects" at facebook whose job seems to be to push needlessly complicated shit on average to mediocre webdevs.
>>
>>51471344
Coldfusion is popular, based on some statistics, and it is not being used at all in new websites.
My point is that Pypy won't fix his app, if the main problem is the database access speed.
Java already has 20 years in production machines, and companies will never update those Java 5 projects.
>>
>>51471439
http://lowendbox.com/

Find one that's less than 5$ in your area. You want to buy within your area, because fools will think you're a better developer if your website responds quicker which is advantageous provided you're applying for jobs in your area.

I wouldn't doubt that people viewing my site from overseas think it's shitty for the same foolish reasons.
>>
>>51471439
I was a bit skeptical at first, but digitalocean seems to be pretty great. You can't host shit like http botnets etc on there, but you pay for the hour and even the $5/month plan is pretty great compared to other hosting solutions.
>>
>>51471446
just wanted to add that the web used to be goddamn simple, and that's what i want to bring back at least partially with my own code.

webdev was supposed to be something that anyone who is so inclined to can put up a website. in 2015 putting up a website seems to involve learning a dozen different css frameworks and tools, the hottest hipster js framework of the month, following the latest fad design trends, using the coolest build pipeline, setting up virtualization/containerization, using bleeding edge network layer like graphql which is also garbage, and just being a fuccboi for whatever is trendy right now without understanding a goddamn thing. this is why webdev is cancer, and you're a part of it.
>>
>>51470451
The bad thing about C# is Microsoft, besides that, it's a cool language.
Also, Scala Play! is pretty good IMO, all that Java can offer, both food and bad.
>>
>>51471579
>it's bad because it's microsoft

can you elaborate.
>>
>>51471563
The same people we're raging at view development in general as a fad. It'll pass.

My ideal is a few jQuery appends and a backend serving JSON.

>>51471579
>The bad thing about C# is Microsoft,
>lol what is mono?
Stop it, go away.
>>
File: a.webm (773 KB, 400x500) Image search: [Google]
a.webm
773 KB, 400x500
rate my app ?
>>
>>51471887
>using bootstrap or any css template at all
0/10
>>
>>51471887
please fix the short appearance of the bottom fields when clicking play
>>
File: Screenshot_4.png (2 MB, 1044x715) Image search: [Google]
Screenshot_4.png
2 MB, 1044x715
hot or not cyber bullying edition
rate my bullying page
>>
>>51471887
fake and gay
>>
>>51471887
Needs more competition, as in two partners against each other, but that's a conceptual thing. Have the code for it?

Design wise, I don't like the mix of colours, in general you should follow a cool colours warm colours thing.

>>51472040
How could you possibly know that?
>>
File: Screenshot_5.png (2 MB, 925x736) Image search: [Google]
Screenshot_5.png
2 MB, 925x736
>>51472067
OOPS forgot the link
http://fred.nigga.li/

hot or not cyber bullying edition
>>
>>51472089
>Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/html/about.html on line 20
>Warning: Division by zero in /var/www/html/about.html on line 23
What are you using sql for anyway?
>>
>>51472153
notice how it says .html. I'm seeing if freddy is dumb enough to believe its actually a sql error at which point I can bully him even more.
>>
>>51472185
file extensions don't matter all, you can run ASP.NET in a .php file if you want.
>>
>>51472040
>>51472086
I'm shit at design. Even if it looks gay, it's still better than without bootstrap.

About competition, you get or loose points at each rounds. The points you loose or win depends of your score, your partner score and the word difficulty.
And a ranking page to know where you are.
>>
>>51472238
whatever, weeaboo. that error has nothing to do with whats happening on the page either way, so he'd still be retarded if he believed it.
>>
>>51472261
what
>>
>>51471887
I can tell that's Bootstrap just by looking at the buttons.
>>
I skipped javascript and went straight into php. But I guess the necessity of caching + ad rotators means you have to use javascript anyway.

But making ad rotator is probably the simplest thing you can make.
>>
>>51472315
javascript and php both do different things.
>>
What the hell am I doing wrong here? I want to make a Vector class in TypeScript but I keep getting:
test.ts(11,10): error TS2346: Supplied parameters do not match any signature of call target.


This is the test.ts file
class Vec2 {
x: number;
y: number;
construct(_x : number, _y : number) {
this.x = _x;
this.y = _y;
}
}

var v2 = new Vec2(2, 5);


I have similar code all over the place but this just doesn't work, I've made sure that there are no other classes called "V2".
>>
>>51472347
I know, but so far I never needed javascript.
>>
>>51472367
it should be constructor, not construct
>>
>>51472420
Ah fuck me, that solved it. I was blinded by autocomplete.

Thanks!
>>
>>51472384
I don't doubt you see it that way.

A good design strategy is to separate code that's for visual/display and code that's for data storage/handling, everything in the middle is in limbo. If you're handling display code with php, you might be doing it wrong.

In a way, I'm highly suggesting JavaScript for creating your views, like if you wanted to change the colour of something or whatever.
>>
>>51470390
hi, have you ever even web deved ever?
php is amazing. if you dont think its at least great at what it is meant to do, i seriously doubt you have anything to back up your opinion
>>
>>51472782
>php is amazing
>>
>>51472600
>I'm highly suggesting JavaScript for creating your views
no thats a terrible idea..
>like if you wanted to change the colour of something or whatever.
oh, yeah do that

if you imagine the front end like a theatre play or something, php should set up the backdrop, the props, the actors. the setting in general.
to make the actors jump around and sing etc, javascript is the way to go.

swapping the roles between js and php is a head ache for everyone, for the dev and for the poor end user who has to actually use your frankenstein ui
>>
>>51473035
but that's how a lot of sites work today.
front end entirely in javascript which just talks to the backend over json.
>>
>>51473058
But then the backend is only the script.
>>
>>51473091
eh, script? what you mean?
>>
>>51472782
But it's actually not... So many people will tell you that despite being designed specifically for it, despite being a popular language for it, php is a bad web language.

Meanwhile, Microsoft and Oracle put a lot of work in their web libraries, they're extremely mature as well as performant, whereas your attitude towards a language that wasn't intended to compete with either is not. Php is great for your wanky WordPress site, but that's the end of it. Try running a 10,000 person service with it and it'll fall apart.

>>51473035
>>51473058
I'm trying to imply MVVM.

>>51473091
>>51473098
He does the horrid, MVVM breaking thing of mixing php code with html code.
>>
how familiar should i be with HTML and CSS before i go into javascript?

i've only read a couple books, done the codecademy course and made my own simple site with divs and stuff.
>>
>>51473194
you'll learn while doing everything, just think of a project, split it into small parts and then look up how to do each.
>>
>>51473194
>couple of books
I'd say you're ready.
>>
>>51473194
After knowing the basics I learned css on a need to know basis. Never read a single book about it. Just created some static websites and a wordpress theme with some hover effects and that's that.
>>
>>51473058
hmm that is true. it really depends on what you're going for, how dynamic you want things.

i still stand by my statement that js should mostly be used for event handling, not structuring your document. js feels like a very "hacky" language when it comes to doing some heavy changes to the dom. if you initialize things correctly from the server, you'll be making your life a lot easier.
>>
>>51473225
>>51473211
>>51473240
thanks m8s. that's kind of what i figured, but i didn't want to forget what i learned already by overwhelming myself. i guess i'll be going back to HTML/CSS all the time so i'll be getting constant refreshers anyways.
>>
I wish nodejs wouldn't be such a clusterfuck.
You get random error messages because some deep hidden dependency got updated and is now incompatible and now nothing works anymore.
I just wanted to work a few hours on a project and all I did is play around with version numbers and waiting for npm install to finish.

Who thought this was a good idea.
>>
>>51473194

Javascript is entirely different to both HTML and CSS so it's fairly unimportant when you begin - it will be a lot harder to understand than those two though
>>
>>51470108
How can you ever win at speed when your language is interpreted ? Think about it..

PHP would be totally unsuitable for environments where performance was paramount. But if you just want to serve your shitty e-commerce site, or blog then it's fine.
>>
>>51473194
html is n difficulty
css is 2n difficulty
js is n^2 difficulty
>>
>>51472979
>in-depth reply
>>51473128
Oracle bought several of their current trademarks, however the support is good.
Try using PHP-FPM and Nginx for said person service (yes, and adding some cache here and there).
>>
>>51473319
That's why you have OPCode caches, and I'm not saying you should code a spaceship in PHP.
>>
File: soundcloud0.jpg (170 KB, 2048x1536) Image search: [Google]
soundcloud0.jpg
170 KB, 2048x1536
does anyone know how this site works?
you can fucking nav from page to page with the media player never skipping a beat. it completely blows my mind.
>>
>>51473397
javascript framework.
all it does is exchange data between an API and then renders using javascript, the site never refreshes or reloads, thus you can have an element persistant.

see angular, react, emberjs and the other fifty thousand frameworks that exist.
>>
>>51473397
History API, the page is never actually reloaded.
>>
>>51473397
I take it that everything is dynamic with ajax loading so the actual audio stream never goes away but the content of the page being lazily loaded when you nav to and from.
>>
>>51473397
The web browser was made as a tool for viewing separate documents that were hyperlinked together.

We've hacked the shit out of it's capabilities to create rich applications like that by simply not using it in that way anymore. Except for the first page load.

The general term is Single Page Applications if you want to find out more.
>>
>>51473397
https://signalvnoise.com/posts/3112-how-basecamp-next-got-to-be-so-damn-fast-without-using-much-client-side-ui

tl;dr; something like https://pjax.herokuapp.com/
>>
>>51473321
I disagree. Js is easy to grasp if you've done any other programming languages and if you learn it as your first, it is probably easier than anything else besides python/ruby
>>
>>51473321
css is infinite difficulty because even when you normalize shit the browser tells you to fuck off with your styling rules and displays it like the fag enabler CEO of the company behind the project likes instead.
meanwhile you get death threats for not meeting the deadline.
>>
>>51473397
It's a SPA. You aren't really navigating from page to page. The window.history is being updated manually.
>>
How to kickstart /wdg/? Just start bitching about PHP..

If php is a meme, why do so many people care about it?
>>
>>51473569
Everyone's tsundere for PHP.
>>
File: a3.webm (420 KB, 548x700) Image search: [Google]
a3.webm
420 KB, 548x700
>>51472066
ok.
>>
>>51473666
much better
>>
>>51473666
good job, satan
>>
Is Dart ded? They are still releasing new versions.
>>
/g/, what do you use to host static websites?
>>
>>51475395
A VPS?
>>
Why would I ever use contenteditable over Textarea? Why does this attribute exist?
>>
>>51475395
u can use github. I think you can also change the name from the github to something else but I never looked too far into it.
>>
we all should tripfag
>>
Does using bootstrap in my own projects make me a worse designer?
Is that why it is frowned upon here?
>>
>>51475525
Can you use github to host any static websites? or does it have to be related to a technical project?
>>
>>51475791
you seem confused

designers don't use bootstrap, web developers do

the vast the majority of designs don't confirm to bootstraps grid and component system, so why fight an uphill battle trying to override a million things when you can just build it from scratch and do it right from the start
>>
>>51476442
Moral of the story here, use whatever is the least amount of work.

And tell the fucking designers to stay within a grid.
>>
I enjoy programming but not taking it as far as "real programmers" like the ones in dpt. Can webdev be a viable career for me?
>>
>>51475791
Who's frowning ? Bootstrap is great.
>>
>>51476719
Yep, but knowing how to "really program" is a big plus too.
>>
>>51476719
Meh, you can "program" for "real" with JS nowadays, it's not bound to the browser anymore.
>>
>>51476719
this is generally the reason people do webdev
>>
>>51476442
Designers themselves are following more or less common web trends, such as:
- main container in the middle with largely empty sides (the web 3.0 page format for responsive layouts)
- content divided horizontally among 3 or 4 columns
- horizontally placed columns in the desktop layout collapse on the vertical in the mobile layout
Etc.
>>
>>51476160
Bump
>>
>>51476160
any
>>
>>51475491
WYSIWYG editors, for example
>>
Question about Single Page Applications

I've written several HTML pages, and several Javascript applications, for a Javascript class I decided to take.

All of these pages have their html, css and assets in an html folder, and their scripts in a scripts folder.

This made it easy for my to write a little server in node that put together a homepage with hyperlinks to each file, which I thought was neat.

Anyways...

Would it be overkill or stupid to try to make a single page application that shows any of these pages? Say rather than taking the user to /html/somepage.html, when a button/link/nav is clicked, maybe a central div that takes up most of the screen is just updated. I think this is what iframes are for?

The advantage here would be that I'd only have to load the new content and the navigation elements wouldn't needed to be reloaded.

Bad idea?
>>
>>51480129
From what I know about single page application :

When someone get to your website, you send a minimal HTML page (just the central div you talk about) and a JS script.

Then everything is done by the script with AJAX calls; a GET/POST request that answer with JSON.

With this json, the script rebuild the view with DOM shits and shats.

So your buttons are not links anymore but JS functions.

Not sure if right or accurate, but it's a reply.
>>
How do I make a bunch of jquery $.ajax requests in a specific order without having the page freeze? Honestly have no idea how to structure this. My brain doesn't think asynchronously properly.
>>
>>51480635
Also, I have NO idea how promises and whatever else jQuery provides is supposed to remedy the callback hell I can probably implement this with. Makes zero sense to me.
>>
>>51480671
>>51480635
asynchronous and callback hell are supposed to be server side problems (node.js)...
>>
>>51480635
>>51480671
Still me; came up with this. No idea if I'm on the right track or not.

$(toDo).each(function(i, v) {
$.when(v()).done(function() {
console.log('Done with toDo[' + i + ']');
});
})


Basically each element of the array has a function that returns whatever $.ajax returns, which I've been told is a promise. Hopefully this makes the loop "wait" without blocking the page's UI.
>>
Question.
How many of you have jobs/get paid for web development? And do you have to work in an office or for home. Was just wondering if its mostly from home or it matters where you live.
>>
>>51480129
>Would it be overkill or stupid to try to make a single page application that shows any of these pages?
Yes.

To put it not so eloquently, SAP is great for in page apps but not the web pages themselves, since that would break navigation. So if you had a game, a chat/forum thing, a tool for doing such and such, please do SAP.

Meanwhile some of the worst sites posted on /wdg/ are SAPs, purely by accident you can press the back button and lose your place. Its very unpleasant.

>>51480635
The order thing makes it difficult, you can't tell when a request finishes and so you can't force it into order. You could call one request from the other, but that would be slow. You actually asked a challenging question.

Alternatively, create a data structure and load content into it and allow the final request to fire a function that actually presents that content into the view, you could even order that data structure before presentation so that the order of the finishing requests doesn't matter. The tricky here is knowing "which" request is the last, maybe you could have a simple global variable that counts the number of completed requests?

The way I fixed this was actually by sending more information from my backend, so I didn't have to send multiple requests. I couldn't find a way to rectify the timing of Ajax requests either.
>>
>>51481042
>>51480946
>>51480671
>>51480635
Just found http://stackoverflow.com/questions/21372320/how-to-chain-execution-of-array-of-functions-when-every-function-returns-deferre. I think it might be a solution.
>>
>>51481033
I've been working for about 9 months now. I work four days in office and one day at home. But I'm not liking the job. So plan on saving up some money and applying again at some point.
>>
If you aren't using Django/Python and you are a serious backend developer, then you are a fucking RETARD who will be OBSOLETE in 5 years.
>>
>>51481086
So now I have this. Is it good practice? More importantly will it work?

var promiseChain = toDo[0]();

for(var i = 1; i < toDo.length; i++) {
promiseChain = promiseChain.then(toDo[i])
}
>>
>>51481086
The issue I see here is that

>He'll either perform all the requests first and then render presentation, which is slow
>He'll perform the requests and render presentation immediately, but in the wrong order

My advice stands that he either send more data from the backend or deal with a data structure.
>>
>>51481138
Cute.
>>
>>51481138
Some of us prefer having more than double digit requests per second. My latest benchmark got up to 7000 requests per second, a point it hasn't been since I started parsing the headers. To me it's simply a matter of pride.

BTW, I tested Django, it refused pypy and resulted in about 100 requests. That's... Great, slightly faster than php.
>>
>>51481146
https://github.com/kriskowal/q
>>
>>51481215
Are you using Laravel, Slim or raw PHP for your tests?
>>
>>51481219
This is what I was talking about. That's barely an improvement to callback hell.
>>
>learn html
>know good amount of CSS

i still cant put together a website.

I need to be able to make horizontal navigation bar. Floating does nothing, inline block does nothing.

I dont even know how to make the actual bar itself. how the fuck do you guys do this shit when literally every book and tutorial site just cram mini lessons randomly down your throat?

>here make this text blue
>ok now resize this image
>now make this shake
>CONGRATS YOU ARE A FRONT END DEVELOPER :)))))
>>
>>51481263
look up tutorials for how to make a horizontal nav bar
It's how I made mine @ joeburger.ax.lt
It's just a list of lists mang, the rest is css wizardry
>>
>>51481233
No, I might have to figure out hhvm for the tests, but otherwise most interpreted languages in general don't fit on the scale of the graph I'm using. If I'm graphing on a linear nanosecond scale, from 0 to 1.5, it'll just look ridiculous to include most interpreted languages.

Php without hhvm is slow. Real slow. Slow enough that you simply can't expect serious web servers to benchmark against it.
>>
>>51481138

I use Django at work and really love it, but dude, you are being a bit rude in your advocacy. Unless you are some cunt that's trying to make Django developers look bad.
>>
>>51480946
I mean, you could put them inside each othe ror use callbacks, I believe
>>
>>51481294
From 0ms to 1.5ms, sorry
>>
>>51481263
CSS can be hard, but it is mainly knowing how things interact.

That being said, there are a shit ton of tutorials online for what you're looking for.

Lots of people get shit on by CSS. I find it kind of funny, because it did/does happen to me but many of the problems are so easily solvable.
>>
>>51481146
async function () {
for (let bar of toDo) {
await bar()
}
}
>>
>>51481233
Same guy who responded to this same post

This makes me not want to benchmark hhvm: http://dan.hersam.com/2015/02/25/go-vs-node-vs-php-vs-hhvm-and-wordpress-benchmarks/

Yes, if it's only a few hundred requests slower than node (for comparison, node gets 2000 requests a second on my pc) it's not bad as far as performance goes: your users won't have the "this site sucks" feeling you get with slow backends. That being said it's still slower than node and will still warp my scales.
>>
>>51481367
can you imagine the first people who tried using CSS to make that shit? probably drove them nuts.

im replicating the bbc website and i literally had to use a border around the bbc img and make every side but right black just to get it to replicate the actual website. im sure they didnt do that to get the desired effect.

i watched a tutorial for a 200 dollar course i got free on Udemy and the guy says how hes been a web dev for 10 years meanwhile hes making mistakes while coding, then ends a video and continues the next one with the fixed code and just says "use this instead"

like wtf is everyone who teaches css retarded?

every css tutorial site just teaches the same things. i need to learn how to implement them

and i cant even try to replicate most websites because the websites themselves are fucking dynamic and spammed with javascript or heavily bordered by photoshop cropsm
>>
>>51481461
I did part of that course.

>I need to learn how to implement
Isn't that you putting together the pieces? It's more likely that you don't know enough about CSS to do what you want.
>>
>>51481294
There are several important things for application benchmarking:
- How fast can a language deliver a page. If you need to do tons of calculations, then C#, Go, Java and other compiled languages are better suited for the job.
- How many requests can be completed at the same time. For extreme concurrent tasks, node.js, Go and Elixir/Erlang are good. I wonder how C# vs Java do here.
- How well do the database queries perform, and how the database connection does. This is always the main bottleneck.
- How fast is the network between the client and the webserver. Most important websites have CDN's and servers around the world.

Most websites do not need optimization over any of these items. If they need to, they can switch to a faster language than Ruby, PHP or Python. Twitter was written on Ruby for a while. Reddit rests over thousands of Python servers.

Oh, and Wordpress is a bloated mess, benchmarking it won't give good results without caching.
>>
File: uWhat.png (50 KB, 1858x1080) Image search: [Google]
uWhat.png
50 KB, 1858x1080
can someone design me a website that doesn't suck?

>pic related

lol
>>
>>51481551
let me explain a little further since i was kinda vague. i know syntax. by some miracle i made an okay looking site. i know how to color, and floating/clearing is starting to click for me.

i passed all the css parts of every tutorial or lesson ive taken, but i still cannot understand how to do navigation bars and some other things.

maybe its the fact that i just dont know what to make.
>>
>>51481640
Offer some compensation, I'm sure there are plenty of people here who'd be happy to help.
>>
>>51481552
>There are several important things for application benchmarking:
>- How fast can a language deliver a page. If you need to do tons of calculations, then C#, Go, Java and other compiled languages are better suited for the job.
By making connections fast, but every thing else slow... I'm screaming fraud. To be honest I don't even believe my own 7k benchmark because it too feels like fraud.

>- How many requests can be completed at the same time. For extreme concurrent tasks, node.js, Go and Elixir/Erlang are good. I wonder how C# vs Java do here.
Actually C# since 4.5 excels here and has a lot of concurrency features JavaScript is only just getting. This is why I'm thinking fraud: I added more threading and now my backend is magically faster? It's possible that apache bench is accepting the wrong response per each request, in which case it'd explain why the last request sometimes times out. Fraud.

>- How well do the database queries perform, and how the database connection does. This is always the main bottleneck.
Still arguing this is inconsequential. Provided you're not squeamish about serialisation, you can achieve the same effects of a database with the dictionary data structures in java and C#. You can actually walk into a network engineering lecture and the professor will even talk about how rolling your own is better for both performance and security.

This is all the individual users choices and so not my problem. What I can test is the purely networking elements, which I have.

Also, its not always so simple to just use another language. If you start in ruby, you're stuck in ruby until you man up and rewrite it in a "fast" language. Personally I see modern C# as one of the simplest languages, when people talk about interpreted languages, its usually because it's easier to write in. I see that's the case against C or C++, but far from true for C#.

So why not just start from a "fast" language to begin with?
>>
>>51481801
how long does it take to design a website? I'm a poorfag but I have some money.

I could make the design the designer makes for his own site in compensation for designing my site, too.
>>
>>51481769
You can do a nav bar any way you want.

The most common method right now is to make an unordered list of items and add some links inside each. Then make each item display as inline-block and float it, if I'm not mistaken.

Or you could just make it using a bunch of inline divs, like a caveman. If it works in the same way, sure, you could do that, right?
>>
>>51481947
It really depends on what you want.
If you want a great looking website, and don't care that it's made with a common framework, take a look at sites made with wordpress. It's the #1 blog/personal site framework, open source, and uses PHP for the back-end.

I've seen some very nice looking sites made with wordpress, by people who can't program for shit. So if you got someone from this thread who uses wordpress you could expect a very polished product.

Using a CMS like wordpress (content management system) is probably what you want because it gives you the ability to post more content to the site without having to program anything; it gives you options, like facebook, myspace, or instagram, to upload things. It's like, blogging software.

just go google wordpress and come back
>>
my AJAX call is to an API and one of the parameters specified is a latitude and longitude like "1234.1,55.23"

It's the yelp API. An example of the call is on the page and it uses a comma. When I make the AJAX call it converts the comma to "%2C" in the URL.

My question is are these sorts of things equivalent in general when making API calls? I'm surprised they use a comma to demonstrate it if so.
>>
>>51481640
- top looks good
- swap the "hi my name is anon" colors and make it default on the body
- use the pink for link color in the body
>>
>>51481640
Don't center pan everything, use margins.
Don't mix blue and red, at least not that vibrant shade of red: knowledge of cool and warm colours is your friend.
Don't have so much wasted space, your navigation has too much upper and lower padding in my opinion.

>>51481461
Most people who only do front end are. If he's teaching CSS, there's a possibility he's that guy whose contribution stops short at picking colours, making a logo and bullying the real programmer into implementing bizarre effects. My advice to completely skip learning how to git gud at design is to simply copy and otherwise keep it simple, programmers are one of the few people in the world who actually benefit from the aesthetic known as minimalism (boring music, horrible visual art, plain architecture, but amazing websites and apis).

Back end developers talk about some extremely deep concepts relating to apis, which actually translates to other applications of programming, not just webdev. They're generally good people to listen to even if you never want to implement your own http server.
>>
>>51471073
$ echo "hello world"
>>
>>51481865
What if the server goes down before saving? I would not trust a custom memory database in production.

One can learn C# from the beginning, and once he masters it, he can continue with other languages to see if something is missing.
>>
>>51481989
I already know about WP. That did give me an idea, I coudl just steal the color schemes/how themes look and use that lol.

>>51481769
doing a nav bar is putting together some stuff you already know. You could float them all left, put them all inline, etc. There is a wide variety.

>>51481997
thanks for the advice, I'll try it.

>>51482020
I'll see how that looks too. I'm not sure what you mean by cetner pan. Do you mean not to center align everything?
>>
>>51482057
Then you lose a day at worse, or an hour if you serialise hourly. If things go down, they go down, it's meant to suck.

You just gain so much performance though, compare how long it takes to establish a db connection to how long it takes to add into a dictionary. Also, there's a lot you can do with a data structure that you can't with a database program, like start using a completely new class of data.

>>51482071
Yeah, center align eh I'm not much of a front end dev.

It's fine for titles and banners, just don't do it for everything.
>>
>>51482239
I'll center align u ;)
>>
Hey guys C# gamedev here, I'm currently learning webdev and finding the html part too easy, is it going to get more complex or is everything as easy as using <something</something> to get what you want?
>>
>>51482333
JavaScript has a few gotchas but no, it's pretty easy. It's also something every modern developer needs because a lot of programming head hunters don't take you seriously until you have a website.

Learn CSS as well, jQuery too (specifically append, prepend and html functions), be prepared to rely on your database/backend a lot (always pass around json) and to be honest you're doing better than the scrubs that have convinced themselves they absolutely need ever framework, plugin and library that hipsters are currently talking about.
>>
>>51482333
html will be that easy. some tags u do't need the closing one but most of the time it doesn't matter if u put them there anyways
>>
File: Untitled.png (9 KB, 1350x660) Image search: [Google]
Untitled.png
9 KB, 1350x660
Guy who is doing the bbc.co.uk copy here.

How can I get "more" link larger than the others? Do I just add more padding on that one <li> ?

http://codepen.io/anon/pen/gayJmJ?editors=100

sorry my css is in the html file ;_ ;
>>
I want to start learning Node.js. What editors do you guys recommend? Are there any out there with code completion, or am I going to have to just write it in vim or sublime text?
>>
>>51482333
It will get harder. You will find a lot of fun when you get into scripting. I knew everything about HTML4 when I was 10; I wouldn't expect anyone to have difficulty with it.

Go dive into jQuery if you want something fun. Afterwards learn how to use the 4000 frameworks everyone wants you to know in the 6 different languages they need and with a chinese keyboard and the boss wants your kidney. 12/hour.
>>
>>51482479
vim and sublime text don't have code completion for node.js?
>>
Should all pages be https or is this bad practice? I always see login, register, pages dealing with CC numbers, etc in https and the rest http. What's wrong with having whole site https?
>>
>>51482503
I am using the free Sublime Text 2 and it doesn't. Maybe there is some add on that does it...
>>
>>51482525
look for an add-on. sublime text doesn't support ancillary shit like node.js completions completely on its own. that's why there are extensions.
>>
>>51482456

i just realized my link was "anon/pen/gay" :(
>>
>>51482532
This. it's generally assumed that you tack stuff onto your editor to suit what you do instead of bundling everything with it at first.
>>
>>51482511
Nothing. In fact HTTP/2.0 will be TLS-only.
>>
Is php rejection hype a meme? Why do you guys hate it and what do you use instead?
>inb4 asp.net cancer

I, an anon who hardly ever come to these threads, demand answers.
>>
>>51482511
>>51482589
Well when data isn't transferred between client and server there is no need to do https to begin with
>>
File: untitled2.png (9 KB, 1357x658) Image search: [Google]
untitled2.png
9 KB, 1357x658
>>51482456

update for anyone who cares

I got it working.

i put a div around <li>more</li> but i also added the little arrow image as well, so now it looks like

<div id="more">
<li>More<img src="images/more.png" /></li>
</div>

then in the CSS

#more {
float:left;
display:inline-block;
}

#more li{
float:left;
padding-top:15px;
padding-bottom:5px;
padding-right:10px;
}

#more img{
float:right;
margin-left:80px;
}

Can't believe I made progress...
>>
>>51482721
Because they think it's the only language with injections and that showing all of their code as client-side javascript is smarter.
>>
>>51482721
I use Elixir
>>
File: stare.jpg (94 KB, 533x505) Image search: [Google]
stare.jpg
94 KB, 533x505
I'm totally lost here with dates:
I have two dates, I use date_diff to get the difference between them, then I want to multiply the amount of days for a number, yet I have no idea how to convert the timediff result to int, was trying to save the date to a variable, but, fuck I'm confused as shit
  
$today=date_create();
$otherday=date_create("2015/11/23");
echo date_format($otherday,"d/m/y");
$timeDiff=date_diff($today,$otherday);
$ctime=date("d", $timeDiff);
$cost=$ctime*15;
echo $cost;
>>
>>51483077
Why are you doing this in php? You realise it'll only work with the backends time and not the users time?
>>
>death to php
God, I fucking wish. There's nothing better though. Nothing.

>insert latest meme language/python/perl/whatever here LOL
Worse than PHP, and that's fucking amazing.
>>
>>51483115
I need it for a retarded test, teachers don't want functionality but to annoy you.
Anyways, what I need to do is
get the date from an object, then the current day, get the day difference between both dates, then multiply the result by 15 to get the cost of the rent.
>>
>>51483141
I bet "death to PHP movement" is caused by devs wanting to be above the currynigger competition.
>>
>>51482757
story of my life. It gets easier, you get faster, you get to the point where you can just throw things around for an hour without ever running it, then run it, fix a couple errors in a couple minutes, and repeat.

Then you begin focusing more on the architecture and the structure so that you aren't having to repeat yourself too many times.
>>
>>51483165
php really is awful though.
>>
File: Screenshot_2015-11-22-22-47-50-1.png (261 KB, 1277x1026) Image search: [Google]
Screenshot_2015-11-22-22-47-50-1.png
261 KB, 1277x1026
Excited about php 7
>>
>>51483077
Just figured it out, I had to use
$interval->format('%R%a')

I still don't really get how dates work on php.
>>
>>51483165
Sometimes I'll be browsing random sites, I've been capped and everything takes forever. Sometimes a site just won't load, or it'll take so long it wasn't worth it, or functionality takes so long it causes actual anxiety, in 90% of those times the url ends with .php or has WordPress at the very bottom of the page.

Sometimes I'll be asked to look at some code, usually I get excited because I'm one of those guys who enjoys more than the end result of programming. But then I see prefixed variables everywhere and a pure mess of weak typing. Worse still, I'm a mvvm proponent and when I see view code (html) mixed with backend code, like php (or c# or Java or node style js if you're sensible), it's rage mode activated.

Not only is php slow, ugly and encourages bad practices, people's only justification for it is "popularity". At this point a contrarian anger I thought I eliminated when I became an adult boils up and I realise that not only is php bad: it's evil.
>>
>>51483362
I dont care about how other people use PHP. I only care if it'll work for me.

Also, wordpress is very complex tbqh mate. I dont see any python/js based CMS which could compete with it though (being newbie friendly and offering and beeing highly customisable and extendable at the same time)
>>
>>51483362
>ugly and encourages bad practices
This is why I love it.

My code is the ugliest shit one could ever look at, but it does exactly what I want it to.

I'll have variables named dbnametousername2a
and I'll know what it means.

It's a good fuck you to clients that higher anyone else later.
>>
I hate wordpress. I end up just typing my own code into it when I can because the tools they offer are terrible for placing things.
>>
>>51483462
>I only care if it'll work for me.
Basically, baby duck syndrome. Have you ever used any other languages?

>Also, wordpress is very complex tbqh mate. I dont see any python/js based CMS which could compete with it though (being newbie friendly and offering and beeing highly customisable and extendable at the same time)
Not really... And only because they've put so much potential for middleware in there. Anyone intelligent enough should be able to implement a comment/post system.

>>51483555
>It's a good fuck you to clients that higher anyone else later.
>higher
You are not someone who deserves a job. There was a blog from an enterprise suit which was posted on /g/, mostly bullshit but one piece of paranoia he quipped was that Haskell devs do so for job security.

You actually make that a reality, not by using an obscure language, but by being a wilfully shit developer.
>>
File: car.png (53 KB, 640x308) Image search: [Google]
car.png
53 KB, 640x308
Is there a good keyframe animator for css?
>>
>>51483688
>animat
Have you considered not and using something like webm layered on top instead? Animation is extremely rigid in CSS, you can only do what it has already been designed to do.
>>
>>51483666
>Have you ever used any other languages?
I've played around with django and node. I'm very good with JS, I could basically switch to MEAN stack easily... but I dont see the point. Also, I dont like angular.
>>
>>51483704
If I shouldn't animate in CSS then what's the point of jquery animation?
>>
>>51483772
Maybe don't, to be honest, animations can be extremely distracting and if done wrong can feel like a high school power point presentation
>>
>>51483666
I type homonyms when eye drinking, calm down.

and no, I don't deserve a job. I think programming "correctly" is autistic as fuck and hinders creativity.
>>
what's a good alternative to php?
>>
>>51473397
SoundCloud is made using backbone.js.
>>
>>51484941
rails.

which only hippie shit companies like.
>>
>>51485203
...you mean part of the view is handled by backbone.js right? no way an application as complex as soundcloud is just "made using [insert framework here]."
>>
>>51485293
Well of course, why would you use a frontend js framework for anything else that the view (and sometimes model) layer.
Last time I checked they were using rails for the backend
>>
>>51485352
than*, fuck those mobile keyboards.
>>
Best serialisation library in c# after json.net? Tried message pack, it doesn't handle generics (ie, the object type).

>>51484941
Literally anything.

No, really there are networking libraries in every language. Just pick your honest to god favourite language.
>>
how to learn c#
>>
>>51482239
Wew, I can hear those trials coming from paying clients. The right tool for every job.
>>
>>51485630
He can keep developing in PHP too, since it has networking libraries :^)
>>
>>51486471
Of course, but what is the likelihood his favourite language is php?
>>
>>51486509
About 31.423441%, from 10 possible languages.
>>
>>51470910
Did you post this earlier today on hackernews?
>>
>>51469741
What the fuck.
>>
File: dipshit.jpg (56 KB, 223x223) Image search: [Google]
dipshit.jpg
56 KB, 223x223
>>51470910
>I made a one-way data binding library
>react.js slugish bloated
>your library has a hard dependency on jQuery

This is you.
>>
>>51486280
don't
learn C++ or Swift
>>
>>51470910
Wow your twitter is just pure cringe man. Learn to be less bitter in life lmfao.
https://twitter.com/0x8890
>>
File: phplove.png (15 KB, 1054x188) Image search: [Google]
phplove.png
15 KB, 1054x188
>>
>>51488340
>script kiddie playground
>programming language
kys 2bh
>>
http://blog.freecodecamp.com/2014/10/the-real-reason-to-learn-mean-stack.html

do you agree with this?
>>
File: 16156813776_cd47e95b8a_k.jpg (2 MB, 2048x1365) Image search: [Google]
16156813776_cd47e95b8a_k.jpg
2 MB, 2048x1365
Whats the standard and correct way of doing this?

Say i have a button that unfolds a comment section and shows all the comments. The way i have it right now is that the comments are actually already fetched from the database and loaded into the page, but the divs are hidden and not visible until the button calls javascript to make the divs visible. But this seems kind of bad because the page is fetching data that the user might not even see.

Am i supposed to fetch the data from the database inside javascript and put it into the elements as i click the button and make the divs visible? This makes more sense, but that brings up another problem for me. Im using a MVC framework that has models which use built-in optimized and secure features for fetching data from the database and load it into the page, it seems "wrong" to ignore this and just use some dirty javascript query to fetch data. This also seems very insecure as javascript is executed client side, not serverside. Am i wrong? Whats the correct way of doing things?
>>
>>51488478
Load a certain amount on initial page render but make them hidden. Say 5 of the most recent comments. if they want to see more have them hit a button to make an ajax get for an additional 5 more or whatever you like. This will speed up the initial time to render and reduce the burden on DB calls if it is stored in a DB.
>>
>>51488465
Kind of.

I see why the MEAN stack is so popular, it has everything you need and isn't super complicated.

But then again, it all depends on where you live, since my city has nearly 0 tech jobs, but occasionally has a few PHP offerings every now and then
>>
>>51488465
>MongoDB
>>
>>51470937
But most people* hire college monkeys and not actual coders.

And worse, a large chunk of the web is written by self-taught retards that google for stackoverflow solutions to their problems and copy-paste it without a single thought of it being broken or a security nightmare.


* shit IT companies, not actual companies with coding as a primary or secondary function of it.
>>
>>51488580
Thanks. Gotta look into that Ajax thing, quite new to this stuff so its no wonder i missed some vital tool everyone uses.
>>
So I'm having a tiff with a coworker about an ng-option pulling from a $scope in the controller and listing an option element in the HTML like so:

  
//ctrl
$scope.volFilters = [
$filter('i18n')('volunteer.personalHours'),
$filter('i18n')('volunteer.projectHours')
];
//html
<div class="dropdown pull-right margin-right-10" data-ng-if="$state.current.name.indexOf('history') != -1">
<select data-ng-model="volSelect.vol" ng-change="volSet(volSelect.vol)" ng-options="vol for vol in volFilters">
<option selected="selected" value="" disabled>{{'volunteer.filterBy' | i18n}}</option>
</select>
<span ng-click="volSet('clear')"><div class="btn btn-default"><i class="fa fa-times"></i></div></span>
</div>


I don't doubt that it could break things by including a default <option>, but why is using ng-repeat so much more acceptable?
>>
>>51488478
unless you're unfolding more than a paragraph of text and you have more that like 15 to unfold the difference is negligible. Having them hidden in the markup doesn't effect rendering at all (hidden nodes are skipped when layout out everything else) only do ajax if you envisage there being a lot (multiples pages worth of text), the round trip of the ajax is slower than an extra 2kb of text in the data your already sending anyway
>>
>>51488885
Good point. Im not really doing a comment section but used it as an example because its easy to explain. Im actually doing a page with 5 lists are shown in a friendly UI that each contain 20-30 rows of users. When you click on a row it unfolds (toggles) and reveals more information about that user. So my dilemma is A) Fetch all information about all users and have it hidden or B) When you click on a user, then it fetches that users information (with Ajax as recommended previously).

The information is no more than a few attributes, very little.
>>
>>51472600
>a good design strategy
No it isn't, that shit is a fad and you fucking know it.

That shit created CSS and a disaster for years and still never gave ANY developer a valid replacement for Tables for Layout, which is what people wanted.
THERE STILL ISN'T A GOOD ONE NOW. Every possible replacement is either been dropped by everyone or is in devhell.

There are a few weird ass ways to do it, but it is a fucking mess regardless. (and it still ends up creating the same damn TfL structure anyway, just with different names and MORE TEXT)

That shit also created the jQuery generation of shitdevs that literally don't even know base JavaScript at all.


If the fag wants to make a site without JavaScript, let him.
JavaScript isn't NEEDED, it is just a nice thing to have to make the websights less shit.
Of course, it will mean your website takes up slightly more bandwidth, and have more hits against it, but that isn't a massive problem unless you end up getting a surge of traffic, or become popular for some reason.

JS should have never been about making pages.
Templating should have done that and a standard templating format created for it.
Point a template at a URL on server, it passes your shit to the browser, the data gets put in whatever HTML is applicable.
Instead we got this bastardization between iframes that led to XHR becoming the new hotness.
>>
>>51488997
if the information for each user is enough to fit into some data attributes then it might as well already be on the page. If it was a long bio for each user than ajax would probably be a bit more efficient.
>>
guys

I'm a front end dev freelancer (with about 4 years full time experience before that) and someone offered me £40k to work full time for them, what's average for a mid-weight front end role?

I haven't worked for many companies before, I am good at at what I do though.
>>
>>51489050
As the other poster who suggested ajax, I agree with this. If it is small metadata about the user then it is ok to render it all hidden on the page. However, if you have the need to bring in bulk data from complex joins and stuff you might be better off to lazy load it in through ajax while the user takes the opportunity to look through the page first.
>>
>>51489101
If you are a freelancer, surely you are smart enough to be able to google the average wage for full time.

Just check some job center shit.
Research the company, finances, location, competition, etc.
If the job seems good enough, go for it.

You can still do freelance stuff as well if you love webdev that much.
You might need to lower your rates for that though, since you will be taking a bit longer to complete tasks. But since you have a fulltime job, that wouldn't matter anyway, right?
>>
>>51489184

Do this, but counter-offer the salary for an additional 5K. Don't take the first offer from an employer - if you're that good and they want you, they won't turn it away. Get mo' munny senpai

Plus you can always do freelance on the side, as anon suggested.
>>
>>51489184
local companies don't advertise roles in job centers here, it's dedicated recruitment people or done direct, I'm just asking around at the moment without asking people personally (people don't like to talk about how much they earn), also trying to get a feel for what people earn elsewhere in case I decide to move to another country

>>51489212
I was thinking of this, they've already said they're going to give me freelance work if I don't accept the offer, but obviously that won't be constant work

freelance work on top of full time is a bit much though, I don't enjoy it anyway, I know lots of people that do do it
>>
>>51489402

If you don't enjoy it and want to just do your 40 a week and call it, then definitely get the 45K. The worst that'll happen is they say no. That extra 5K goes a long, long way, another 200 every month that can cover the additional time lost from no freelance.
>>
>>51488465
>freecodecamp
>here, learn jquery before javascript
>here, learn how to makw buttons bounce
>would you like to donate to LET WIMMIN CODE organization?
>CONGRATS YOU ARE A FRONT END DEV XD
>>
>>51489419
I meant I don't enjoy freelancing on top of full time, I do enjoy freelancing, I love the freedom
>>
>>51482757
use classes instead of ids
Thread replies: 255
Thread images: 24

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.