Why is Google.com's source code so messy? [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I'm just wondering why Google.com, one of the most minimalist websites, has a so messy HTML source code.
Two main questions:
Is it a sort of obfuscation in order to keep parts of the code "secret"?
Has anyone ever tried to explain it?

Two things I can offer to help understand what's going on with google.com
While the displayed content on the page is simple, there is a lot going on in behind the scenes to understand your browsing history, cookies, etc. to serve up dynamic content such as preset search results and ads, of course. In addition, while every piece of google.com looks simple but has much more going on behind it. The search bar gets populated with a drop down of search results as you type. Apps in nav bars get loaded as you drop in. The language of the site can change instantly. All of this is quite complex.
All of this code has been minimized and files have been concatenated together to reduce page load time, making it look really messy. You're right in that google isn't interested in making the code you can see on their main page understandable. Their goal is to serve you the best possible experience. Hopefully that clears some of it up!

If you're referring to the code you see when you press "View Page Source" on Google, then yes, the code is obfuscated. There are a number of reasons people obfuscate code, but the main ones I've heard of, are for compressing the code to make for faster loading times, hiding the code so people can't read it (which is pretty obvious), and lastly, to prevent people from being able to use the website from phishing. For many websites, you can just copy/paste the source, and make a very similar looking website to do a number of malicious things.

They might be minifying the JavaScript or using their own Closure JavaScript compiler to make it smaller so the page loads faster. Obfuscation just maybe a side effect.

Related

webpage made entirely with canvas? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I really hate css. I try to do simple things and it gets really complicated really fast.
On the other hand, ive used canvas to code games which have a lot of functionality and menus..
So I was wondering if there is anything wrong with using a canvas element all over the webpage? Or even one giant canvas?
This article makes it seem like canvas is much better, but harder to use(which i think is the other way around) http://www.kirupa.com/html5/dom_vs_canvas.htm
Yet all the tutorials use css extensively. So is it bad practice? if so, why?
Using pixel drawing for web pages is a very bad idea, because own browser's viewport is almost the same but at the operating system level.
HTML and CSS are just simplifications of composing UIs without the hassle of forcing developers to draw what they want to show on screen by code.
I'm going to give you the best advice that you can find out there: learn CSS if this is the issue, because re-inventing wheels because of not reading the manual and a lack mind openness is just the worst decision we can ever made in software development.
Maybe taking a look at these pseudo-languages which compile into regular CSS might change your mind about HTML+CSS:
LESS CSS.
SASS / Compass
As others have said in comments...
...manual drawing means:
No SEO.
No search indexing (i.e. index your content in Google)
No user text selection
No way to save images (jpg, png...) using the "Save as..." dialog as regular HTML documents.
No viewport scaling depending on user's device.
...and dozens of cons.
OP said...
would this be acceptable in a professional environment? Say if I used
it in a portfolio to apply for a job.
No, because professional Web developers develop on top of Web standards: they're not creating alternate approaches to draw documents which aren't understandable by the mainstream development community!
If some tech recruiter with actual development knowledge discovers your way of developing the Web, he/she would say "impressive, but this candidate won't fit well in our development team".
In addition to the already excellent answer by Matías Fidemraizer I would like to add that it would be an interaction nightmare. You would have to manually track the position of all elements, get the position of all interaction events, coordinate them, and having an event loop running. You would, in effect, be replicating a good chunk of the browser in javascript.
Learning css is difficult for any number of reasons. If someone wrote a 'CSS: The Good Parts' it would arguably be even thinner than the Crockford book. There was recently a really great talk at CSSConf.Asia about this. Its css for back-end devs. It might give you insight into a more manageable subset of css.

