design patterns - What is "Enterprise JavaScript"? - Stack Overflow

For web applications I've developed I tend to build up a library of functions, and for some sites

For web applications I've developed I tend to build up a library of functions, and for some sites I end up encapsulating them all into a single object, so say FooBar and then all the things I end up doing are within that object. My understanding is that this is part-of-the-way to "Enterprise JavaScript" - encapsulating the functionality in ways that are logical, avoid polluting the JavaScript with lots of global variables.

How do I distinguish good coding practice from what's considered "Enterprise JavaScript"?

A simpler way to ask this might be in terms of scale -- as a web application or site grows it will include more JavaScript and organizing it gets harder, and there are patterns for doing this well and they're Enterprise? What are resources for learning about approaches to handling large libraries of functionality.

Or are people just making it up, as in this joke site?


UPDATE: I am not kidding, really, though I wonder if what I'm seeking is more along the lines of Pro JavaScript Design Patterns. Perhaps "Enterprise" enpasses some of this?

For web applications I've developed I tend to build up a library of functions, and for some sites I end up encapsulating them all into a single object, so say FooBar and then all the things I end up doing are within that object. My understanding is that this is part-of-the-way to "Enterprise JavaScript" - encapsulating the functionality in ways that are logical, avoid polluting the JavaScript with lots of global variables.

How do I distinguish good coding practice from what's considered "Enterprise JavaScript"?

A simpler way to ask this might be in terms of scale -- as a web application or site grows it will include more JavaScript and organizing it gets harder, and there are patterns for doing this well and they're Enterprise? What are resources for learning about approaches to handling large libraries of functionality.

Or are people just making it up, as in this joke site?


UPDATE: I am not kidding, really, though I wonder if what I'm seeking is more along the lines of Pro JavaScript Design Patterns. Perhaps "Enterprise" enpasses some of this?

Share Improve this question edited Nov 19, 2022 at 5:21 Wicket 38.7k9 gold badges79 silver badges194 bronze badges asked Apr 15, 2011 at 0:44 artlungartlung 33.8k19 gold badges74 silver badges124 bronze badges 6
  • 5 In my personal lexicon, "enterprise" used as a modifier of "software" generally means "unbelievably bad". – Pointy Commented Apr 15, 2011 at 1:00
  • 3 Also in my experience it usually means do everything in the least imaginative way possible. – Justin Thomas Commented Apr 15, 2011 at 1:03
  • I agree with Pointy and Justin Thomas... One good example is Enterprise JavaBeans version 1 and 2. EJB3 is already much better. – Hery Commented Apr 15, 2011 at 2:00
  • 3 "Enterprise Javascript" is a fancy marketing name. Its like having your data in the "cloud" vs on a server. And what difference does that make? Well, none. – Lime Commented Apr 15, 2011 at 2:01
  • So,now, you know what Enterprise JavaScript really is. If you still have doubts, go to the link you mentioned, and click refresh enough times ;) – Majid Fouladpour Commented Apr 15, 2011 at 2:19
 |  Show 1 more ment

3 Answers 3

Reset to default 7

Enterprise JavaScript Is: Ensuring lines are terminated with multiple semicolons so the JavaSript parser Really Knows when a line is ending.

var helloWorld = function (message) {
    if (!message) {
        message = "Hello World";;;;;;
    }

    alert(message);;;;;;;;;;;;;;;;;;;

};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(By bentruyman)

I love the term enterprise javascript and enterprise coding. I doubt that it's a well defined term but it has a strong appeal.

As I have e to understand it; Enterprises deal with a lot of developers working on different aspects of projects. So there is a lot of munication required to make things work. Enterprise coding is a term to describe the techniques used to aid the munication of developers and modules in code but have gone wrong.

As the site shows, it's easy to over do it!

So enterprise coding results in harder to understand code that seems more robust than it needs. Quite ironic as enterprise coding is intended to ease production.

Examples of enterprise code could easily be found in

  • Generated websites using robust CMS.
  • Large library APIs (especially proprietary as the source can not be adjusted)
  • Cross browser/platform projects. With a lot of dynamic corrections.
  • Old projects that have been maintained by many people.

Writing clean good code is something that will be debated forever. As there is no perfect approach to all problems.

In a way enterprise coding is coining good practice techniques that have gone bad.

An antonym to enterprise coding might be Cowboy Coding

Indeed, there seem to be patterns and best practices when using JavaScript. For example, there is the site "Enterprise jQuery" that deals with these patterns in jQuery.

Also, there are mon patterns (eg the module pattern) to encapsulate private information. Don't know if you should call them "Enterpise" though.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743738826a4498762.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信