FAQ Database Discussion Community


What exactly is license boilerplate commenting and what format does it need to be in?

c++,coding-style,comments,boilerplate,commenting
I was reading through the Google C++ Style Guide to try to emulate good coding practices. When I read through the section on how to comment my code, it asks me to start each file with license boilerplate. All I could find out about this terminology was from Mozilla and...

How do I avoid writing this type of Haskell boilerplate code

haskell,boilerplate
I run into this situation often enough for it to be annoying. Let's say I have a sum type which can hold an instance of x or a bunch of other things unrelated to x - data Foo x = X x | Y Int | Z String | ...(other...

How to call `setText` on multiple JTextfields?

java,swing,jtextfield,boilerplate
I want to figure out a way to set the text for multiple JTextfields in just a few lines (preferable one line) of code rather than a new line for every textfield. I am looking for a way to invoke the setText method on multiple JTextfield values. My code works...

PHP classes - boilerplate or inherit?

php,oop,inheritance,boilerplate
Disclaimer: I'm a bit of a noob, only been doing PHP for under a year, and doing OO PHP less than that. I'm writing several classes that all have some of the same functionality. Here's my boilerplate code for it: class ClassName { // required constructor arguments private $arg1; //...

How to avoid repeating lambda boilerplate in python?

python,lambda,boilerplate
I find myself writing too many of these: upper = lambda c : c.upper() lower = lambda c : c.lower() foo = lambda a,b : a.foo(b) How can I avoid or at least minimize such boilerplate? Wasn't (or shouldn't be) there a PEP to allow passing/calling methods as normal procedures?...