New web to print solution [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I'm working on a web-shop with a personalize function. The web-shop is going to sell prints. Before customers goes to check out, they will be able to customize their product/print with just changing custom text on the designs. I know their is many different web2print solutions. I'm thinking about using Adobe's Scene7 web to print solution. It's a service and will cost money, so I rather do something more simple.
The thing is that most web2print solutions are so advanced with so many edit options. I just want to have limited rows of text to customize.
So my idea was to make the designs in html and css. With a basic background image and text on top of the background image. When the customer is done filling in the form for the text and clicks order. The web pages makes the html-css coded customised design and makes it to an image that gets mounted on high resolution printable pdf.
There is many web to pdf solutions, but the problem is that they doesn't seem to make an exact flat copy of what's shown in the design. I want this to work server side.
In my head this doesn't seem so advanced, maby i'm missing something?
I know css and html good, I can also handle javascript and some php. But i'm also open to learn new languages and programming skills to get this to work.
Thanks!
Use SVG which is the standard vector format (can be resized without loss in quality) and will look the same across implementations.

Prerequisites for Creating Chrome/Safari Extensions [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have been a programmer for a long time now but have majorly operated in C and Fortran. I like to believe I am good at scientific/numerical computing.
Recently, I had an idea for a browser extension. I did some googling and realized that Javascript is my best option to do so. I have never in my life looked at HTML or Javascript or CSS. The Safari and Chrome websites suggest that I should learn HTML, CSS and Javascript.
My question was- how should I proceed with this goal in mind. I don't plan to make web applications anytime but want to concentrate only on browser extensions. How much of HTML and CSS do I really need to know? Will the Web Fundamentals at CodeAcademy suffice? Do I need to get that out of the way before attempting to study Javascript? How should I plan this study?
P.S. I looked at a few books on Javascript and it looks eerily close to C which is a big plus for me. Learning Javascript isn't my concern, learning HTML/CSS is.
The Code Academy Web Fundamentals link should suffice for the HTML & CSS. Don't be afraid of HTML- you're just marking up, or rather describing the presentation of, a document. With CSS, for the most part, you're just declaring styles on the document: Make this paragraph bold; Change this background to red, etc.
I am still learning JavaScript but I bet It'll be easier for you because of your background in C. The syntax should look very familiar. Perhaps one of the most obvious differences is that C needs a compiler to run whereas JavaScript just runs in your browser.
Some nice sandboxes to try out snippets of code are http://www.jsfiddle.net and http://www.jsbin.com.
http://www.codecademy.com/ is a great place to start.
If you want a nice technical guide to the DOM, JS, the server, and really the web in general, this is also a good guide

Does Google use GWT for their projects? If not what do they use? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I know this has been asked before but I'd like to ask it here and see what happens.
What do Google's developers use to implement their sites like http://translate.google.com/ for instance. When I look at the source of the page, I'm not immediately seeing anything GWT.
I've been working on a few GWT projects and my experiences with it have been mixed. The advantages are obvious, and I've created dynamic scheme making client-server communication even more transparent. But the downsides have been nagging PITA pretty much. Erroneous hard to find anomalies. Slow building process (I'm familiar with the optimizations and tuning to improve development cycles). Layout hell (css). Plus problems developing for mobiles. No devmode, need various tricks to let me debug and probe inner state. Problems with specific mobiles (eg. Acer A500 disappearing keyboard problem). Mobiles not scaling UI properly. The list of issues goes on and on.
I have the feeling that Google is perfectly well aware of the pitfalls of GWT and use something much better internally for their own apps. Does anyone know how they develop their sites?
The admin pages for Adwords is as far as I know done with GWT, as was wave.
For some projects they have used the Closure library
Gmail is one of these I think.

subverting adblock detection? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Several questions concern how to detect adblock use, but I couldn't find any that explained how to subvert detection?
Personally, I don't find it appropriate to bypass ad blocking detection, though I know that others may have different viewpoints. If a site doesn't want to offer you their content without you displaying their ads (perhaps their only way of paying for the site), then that seems to me to be their prerogative and if they go to the trouble of detecting the ad blocking, then it seems that that is their right.
That said, there are a number of different ways that they could be detecting that you're blocking their ads. Some could be complicated enough that you couldn't simulate that you had the ads when you didn't. For example, if you are blocking flash and they are trying to communicate with a flash object to verify that it's there, you'd have to simulate that it was really there and that could be quite difficult. If their detection logic was a lot simpler, then it might be possible to fool it with some sort of simulation. But, I suspect this would just be an arms race and if any significant number of folks foiled their blocking detection, they'd just make it more sophisticated.
In that case, all you could do it try to figure out how to patch their actual javascript detection code directly to make it return a false answer. How you would do that would vary from one site to the next and any solution would have to be coded for a specific site. I wouldn't recommend it.

Categories