Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming Businesses Google The Internet Technology

Sophistication in Web Applications? 197

whit537 asks: "Anyone who uses Gmail for 5 minutes can see that it's a pretty dern sophisticated web application. But just how sophisticated? Well, first of all, the UI is composed of no less than nine iframes (try turning off the page styles in Firefox with View > Page Style). But then consider that these iframes are generated and controlled by a 1149 line javascript. This script includes no less than 1001 functions, and 998 of these functions have one- or two-letter names! They're obviously not maintaining this script by hand in that form. So do they write human-readable javascripts and then run them all together, or have they developed some sort of web app UI toolkit in Python? Does Gmail need to be this complex or is the obfuscation a deliberate attempt to prevent reverse-engineering? And are there any other web apps that are this sophisticated?"
This discussion has been archived. No new comments can be posted.

Sophistication in Web Applications?

Comments Filter:
  • Re:Huh? (Score:4, Informative)

    by Cecil ( 37810 ) on Saturday December 11, 2004 @10:55PM (#11063892) Homepage
    I think he may have derived "in Python" from the fact that Google has been hiring many Python programmers in the past couple years.

    However, it was completely uncalled for speculation that had no place in a Slashdot article. ... just like the rest of this article.

    I'm with you, "huh?"
  • by I_Love_Pocky! ( 751171 ) on Saturday December 11, 2004 @11:19PM (#11063999)
    Both Perl and Javascript can be maintainable if the programmer designs their code with that goal in mind. Besides, Gmail has slightly more than 1000 lines of code. That really isn't really a maintenance nightmare.

    Java is an object oriented language, but I could certainly write Java code that would be a major headache to maintain if I chose to do so. I think most maintenance problems come from poor coding habits, and not the language its self.
  • by eggstasy ( 458692 ) on Sunday December 12, 2004 @06:32AM (#11065312) Journal
    Google serves ads on every page. Assuming they are paid a fixed fee per page, then minimizing their per-page costs is the only way they can increase their revenue. Offering more free services draws in more people, who are served more ads. If they optimize those pages as well, they will earn more profit there.
    BTW... ever noticed how google uses text ads? Do you think the only reason they do that is because it's less intrusive? Wrong again - it also saves a lot of bandwidth compared to an image ad :)
    When you serve billions and billions of pages, shaving off a single byte on each page saves you GIGABYTES of traffic.
  • by ComputerSlicer23 ( 516509 ) on Sunday December 12, 2004 @08:33PM (#11069116)
    Well, I'll point out that "static is evil", is a flat out wrong and a statement with no context. At the time I was well aware of the 2 types of things that static can be applied to, and the two different contexts in which you can it on variables. That's not even to discuss the meanings it has in C++.

    In regular C, for a function, it's actually highly useful, and extremely desirable. Go look in any extremely large body of C code. You'll find out just how desireable C static functions are. They are used all the time inside of the Linux kernel. They guarantee that the linker won't make that symbol available externally. Which is great for avoiding two different functions with the same symbol.

    In regular C, using static on a global variable also makes it have no external linkage. It also moves where the memory is actually set aside. Which changes when it gets initialized, and how large your executables are. I believe it's also a very good way to ensure your variables are safe to use in signal handler context. This is common go look at the Linux kernel. Happens all the time. Highly useful application of static.

    In regular C, using static on a variable in function scope, can be useful, if it is also a constant. In that case, you can move the space off the stack and into the BSS section (at least under UNIX, I forget the equivilent under a Win32 platform). This again is used all the time in the Linux kernel. It shrinks the stack usage and saves space. As I recall, you want to declare all strings that are constants as:

    static const char foo[] = "foobar";

    It saves space in the kernel. I forget exactly why it does right off hand, but it has to do with the assembly that GCC outputs. I might have that wrong, you might want to do "*foo" instead of "foo[]", but you get the idea.

    Now, in regular C using static on a variable in function scope to store state between function calls is an excellent way to introduce a race condition. So your blanket statement that "static is evil" is blantantly wrong. Whoever or where ever you learned it from was mimicing what they'd heard before without any understanding. Next you'll be telling me there's no good use of "goto's" either. Which isn't the case, they are few and far between, but they do exist. I've never come across one, but I am aware of when they would be useful. I could make use of them, but generally performance, cache coherency, and "the fast path" aren't things I generally have to worry about. Those are the types of problems we just throw more hardware at and keep the code highly maintainable.

    I learned about a lot of thinks from my old boss, but the "iii" was one of the truely unique things, I've never seen anywhere else. Any good text on C programming will explain what I just did. The small useful things that you just deal with all the time because you never stop to think of a better solution. Paul didn't have too many of those. He recongized anytime something was difficult, and pondered the problem until it was easy. Just like, he knew when static was a good idea. Although I actually picked that up at school, during the explaination of Ada. You can do something named modules in Ada, that you can somewhat duplicate in C with static and separate translations units.

    The truly most useful thing Paul ever taught me was just assume all of your code leaks memory. Assume your code will segfault because there is a bug in it. Assume you'll get crappy data that will lead to pathelogical cases. Design your code so that as much as possible that doesn't make any difference in terms of your ability to process data that doesn't cause a memory leak, a segfault, or isn't malformed. Never get stuck when there is more data to try. If some data elements blow up your code. Timestamp when you tried them and don't retry them for a while so you can work on other data. Any time you are doing batch processing, you should always have a parent that is deathly simple that will spawn children that do the real work.

It's a naive, domestic operating system without any breeding, but I think you'll be amused by its presumption.

Working...