Why are so many websites built with way more complex code than they need to be?

Why are so many websites built with way more complex code than they need to be?

Now, I only just finished year 3 of CS major, but I got offered some cash to redo a couple small business websites, and both of them seem overall competently made, but holy shit are they a mess compared to anything I made for classes. 30-odd CSS files and at least 10 scripts linked to each, much less some of each that's been embedded directly throughout the page, and all manner of widgets. Looking at a sampling of other professionally-built sites, this doesn't seem atypical, especially if they use Wordpress. What's the idea here, is it due to some IDE being used by pro devs that tosses code together in giant mess or something? Or is there some method to the madness?

Other urls found in this thread:

weblog.raganwald.com/2007/03/thank-you-for-writing-such-heartfelt.html
blog.codinghorror.com/why-cant-programmers-program/
thatislinux.com/
bild.de/
twitter.com/NSFWRedditImage

you're fighting the pajeets now

you don't know hell like web development

All code is this way

Sturgeon's law applies to programs, and programmers.

Thing is, I don't think either of these sites were built by pajeets. I mean they both look pretty nice and nothing seems to be broken, it's just that the code itself could be far cleaner and more understandable.

Enlighten me if you can spare a moment, I need to know this. My summer internship is going to be primarily web development.

pretty much this

I feel like I'm EXACTLY the kind of guy you're talking about.

I write bad code. And I know it.

All of my shit always works. But I feel like the code is always "messy" and "unclean". And I feel like i'm always re-writing and revising shit, and despite my efforts to stick to conventions, I always end up changing my mind partway through. So I have 20% running using convention A, and 20% using B, and etc.

I don't use wordpress or any shit like that. I've even tried to step away from ExtJS so as to get back to a simpler way of doing things.

I try to use just the regular html5, css3, js (jquery + my own scripts).
The frontend stuff probably isn't too bad.

But the backend stuff, what a mess.

I feel like I don't know what I'm doing, despite having done it for 2 years now. My databases always feel badly-structured. My php code is a god-aweful mess. On my last project, about half of it is procedural, and half is object-oriented. I'm now basically working with strict JSON objects and such.

