Righteous Wrath Online Community

General => Tech Chat => Topic started by: Mr. Analog on May 07, 2012, 11:19:51 AM

Title: Regions in Javascript files (for Visual Studio)
Post by: Mr. Analog on May 07, 2012, 11:19:51 AM
I can't tell you how long I've wanted something like this:

http://jsoutlining.codeplex.com/

BOOSH!
Title: Re: Regions in Javascript files (for Visual Studio)
Post by: Thorin on May 07, 2012, 01:38:31 PM
Outlining is cool, it lets you collapse a huge wall of code into more-easily-understood sections.

Some people think that it's better to separate all that code into multiple source files.

I'm not sure which side of that fence I'm on yet, but I know that I don't like huge walls of code.
Title: Re: Regions in Javascript files (for Visual Studio)
Post by: Mr. Analog on May 07, 2012, 01:51:58 PM
I kinda like grouping functional areas, like there's not point in adding a region that says "methods" 'cause who gives a crap, but if I have a class that does CRUD stuff it's kind of cool to see the different operations organized.

Most of the time if I'm looking at a class that's not mine it's because I'm looking for something that's broken or needs to change so, having that kind of grouping helps. In compiled code there are lots of options for finding things (heck, even shortcuts [F12] that can bring you to definitions) in script though finding a particular event is sometimes like trying to find a chunk of corn in diarrhea...

And much like that metaphor once you find it you don't want it anyway

HAH :dance:
Title: Re: Regions in Javascript files (for Visual Studio)
Post by: Tom on May 07, 2012, 02:09:48 PM
Quote from: Thorin on May 07, 2012, 01:38:31 PM
Outlining is cool, it lets you collapse a huge wall of code into more-easily-understood sections.

Some people think that it's better to separate all that code into multiple source files.

I'm not sure which side of that fence I'm on yet, but I know that I don't like huge walls of code.
I'd say do both. I really like the idea of specifying custom folding sections. But its not a substitute for separating logically/functionally separate chunks of code into different files (in most cases anyhow).
Title: Re: Regions in Javascript files (for Visual Studio)
Post by: Mr. Analog on May 07, 2012, 02:28:15 PM
That drives me nuts when people separate functionality into different code files (or even worse libraries / sites)
Title: Re: Regions in Javascript files (for Visual Studio)
Post by: Tom on May 07, 2012, 05:32:35 PM
Quote from: Mr. Analog on May 07, 2012, 02:28:15 PM
That drives me nuts when people separate functionality into different code files (or even worse libraries / sites)
If its part of the same "function", it should probably be together. Splitting up the code from a single logical object would be a bit silly. Though if your file reaches several thousand lines of code, maybe your design is a bit off to begin with.

What drives me nuts is when completely separate functionality is all bodged into the same multi thousand line file.
Title: Re: Regions in Javascript files (for Visual Studio)
Post by: Mr. Analog on May 07, 2012, 06:31:15 PM
Quote from: Tom on May 07, 2012, 05:32:35 PM
Quote from: Mr. Analog on May 07, 2012, 02:28:15 PM
That drives me nuts when people separate functionality into different code files (or even worse libraries / sites)
If its part of the same "function", it should probably be together. Splitting up the code from a single logical object would be a bit silly. Though if your file reaches several thousand lines of code, maybe your design is a bit off to begin with.

What drives me nuts is when completely separate functionality is all bodged into the same multi thousand line file.

That bugs me too, code is like Yin/Yang, there's a balance.