style

What is the most unreadable programming language?

Excluding Whitespace, BrainF*ck (and all those other languages not designed for practical usage), and assembly, what do you think is the most difficult real programming language to write readable code in, and why? I find that I'm very comfortable reading code with C/C++ style braces and brackets. I can easily scan a file for method and...

How should I capitalize Perl?

PERL? Perl? perl? What's good style? I know the answerI just wanted to make sure the question was out there and questioners were aware that there is a correct form. ...

On a wiki, is it acceptable to restructure people's headings?

I dislike the fact that people use h3 rather h1, or skip a level just because of the way it looks. IMHO, headings signify document structure, rather than layout. The layout is just a side effect, customizable through themes. Having "wrong" heading levels also makes it more difficult to generate proper TOCs and/or export to other formats...

Applying Styles To ListItems in CheckBoxList

How can styles be applied to CheckBoxList ListItems. Unlike other controls, such as the Repeater where you can specify , you can't seem to specify a style for each individual control. Is there some sort of work around? ...

DataGridViewCell Bordercolor

Does anyone know how to change the Bordercolor for a Datagridviewcell in c#? Here's a picture of what I mean: Picture Backgroundcolor, Textcolor and Images are no Problem, but I don't know how to realise the Borders. EDIT: I want to realise this with winforms. Another problem is the cross in the second Row, but that's for later......

Indenting styles

What are the different kinds of indent style in use? Are there any objective differences? How do you determine the indent style for a whole development shop? The indent style that I use is the so-called BSD KNF style or Kernel Normal Form. It's for me the most logical way of formatting my code. For instance: //I also prefer one tab per...

Immutable Styles in Silverlight 2

Anyone found a good pattern for getting around immutable styles in Silverlight 2? What I mean is does anyone have a workaround for the fact that you cannot switch the style of an element programmatically once it has been set, i.e. the second line here will throw a catastrophic failure exception: this.TestButton.Style = (Style)Applicatio...

Is there a style guide for GUI's somewhere?

I'm looking for a style guide to unify Windows applications. I'd like it to contain stuff like "Always put dialog result buttons 5 pixels from the edge of the window" I know Visual Studio helps me with this but I'm Delphi 7 at the moment (yeah I know). ...

Is a variable named i unacceptable?

As far as variable naming conventions go, should iterators be named i or something more semantic like count? If you don't use i, why not? If you feel that i is acceptable, are there cases of iteration where it shouldn't be used? ...

Font size in CSS - % or em?

When setting the size of fonts in CSS, should I be using a percent value or em? Can you explain the advantage? ...

Is this a crazy way to handle multi Validation types with IDataError and WPF?

Hi We are using the standard method for our controls to report broken BO rules. This is done via the interface IDataError in our BO’s and in XAML the control is bound to the BO’s property etc. This approach works OK. But we need to show 2 types of visuals in the UI depending on the type (or category if you like) of the invalidation erro...

Window styles / Minimal titlebar/borders

I'm looking for some kind of a resource (website) that would list all possible window/dialog frame styles and their respective combinations with images. I'm only really interested in Vista, as my software won't support older platforms anyway. I have a more specific case here too: I'm wondering if there are other ways to achieve a smalle...

Style question: Writing "this." before instance variable and methods: good or bad idea?

One of my nasty (?) programming habits in C++ and Java is to always precede calls or accesses to members with a this. For example: this.process(this.event). A few of my students commented on this, and I'm wondering if I am teaching bad habits. My rationale is: 1) Makes code more readable — Easier to distinguish fields from local variab...

In firebug, how do I find out all of the css styles being applied to a particular element?

I'm way buried in many nested levels of css, and I can't tell which style layer/level is messing up my display. How can I find out everything that's being applied to a particular element? ...

.toArray(new MyClass[0]) or .toArray(new MyClass[myList.size()]) ?

Assuming I have an ArrayList ArrayList<MyClass> myList; And I want to call toArray, is there a performance reason to use MyClass[] arr = myList.toArray(new MyClass[myList.size()]); over MyClass[] arr = myList.toArray(new MyClass[0]); ? I prefer the second style, since it's less verbose, and I assumed that the compiler will make...

Which is more appropriate: getters and setters or functions?

Is it ever appropriate to abandon the "getMyValue()" and "setMyValue()" pattern of getters and setters if alternative function names make the API more obvious? For example, imagine I have this class in C++: public class SomeClass { private: bool mIsVisible; public: void draw(); void erase(); } I could add functions to g...

Default parameters with C++ constructors

Is it good practice to have a class constructor that uses default parameters, or should I use separate overloaded constructors? For example: // Use this... class foo { private: std::string name_; unsigned int age_; public: foo(const std::string& name = "", const unsigned int age = 0) : name_(name), age_(ag...

Are there any style guides for HTML?

I have found that my HTML is, to be honest, very clunky. Small, simple pages are OK. But there comes a point when between indenting and the kinds of tags I have, it's impossible to keep lines short. Is there a W3C (or otherwise "official" or well accepted) formatting guide for clean, maintainable HTML? If not, what suggestions can the co...

How do I create a custom menu navigation in ASP.NET?

UPDATE Here is my final working version: <% Dim theUrl As String = Request.Url.Segments(Request.Url.Segments.Count - 1).ToLower Dim oList As New List(Of String()), openTag As String = "" oList.AddRange(sqlStuff.getNavPages()) For Each oItem As String() In oList If oItem(1) = theUrl Then openTag = String.Format...

static method or instance constructor

In a language were both are available, would you prefer to see an instance constructor or a static method that returns an instance? For example, if you're creating a string from a char[]: String.FromCharacters(chars) new String(chars) ...