On user login, I pull this big JSON string from a col in the DB, used json_decode($res) and stick the output object in $_SESSION['USER_DATA'], and I just work with it from there. (since $_SESSION is like a superglobal AND its a variable that stays consistent between scripts (so long as user doesn't clear their cookies) )

But I just...
I need to take some classes or something. I'm 100% self-taught, and I feel like my lack of formal training is really hurting my coding practices.

There are two reasons people go into web dev

1. They're too dumb for anything else
2. They only want to program to make money

Mix both and you end up with the worst code known to mankind

>it's a "bootstrap with gigantic banners, slogans and moving content on every page" episode

>I need to take some classes or something. I'm 100% self-taught, and I feel like my lack of formal training is really hurting my coding practices.
It's not the lack of formal training, it's the lack of experience.

You don't just wind up being a good programmer out of the box. No matter what uni you go to. Formal training won't help you write good code, it will just maybe help you get hired at a better company.

CS graduate meme exists for a reason

Web dev is shit but Android development is the worst garbage imaginable

>Enlighten me if you can spare a moment, I need to know this. My summer internship is going to be primarily web development.
Not him, but web developers are retards and it's a field where people go when they couldn't into real programming (java, C, C++, etc.) or any other field (databases, system, robotic, networking, security...).
Then those guys will start to create websites :
If they have to do something, even if it can be done easily with ~10 lines of javascript, they'll just use a jquerry script they found online. They'll also like to use every stupid shit that is trendy, and they will never think about having a good code, clean and maintainable.
Those guys are just fucking retarded. They don't even think about the bugs, trying their websites on different resolutions sometimes or how heavy their website is. They just produce garbage

So you're the reason that when people ask me to fix/upgrade their website that I have to tell them that no, I will build them a website from the ground up, but I will not set my hand to that Gordian Code.

App development suffers from the exact same flaw as except even more of #2.

I disagree.

The world is moving away from traditional desktop applications.
Why?
Because WebApps can be accessed from any kind of device, using any operating system, and you don't have to carry around flashdrives anymore. The server remembers your data and your "session state" in the app.

WebApps perform the same regardless of whether you're on your laptop in your living room, your tablet at a restaurant, or your workstation at work.

WebApps are starting to get pretty good. Some of the most professional ones are finally getting ready to truly replace the old desktop applications. (you can't deny office365 and google-docs (and other google services) are both pretty much ready to replace the old office programs, map programs, and everything else you used to buy at bestbuy)

The world is moving to WebApps. Nothing anyone can say will stop it.

So you could say some WebDevelopers chose the field because they're trying to be "progressive" and "future-proof" their career path.

Why go into Desktop-App development when you know the future is in WebApps?

I would do better if I knew how

Shit, and here I thought that they had all these scripts/stylesheets and so on for a reason. I mean I looked at how MUCH code there was and was like "this must have either taken someone a long fucking time or been spawned by an auto-code writing tool in an IDE".

For some reason, it just didn't occur to me that they likely have it longer due to it being shittier, and due to it being hacked together from what they found on stackoverflow. (For a non-web language, of course it's obvious that less is more, I just didn't make that mental jump for web outside of JS/PHP.)

I build websites and I scrape websites

Frontend tooling is out of control. Look up gulp, sass, bower, npm, yeoman, babel, webpack. These things can have legitimate uses in a large website, but it's overkill in most cases and just fancy things JS devs are addicted to.

That said, the tools do create conventions for better or worse. The sites I've deconstructed are all over the place.. a lot of them are auto generated so they don't look pretty. The best one was the mexican site that generated a JS script during checkout that contained your CC number as a variable inside it in cleartext...

Anyway, if you're going to be doing web work, don't get discouraged. The community is massive, which means that there is plenty of shit being created, but also no shortage of knowledge being passed as well. There's even a web dev thread on Sup Forums somewhere around here. Good luck, user.

>Java programs can be accessed from any kind of device, using any operating system with the JRE installed
>Java programs perform the same regardless of whether you're on your laptop in your living room, your tablet at a restaurant, or your workstation at work.

While this can be true in some cases, this is the opinion of someone who has never actually done web dev. You are right in assuming it's auto generated shit.

Thanks, I was starting to think that I'd potentially fucked up future career progression by doing a web-based internship. It's the only summer internship I'll have before graduating since I switched to CS from chemistry.

Any advice for someone who's going to be given largely free reign to upgrade and enhance a mostly front-end website? The only IDE I've used for web stuff during course work is Netbeans, and I think they will demand I continue to use fucking Wordpress.

You still need the JRE installed.

Most normies know about google chrome. Not as many of them know about java, and a lot of them are just too lazy to take 5 minutes and install the JRE.

And I know this is probably just a personal opinion tainted with bad experiences, but it has generally been my experience that java applets DO NOT function any better than modern webapps. In fact, they've tended to function worse.

I had to work with this webapp once written by this medical supply company, or something like that. It was a java applet. I could not for the life of me figure out how to directly interface with it. I also tried to download the JARs and decompile them to see if I could learn more about how the app worked, to see if there was some way I could find out how it was generating its output (that way I could either intercept data-transmissions; or whatever) and this thing...

I still don't know if I'd ever be able to understand this damn java program. It was so complicated.

It would've been so much more simple if they had just used html/css/js to render the output. There was no need to use java.

I just remembered. "Owens & Minor" was the name of the company. I can't find their program from a search engine, or the main navigation. I think it was a private link for customers or something. But if you buy medical supplies from them, or sell medical supplies through them, then they let you use their report generator. And that thing is a mess.

>Why go into Desktop-App development when you know the future is in WebApps?
See I think you're in category 2 on my list

Also there is no good JRE implementation. By good I mean “not some massive Oracle piece of steaming shit that barely works and contains shittons of security holes”.

cuz web devs are idiots... they use wordpress etc which is literally like:
include *

* being a wildcard for "ALL LIBRARIES THAT EXIST"

it's disgusting

>include *
>* being a wildcard for "ALL LIBRARIES THAT EXIST"

That does sound like a small number of experiences being applied as a generalization.

Not saying that you're wrong about that generalization. But you can have disgustingly overwrought messes in any language or coding style. Shitbirds can be found everywhere.

>yfw an estimated 199/200 people applying for a CS position can't write FizzBuzz and this is considered potentially a low estimate of how many can't
>yfw I've seen a guy claim that he was the only one out of 6 applicants who was able to write Hello World in C++, with 3 of the others refusing to try and 2 of them trying but failing

>include *
>* being a wildcard for "ALL LIBRARIES THAT EXIST"

But I don't want my browser to be a shitty OS. I want my browser to display information I tell it to fetch.

The cross-compatability comes from the browsers agreeing on a standard and mostly following that standard. There is nothing that prevents this from happening on the desktop. In fact it is my dream (it's a bit of a pipe dream) to develop a system that makes native desktop applications as easy as WebApps for the user but at the level of an actual application outside the browser. The browser goes back to doing one thing well and instead, when users want it, the fancy native application is installed and launched and the browser can send information to it (login info for example) as long as the user allows it.

It's a long ways off and it would require backing from some major players to get an good ecosystem going and attract users.

It's an idea I've been playing with for a while but using a script to open videos in mpv instead of my browser is just so nice. It performs so much better since playing video is all mpv is supposed to do and it's pretty painless for me. Just right click on a link and I have the option to open with mpv. I'd like to take that idea to an extreme to simplify the job of browsers and hopefully make the mess that is modern webdev a thing of the past.

>Looking at a sampling of other professionally-built sites, this doesn't seem atypical, especially if they use Wordpress.

I have a love/hate relationship with WordPress.

It's fucking bloated and slow. Though on a fast server with the right tweaks end users won't notice.

BUT...there are some nice themes out there. And if you use WP for a client they can edit things with a UI that's well known. Which means they're not bothering you every 5 seconds.

In the end if someone just needs a pretty site they can edit themselves I tend to say "fuck it" and go with WP.

what do u mean they couldn't write Hello World in C++? Were the the guys java coders or something? Did they only know that one language?

I've never written a line of C++ in my life.
I'm not even looking at any resources, I'm going off the little bit I might've seen on some Sup Forums reaction images.

But I assume writting hello-world in c++ would just be:
#include
function main(){
printf("Hello World");
return 0;
}
main();

Is this correct? If it is, then how can someone apply for a job without knowing this minimal amount. I understand people like me, php/js/sh devs who don't know the C/C++ languages, but even then, hello world is as simple as it gets.

Even people who don't know the language should be able to at least do hello-world. Otherwise what do you expect to happen when you get hired?

>I feel like I don't know what I'm doing, despite having done it for 2 years now. My databases always feel badly-structured. My php code is a god-aweful mess.

The web is a cluster fuck of languages and standards. Often a language or standard doesn't exist because a team of engineers thought through the many use scenarios, but because some hack was the first to do some stupid fucking thing. Then a shitty idea is evolved over time to meet the needs the hack never envisioned. Mix that with some lofty but thoroughly impractical academic ideas about how content should be encoded and displayed, and you have the Mother Fucking Web.

It is literally Frankenstein.

What does this mean?

* It is the absolute worst environment in which to learn software engineering.

* It is the absolute worst environment for an inexperienced programmer.

* It is the environment where all the kids now learn programming and get their first jobs. (!)

Studying good code and databases...which often means studying native applications and NOT fucking web sites...will help you make sense of things. And see how jury rigged the web really is.

For end users the web is an astonishing tool. But behind the scenes it is a complete cluster fuck.

This is actually a pretty-decent idea.

#include

int main()
{
std::cout

well fuck. I fail too.

Though after attending a php conference, I at least know what the double-colon means. "cout" is the function, and "std" is the class. You're invoking the class's function, without actually instantiating the class. Because its a "public" function or whatever.

Also, you forgot to return an integer. Won't that throw an error? Shouldn't it either be "void main" or "int main" with a "return 0" for success, and "return 1" for error?

This is about all I know about Object-Oriented.
I'm incredibly slow. I'm learning. But I'm still slow.

I once applied for a job on a contractor web site. But it wasn't a real application. I had seen that a dozen people already applied, and I was "applying" to tell the guy that given his specs he would need a super computer to complete the task each week. (It was data analytics.)

His reply: "A dozen applicants and you're the first to notice. Here are the real specs. Do you think you can write an application to crunch this in under a week on a PC with these specs?"

I got the job. The final application crunched his data in under 24 hours.

>mfw retards were applying for a job they didn't understand
>mfw i got the job
>mfw it was the best paying contract job (per hour) i've had
>mfw i got the run time down to 18-20 hours
>mfw i got a bonus

My bad, it was C#.

>During the interview for my current job, I was asked to write an output line in C# that said "Hello World." Out of all the candidates who applied for the posision, I was (I was later told) the only one who did it correctly. Most wouldn't even try. This is out of only six other people, but it still opened my eyes.
weblog.raganwald.com/2007/03/thank-you-for-writing-such-heartfelt.html

Continued reading with a bunch of relevant links if you're interested:
blog.codinghorror.com/why-cant-programmers-program/

That's really cool. Well done.

IIRC if you don't return 0 there is an implied return 0 tacked on. I don't really write C++ so I'm not one to say if its better practice to have the line there or not

that link is really hard to follow. But wait, were the guys who applied C# developers, who applied for a C# job? Or were they web developers who were asked to do something in C#?

Framework hell.

No really.

Most sites are cobbled together turds built by Indians that learned how to program in "Wordpress".

Everyone and their god damn mother uses bootstrap/wordpress/some other flavor-of-the-hour framework to get a shitty mobile-ready website in less than a day. People are more concerned about content these days, not whether your shits properly padded or whether your site forces horizontal scroll because your shitty CSS theme you downloaded and edited yourself places your stupid selfies outside the browser window.

So what about the fake specs let you know it would need a supercomputer? Was it really obvious Big O or something?

I just don't get it:

There are sites out there that JUST text and images

And they need JS to load all of it?
Why? It's just text and images, not some fancy webapp written in JS (in that case I could understand the use of JS)

BUT NOT FOR FCKING TEXT AND IMAGES!!!!

thatislinux.com/
with NoScript, it doesn't load
(well it does, but the page is hidden behind a full screen white pane with a loading animation gif! WHY?)

WHY is this "restriction" applied? (i know in firefox i can use "inspect element" and remove the thing blocking the view)

It doesn't even make sense if it was for users who use adblock, because the content is still there, transmitted to my, by my request! It's jut hidden behind that big white chunck of CSS-madness!
I just need to delete the html node and I can read the content fine!

The same goes for this pathetic website:

bild.de/

They literally just put a piece of paper between you and the contet (that they deliver to you, no matter what).
Ans this piece of paper cna be removed.

SO WHY IS THIS DONE?

No. It needs to be explicit. If you're returning anything other than void, there must be a return of the function's return type. Even in main.

All I know is what I pasted into the post. By my reading, it was people applying for a C# position unable to actually write any bit of the language they were applying to work with.

I mean, there were other examples while I was bouncing around those blog links, including a woman who got hired to code in Java, assured the team for months that the code was coming along fine, and had actually written about 6 lines of non-compiling code that any 1st-semester CS student could have told you was clearly wrong.

wow thats crazy. How do ppl even have the balls to take a job that they know they will fail. Pretty crazy man, thanks for the links user.

I've noticed that too with NoScript, it's fucking maddening to turn off RequestPolicy and still be staring at a blank page. AND THIS IS NOT UNCOMMON. Even for businesses that want your money, even as I saw today for businesses THAT CLAIM THEY WILL TEACH YOU HOW TO CODE.

Give me a moment and I'll storytime up one that really takes the cake as told to me by a friend who claims its true and has no reason to lie.

It's an ever increasing spiral:

THE ADBLOCK SPIRAL

If the site owners would display accpetable ads (like non-flashy, static but colorful images) people would not block them.

but instead the site owners go into full retard mode and make it even worse.
This madness needs to end NOW!


I'm against the overuse of JS.
In some cases it can be useful, but in most it's just a pain in the ass and slows down your browsing experience.

There should be a campagin for "as few js use as possible".

im waiting user

>using a script to open videos in mpv instead of my browser is just so nice
Try having 7 scripts. I now only use youtube only as a video library browser.
The best thing is I never have to see youtube comments.

>I only pass this story along as told to me, I cannot prove its truth nor can I be sure of it myself

So this friend of mine is good friends with someone who was doing COBOL (and maybe some other stuff) for a hefty salary at our local internationally renowned hospital. This friend of his gets an offer to move to NYC for COBOL work, they offer him $325+/yr, which got upgraded to $325+/yr plus two years of paying his rent and having a company car when he initially turned it down.

He wouldn't say the name of the company, but he was pretty sure they manage servers for multiple major banks. So the question comes up, why is the position open? And it turns out...

The guy who had been working there was getting paid over $1mil a year managing the servers. He did a lot of his work from home using a USB dongle that changed his password every 16 seconds or so and just remoted into the servers. He was close enough to come in immediately if needed but never actually needed to. He'd been working there for a couple years when he took a trip to the Bahamas or thereabouts, and someone else kept an eye on things.

While he was away, that someone else saw that the servers were being routed into from China, and of course in response to that he SHUT. DOWN. EVERYTHING. An investigation was launched. And guess what they found out their boy had been up to?
[cont]

Pajeets don't do webdev'. We consider it to be a white homosexual man activity and it's frown upon in India. In India we stone gays and webdev' for being homosexual.

nice damage control
Pajeet detected.

you idiots haven't programmed anything in your lives. webapps are almost always significantly better organized than desktop apps. the average desktop application is a clusterfuck nightmare.

I like both. I just dont like dealing with html/css. Desktop gui's are way easier to write for me. But i know that webapps are the future.

>And guess what they found out their boy had been up to?

Don't cliffhanger my ass. Finish the story.

Guesses:
- Chinese Spy
- Selling Secret Business Info for Fun & Profit
- Nerd using Server Infrastructure to host his own shit, and using a Chinese VPN to route things or something


Now what was he really doing? Finish the story.
I like stories.

Honestly webdevs shouldn't be allowed to call anyone "Pajeet" because they're Liberal Art School tier.

>[cont]
Their server manager was logged in, but the password dongle wasn't in his computer. He'd sent the dongle to China. You're probably thinking that he'd sold out his employers. But you'd be wrong.

>He'd contracted a Chinese company to manage the servers for him, paying them $80k a year.

The company investigators grabbed his computer since he was living in a company house and took a look at what he'd been up to during work hours. Which was mostly, playing flash games and watching porn. But the Chinese had been doing a good enough job that nobody realized anything was amiss until they were watching the servers themselves and saw the remote-in.

He was immediately sacked because having Chinese manage US bank servers was grossly unacceptable and they couldn't be 100% sure that there hadn't been anything shady done by his Asian subcontractors.

Only, he wasn't taken to court over this, or even quietly blacklisted because that would garner the server company far too much loss of faith in the banking community, much less the banks with their clients. He was just quietly let go.

Further investigation determined that his degrees in Computer Science were actually faked, along with his references and most of the rest of his resume.

Further investigation and a lot more digging showed that he had been let go from the last place he'd worked when they found out his credentials were faked.

His only real skill was faking his degrees and being able to bullshit through an interview, and they weren't sure that the first one of those wasn't also just paid for.

>changed his password every 16 seconds
is this normal? I have never heard of this before, does it actually work well?

java is just convenient for uni's to teach their zombie drones its not good for the zombies

if you use react you could use jsx to write views instead of pure html. i like it even better than xaml.

lel, and he got away with it. Fkin crazy

Oh, and just in case anyone missed the math there: paid

His income: $1000k+
His expenses: $80k
Gross wages to play flash games and jerk off while treated as a valued professional: $920k+

im not this guy but [cont] anyways...

... Even Further investigation determined most Computer Science degrees are fake.

Oh. My. God.

shit like this makes me wish I had social skills. I just want the money. I want money so badly.

I don't care if I have to lie, cheat, and steal.

That guy made MILLIONS just by being smart enough to middle-man their asses. And he was strategic, and was able to get off without getting sued.

We may all hate him. But you have to admit: he's a genius.
He made millions, and didn't do a scrap of work, or have any credentials.

He just middle-manned their asses.

Meanwhile people like me slave away to become halfway decent coders, accept these terrible contracts for terrible pay, because we're still "entry level", and just... wow.

Fucking wow.

I just want money. I want money so bad.

>I want money
>I want money
>I am a capitalist
Do a favour to yourself and leave Sup Forums, where we actually like freedom, even if you don't.

I don't know, and I'm the one who wrote the story. It makes sense given that he's accessing servers containing bank records, banks with clients who have accounts holding millions or hundreds of millions of dollars. But I've not heard of anyone using something like that outside of this.

>like to use every stupid shit that is trendy
pajeet detected

I know, right?

I mean, you just know he was the kid who went door to door with a smile offering to mow old people's lawns for $20 and then went down to the Home Depot and paid some Mexicans to do it for him for $5.

Disclaimer: I hate politics. Neither side is right. And "political people" always seem to waste a bunch of time arguing, but never really get any return for this investment.

---
Isn't capitalism about freedom though? Capitalism is the freedom of enterprise. Capitalism is "you're completely free, every man on his own, if the other guy beats you: tough luck, now become a wage slave to the one who beat you"

Conservative: Let's create a system where nobody can truly fail. It'll be nice and co-operative. Now, you won't do as well either. If you're successful, then your success will benefit the system/group/collective, but will not necessarily be your own.

In other words:

Capitalism: High-Risk, High-Reward. Tends to create Billionaires and Bums.
Conservative: Equalization. Let's ensure no one goes without a meal or without a home. You can't fail. But you can't win "all the way" either.

I don't even know if I'm conservative or capitalist. My parents are republican. (but always tried to iterate both sides of the arguments, and tried to explain "liberal logic")

Honestly, i hate politics. All the endless arguments that don't actually do anything for you. Don't even know why I'm talking politics now.

I'm just a code-monkey who wants to make a dollar. Leave the politics to the politicians.

I think you mean capitalist or communist, user.

You can do this now. My boss in the reserves does all kinds of entrepreneur stuff. He has contacts with some small business sorts who sometimes want designs for things they sell. He charges them $40 each, then turns around and immediately hands off the job to a guy he knows in the Philippines who will do them for $20 each. $20 for sending 2 emails, and he's done this at least a dozen times so far. He's got all kinds of similar stories where he's either middleman'd his way into cash, or cut out a different middleman to nab their contract, or both of the above at once. Guy is worth a lot of money at this point, pretty sure he's a millionaire but he's quiet about it.

Freedom is a pie chart. When the market has more freedom, humanity has less freedom.
Humanity, market/enterprise/banks, government, and religion are slices on this pie chart.

Communism (AKA anarchism) is about removing all slices except for humanity, so the people have maximum freedom.

Politicians are bad people, that's why they go into politics.

No, even in the C standard there's an implicit return 0 at the end of main(). I'm pretty sure it's true of C++ too.

What's wrong with Java?

>Communism (AKA anarchism)
No it's not you inbecile.

Fucking... I was not expecting this.

Just to help you a bit, std:: is a namespace here (could have been a class, but its not the case.) you're simply using the function cout that lives inside namespace std. And indeed, Main should return 0

So basically, you want to port the smartphone app market to desktops.

Plenty of people before you have had that idea

>The browser goes back to doing one thing well and instead, when users want it, the fancy native application is installed and launched and the browser can send information to it (login info for example) as long as the user allows it.
Microsoft tried this, it was called ActiveX controls.

>and didn't do a scrap of work
This is false. Conning is more work than you seem to think it is. If you disagree, go ahead and try.

>Meanwhile people like me slave away to become halfway decent coders, accept these terrible contracts for terrible pay, because we're still "entry level", and just... wow.
People like you are ruining software* ftfy

>Conservative:
I'm not sure if this word means what you think it means.

Web dev now isn't about writing anything yourself, it's finding a bunch of frameworks that do exactly what you want and then writing some glue between them. What you're seeing is the work of people who think they need to add a dependency to their project for the sake of left padding strings. Web dev is hands down the absolute worst "programming" area in existence.