qgis / qgis4.0_api

Tracker for QGIS 4.0 API related issues and developer discussion
3 stars 1 forks source link

Reword all single letter parameters #53

Open nyalldawson opened 8 years ago

nyalldawson commented 8 years ago

There's a lot of functions in QGIS which take single character parameters, eg setColor( const QColor& c ) or setOutputUnit( QgsSymbolV2::OutputUnit u ).

This shorthand isn't ideal, and should be replaced with a more descriptive, full name of the parameter. Doing so helps make the api documentation easier to immediately understand, and helps with using the api in IDEs which show tips/autocomplete describing the expected parameters. It also helps with PyQGIS code which uses named parameters for clarity (eg, avoids confusing code like someMethod( a=5, u='a', t=.01))

We should use the API break to try to address this and remove all shortened parameter names from the API.

m-kuhn commented 8 years ago

I've been doing that outside the API freeze already sometimes. I'm not arguing that we shouldn't do it now, but do you think we shouldn't continue with this hunt if we don't finish before release?

nyalldawson commented 8 years ago

I'm not arguing that we shouldn't do it now, but do you think we shouldn't continue with this hunt if we don't finish before release?

well... it's technically an api break, but I'm not going to complain!

m-kuhn commented 8 years ago

How is that? I thought about a keyword list but I just tried and couldn't call a method like that.

3nids commented 7 years ago

search for (void|bool|int|double|Q\w+) \w*\(( const)+ [^ ]+\s\w\s in headers