verbosity

How to determine what log level to use?

The log levels WARN, ERROR and FATAL are pretty clear. But when is something DEBUG, and when INFO? I've seen some projects that are annoyingly verbose on the INFO level, but I've also seen code that favors the DEBUG level too much. In both cases, useful information is hidden in the noise. What are the criteria for determining log leve...

How to run an ASP.NET application with verbose debug messages of the ASP.NET runtime

How do I configure an ASP.NET application to write verbose log messages of what ASP.NET engine itself is doing. What I get with <trace enabled="true" pageOutput="false" requestLimit="10000" writeToDiagnosticsTrace="true"/> is just as much as [2488] aspx.page: Begin PreInit [2488] aspx.page: End PreInit [...

What is the most verbose code you have read/written?

I think the more verbose, the more beautiful code is. Code is meant to be read by computers and humans. Verbose, correct code therefore serves humans and computers best, and therefore is the most beautifull code. With Linq, I have seen some code (but unfortunately can't post here due to rights etc). Please do not discuss about verbosity...

Ruby-like Question: Make this function shorter (ActionScript 3)

I just wrote this incredibly verbose code to turn numbers like 2 into 02. Can you make this function shorter, please (maintaning the functionality)? public static function format(n:int, minimumLength:int):String { var retVal:String = n.toString(); var stillNeed:int = minimumLength - retVal.length; for (var i:int = 0; i < stillNee...

How verbose should names be for Model-View-ViewModel (MVVM) classes and instances?

In general, I prefer to be verbose with .NET class and instance names, but some times (to quote Mike Woodhouse): Over-verbosity tends to conceal syntax, and syntax is important. The first place I felt like I really strayed into the over-verbosity regime is upon implementing the Model-View-ViewModel (MVVM) pattern in Silverlight and...

I'm looking for a solution to the excessive verboseness of Java without using Groovy

I like how Groovy makes all of your instance variables and class variables public and writes getters and setters on your behalf. This saves a lot of unnecessary coding. On the other hand, my boss hates it, making me very sad :( Is there a way to achieve the conciseness of Groovy in Java without having to use Groovy or some other framewo...

examples of useless/junk code and easy fixes

I recently came upon some code filed with the following } catch (FooException e) { //do something } catch (BarException e) { //do something } catch (Exception e) { throw e; } which is easily re-written as } catch (FooException e) { //do something } catch (BarException e) { //do something } and if (!(flag == false)) which ...

What is good practice for generating verbose output?

what is good practice for generating verbose output? currently, i have a function bool verbose; int setVerbose(bool v) { errormsg = ""; verbose = v; if (verbose == v) return 0; else return -1; } and whenever i want to generate output, i do something like if (debug) std::cout << "deleting interp" << std:...

What numbers can you pass as verbosity in running Python Unit Test Suites?

The Python unittest framework has a concept of verbosity that I can't seem to find defined anywhere. For instance, I'm running test cases like this (like in the documentation): suite = unittest.TestLoader().loadTestsFromTestCase(MyAwesomeTest) unittest.TextTestRunner(verbosity=2).run(suite) The only number I've ever seen passed as ver...

Does functional programming mandate new naming conventions?

I recently started studying functional programming using Haskell and came upon this article on the official Haskell wiki: How to read Haskell. The article claims that short variable names such as x, xs, and f are fitting for Haskell code, because of conciseness and abstraction. In essence, it claims that functional programming is such a...

How to minimize the amount of place used by GPL copyright notice?

Gnu GPL page advocates a following header in each file of GPL project: This file is part of Foobar. Foobar is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your optio...

How to teach someone that less is more?

I work in a shop where the mentality/culture does not have any sense of the concept of "less being more" (i.e. the less code you have to maintain, the more flexible you can be, and the faster you can fulfill customer requests). There's also a strong copy-and-paste mentality around here. The backend code base being used is written in ra...

Tips for writing the least verbose Visual C++ code you can in Visual Studio 2005?

While I realize that Visual C++ is a language lacking much of the syntactic-sugar that most of us new programmers are used to these days, VC++ 2005 must have some shortcuts that can decrease the verbosity of the code at least a little; does anyone know of these, or is c++ just that verbose? ...

Why does language verbosity have a negative connotation?

I hear people comment on Java's verbosity (and other languages) as if it were a bad thing, why? To me it makes code easier to understand. Less typing seems like a really trivial argument. ...

Is it better coding practice to define variables outside a foreach even though more verbose?

In the following examples: the first seems more verbose but less wasteful of resources the second is less verbose but more wasteful of resources (redefines string each loop) Which is better coding practice? First example: using System; using System.Collections.Generic; namespace TestForeach23434 { class Program { s...

Verbosity in boost asio using ssl.

Is there a way to make ssl handshake more visible to me using boost asio? I am getting an error: "asio.ssl error". I just want more verbosity, because this message means almost nothing to me. Thanks. ...

Define a verbose name for an entire Django model

I want to create a model named Model. I'm pretty sure this isn't allowed, so I'm forced to use some other term for the model name. Let's say I call it Mdl. However from the user perspective, I want to still refer to the table as Model. Is there a way to define a verbose name for the entire model Mdl the same way you can for model fie...

Is there a way to reduce the verbosity of using String.Format(...., p1, p2, p3)?

I often use String.Format() because it makes the building of strings more readable and manageable. Is there anyway to reduce its syntactical verbosity, e.g. with an extension method, etc.? Logger.LogEntry(String.Format("text '{0}' registered", pair.IdCode)); public static void LogEntry(string message) { ... } e.g. I would like t...

T-SQL: How can i use RAISERROR for Informational Output Without Causing Script To Error?

Okay so i've got a stored proc which does a bunch of things (not important). Now, the stored proc is quite verbose, it prints out a lot of things (progress, rowcounts, etc). As you all know, using PRINT with variables is extremely painful (requiring you to have a CAST party). So, ive used RAISERROR to print these friendly messages (ev...

Python, unittest: Can one make the TestRunner completely quiet?

Is there a way to make unittest.TextTestRunner completely quiet, meaning that it never prints to output on its own? Even at verbosity=0 it prints results when done. The thing is that i want to process the TestResult object returned by the runner before anything is printed. ...