Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Rguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and why these differences exist.
Google prefers identifying functions with `BigCamelCase` to clearly distinguish
them from other objects.

```
```r
# Good
DoNothing <- function() {
return(invisible(NULL))
Expand All @@ -28,7 +28,7 @@ DoNothing <- function() {
The names of private functions should begin with a dot. This helps communicate
both the origin of the function and its intended use.

```
```r
# Good
.DoNothingPrivately <- function() {
return(invisible(NULL))
Expand All @@ -48,7 +48,7 @@ The possibilities for creating errors when using `attach()` are numerous.

We do not support using right-hand assignment.

```
```r
# Bad
iris %>%
dplyr::summarize(max_petal = max(Petal.Width)) -> results
Expand All @@ -64,7 +64,7 @@ lines).
Do not rely on R's implicit return feature. It is better to be clear about your
intent to `return()` an object.

```
```r
# Good
AddValues <- function(x, y) {
return(x + y)
Expand All @@ -80,7 +80,7 @@ AddValues <- function(x, y) {

Users should explicitly qualify namespaces for all external functions.

```
```r
# Good
purrr::map()
```
Expand Down
4 changes: 2 additions & 2 deletions docguide/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,15 @@ $ bazel run :target -- --flag --foo=longlonglonglonglongvalue \
If you need a code block within a list, make sure to indent it so as to not
break the list:

```markdown
````markdown
* Bullet.

```c++
int foo;
```

* Next bullet.
```
````

You can also create a nested code block with 4 spaces. Simply indent 4
additional spaces from the list indentation:
Expand Down
8 changes: 4 additions & 4 deletions objcguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ Code should avoid redundant property access. Prefer to assign a property value
to a local variable when the property value is not expected to change and needs
to be used multiple times.

```objc
```objectivec
// GOOD:

UIView *view = self.view;
Expand All @@ -1384,7 +1384,7 @@ UIScrollView *scrollView = self.scrollView;
[scrollView.trailingAnchor constraintEqualToAnchor:view.trailingAnchor].active = YES;
```

```objc
```objectivec
// AVOID:

[self.scrollView.loadingAnchor constraintEqualToAnchor:self.view.loadingAnchor].active = YES;
Expand All @@ -1394,15 +1394,15 @@ UIScrollView *scrollView = self.scrollView;
When repeatedly referencing chained property invocations, prefer to capture the
repeated expression in a local variable:

```objc
```objectivec
// AVOID:

foo.bar.baz.field1 = 10;
foo.bar.baz.field2 = @"Hello";
foo.bar.baz.field3 = 2.71828183;
```

```objc
```objectivec
// GOOD:

Baz *baz = foo.bar.baz;
Expand Down