# code style

Published articles for code style.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Зачем CI/CD тестировщикам?

DevFeed: [Зачем CI/CD тестировщикам?](<https://devfeed.tech/articles/ci-cd-23951.md>)

Original publisher: [Read original article](<https://habr.com/ru/companies/JetBrains/articles/650757/>)

Author: alexpshe (JetBrains)

Published: 2022-02-10T11:18:13Z

Content type: tutorial

Language: ru

Sources: [JetBrains RU](<https://devfeed.tech/sources/jetbrains-ru.md>)

Topics: [CI/CD](<https://devfeed.tech/topics/cicd.md>), [ci](<https://devfeed.tech/topics/ci.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [ci](<https://devfeed.tech/tags/ci.md>), [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [code](<https://devfeed.tech/tags/code.md>), [code-style](<https://devfeed.tech/tags/code-style.md>), [qa](<https://devfeed.tech/tags/qa.md>), [quality](<https://devfeed.tech/tags/quality.md>), [quality-control](<https://devfeed.tech/tags/quality-control.md>), [qualitygates](<https://devfeed.tech/tags/qualitygates.md>), [tag-9ec75300b635](<https://devfeed.tech/tags/tag-9ec75300b635.md>), [tag-e932065bc8da](<https://devfeed.tech/tags/tag-e932065bc8da.md>), [testops](<https://devfeed.tech/tags/testops.md>)

### AI overview

This article explains why CI/CD is useful to QA engineers and TestOps. It discusses automatic test execution and quality gates that prevent features from reaching product code until required checks pass, including builds, code style, and static analysis.

### Source excerpt

Сейчас компетентность в сфере TestOps является таким же базовым требованием к QA-инженерам, как и написание автоматизированных тестов. Причина -- в активном развитии CI/CD в проектах и необходимости QA-инженерам работать с пайплайнами (читать как "последовательность этапов в CI/CD") и даже внедрять свои. Так почему же CI/CD -- отличный инструмент контроля качества? Давайте разбираться. Читать далее

## An opinionated guide on how to make your Kotlin code fun to read and joy to work with

DevFeed: [An opinionated guide on how to make your Kotlin code fun to read and joy to work with](<https://devfeed.tech/articles/an-opinionated-guide-on-how-to-make-your-kotlin-code-fun-to-read-and-joy-to-work-with-25931.md>)

Original publisher: [Read original article](<https://proandroiddev.com/an-opinionated-guide-on-how-to-make-your-kotlin-code-fun-to-read-and-joy-to-work-with-caa3a4036f9e?source=rss-7a8d96da8cb6------2>)

Author: Gabor Varadi

Published: 2021-02-15T06:16:05Z

Content type: tutorial

Language: en

Sources: [Stories by Gabor Varadi on Medium](<https://devfeed.tech/sources/stories-by-gabor-varadi-on-medium.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [code](<https://devfeed.tech/tags/code.md>), [code-style](<https://devfeed.tech/tags/code-style.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [readability](<https://devfeed.tech/tags/readability.md>)

### AI overview

An opinionated guide to writing Kotlin code that is easier to read and maintain. It recommends formatting multi-argument constructors across lines, using let mainly in assignments or return statements, avoiding it for general control flow or side effects, and replacing implicit lambda arguments with meaningful names in complex expressions.

### Source excerpt

I've been meaning to write this article in a while. Hopefully, the following tips and style recommendations (in no particular order) will help you write better Kotlin! Let's get on with it, shall we? For 2 or more constructor arguments, prefer not to keep the properties on the same line as the class name in the constructor definitionclass MyClass( val a: A, val b: B, ): MyParentClass(a, b), MyInterface { // ... } This format is preferable, because when adding the 3rd argument, important bits (such as a possible base class or interface) can appear too far on the right side of the screen. Listing them one after the other (including the trailing comma since 1.4.21+) allows for better readability and extensibility (reducing the chance of causing merge conflicts with future code changes, for example). Prefer to use the scoping function 'let' only in assignments or return statements, but NOT as general control flow, or a "quick rename to 'it'" Oftentimes, Kotlin code tends to do something like this: fun myMethod(nullableA: A?) { nullableA?.let { // no it.x() // no it.y() // no it.z() // no } } (Note: in a method like this, A? could be replaced with A to take advantage of typed nullability, this is just an example.) To allow better maintainability and readability, we should instead prefer to only use ?.let { in simple assignments, or return statements, but not as general control flow. For example, the following chain is easy to understand: val protoClass = savedInstanceState?.getByteArray("protoValue") ?.let { ProtoClass.parseFrom(it) } However, in this case, ?.let { is part of an assignment. Also, while ?.let { can be chained with a ?: to provide a default value (especially in combination with takeIf) it shouldn't be used to execute side-effects (also is more suitable for that). In fact, it needs to be said: x?.let {} ?: run {} is NOT a general purpose replacement for if-else statements and null-checks, and should never be used in this particular format for that purpose!

## Kotlin Code Review: Avoiding Unproductive Nitpicking Over Concise and Idiomatic Code

DevFeed: [Kotlin Code Review: Avoiding Unproductive Nitpicking Over Concise and Idiomatic Code](<https://devfeed.tech/articles/kotlin-nitpicker-s-guide-38639.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2020_10_14_kotlin_nitpickers_guide/>)

Published: 2020-10-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [Code review](<https://devfeed.tech/topics/code-review.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [code style](<https://devfeed.tech/topics/code-style.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [code-review](<https://devfeed.tech/tags/code-review.md>), [code-style](<https://devfeed.tech/tags/code-style.md>), [development-process](<https://devfeed.tech/tags/development-process.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [quality](<https://devfeed.tech/tags/quality.md>)

### AI overview

This article examines how code review can become unproductive when reviewers focus excessively on style, concision, or idiomatic Kotlin patterns. It discusses the trade-offs behind some Kotlin constructs and argues that shorter code is not automatically better.

### Source excerpt

Introduction Code review is an essential tool for a development team, which helps ensure high-quality standards of code. While reviewing others' code one might find bugs, design issues, and so on. One another part of reviewing is getting used to the codebase and following team's code style for better maintenance. Though it is pretty cool in theory, in practice team might face few issues, one of which is nitpicking. When review is bloated with dozens of similar comments related to e.g. how beautifully code looks like. Common code style is important, but having a lot of similar comments in each review doesn't help. Instead of trying to understand what code is doing, nitpicker writes a lot of similar comments on the style. Back and forth discussions or fixes of such slow down development process and overall make team's morale worse.

## Design of everyday things

DevFeed: [Design of everyday things](<https://devfeed.tech/articles/design-of-everyday-things-24775.md>)

Original publisher: [Read original article](<https://dev.cheremin.info/2020/07/design-of-everyday-things.html>)

Author: Ruslan Cheremin (noreply@blogger.com)

Published: 2020-07-19T19:13:00Z

Content type: opinion

Language: ru

Sources: [\>рабочие заметки](<https://devfeed.tech/sources/source-2.md>)

Topics: [User Experience](<https://devfeed.tech/topics/user-experience.md>), [API](<https://devfeed.tech/topics/api.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [backend](<https://devfeed.tech/tags/backend.md>), [code](<https://devfeed.tech/tags/code.md>), [code-style](<https://devfeed.tech/tags/code-style.md>), [tag-2c039dce53be](<https://devfeed.tech/tags/tag-2c039dce53be.md>), [tag-8b0adca51b34](<https://devfeed.tech/tags/tag-8b0adca51b34.md>), [user-experience](<https://devfeed.tech/tags/user-experience.md>)

### AI overview

The author reviews Donald Norman's book The Design of Everyday Things and argues that its principles of user experience and interface design apply directly to backend software and APIs. A checklist for designing physical devices is reframed for application programmers working with APIs.

### Source excerpt

Недавно прочитал "Дизайн привычных вещей" Дональда Нормана. Норман - computer scientist, и когнитивный психолог, известный и авторитетный специалист по эргономике. Он популяризовал сам термин "user experience", и был, вероятно, первым User Experience Architect - в Apple, что совершенно не удивляет. На его книгу я наткнулся совершенно случайно, и залип с первых страниц. Книга

## Enforcing Consistent Coding Conventions with Shared IDE Settings and Build Checks

DevFeed: [Enforcing Consistent Coding Conventions with Shared IDE Settings and Build Checks](<https://devfeed.tech/articles/forcing-conventions-27307.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201906/code-style/>)

Published: 2019-06-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [coding](<https://devfeed.tech/topics/coding.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [ide](<https://devfeed.tech/topics/ide.md>), [version-control](<https://devfeed.tech/topics/version-control.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [Vim](<https://devfeed.tech/topics/vim.md>)

Tags: [code-style](<https://devfeed.tech/tags/code-style.md>), [coding](<https://devfeed.tech/tags/coding.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [git](<https://devfeed.tech/tags/git.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [ide](<https://devfeed.tech/tags/ide.md>), [maven](<https://devfeed.tech/tags/maven.md>), [version-control](<https://devfeed.tech/tags/version-control.md>), [vim](<https://devfeed.tech/tags/vim.md>)

### AI overview

The article recommends exporting shared IDE code-style settings into version control and using build-time checks to enforce coding conventions across tools and team members.

### Source excerpt

When the whole team agrees on coding standards we tend to be optimistic. We think that from now on everything will be exactly as we decided. The truth is that usually after a couple of months you'll reinstall IDE or system and forget about configuration or new people join and it's the Wild West all over again. Read more

## Empire Node 2016

DevFeed: [Empire Node 2016](<https://devfeed.tech/articles/empire-node-2016-32300.md>)

Original publisher: [Read original article](<https://jack.ofspades.com/empire-node-2016/>)

Author: Jack Tarantino

Published: 2016-11-08T22:57:34Z

Content type: article

Language: en

Sources: [Jacopo Tarantino](<https://devfeed.tech/sources/jacopo-tarantino.md>)

Topics: [code style](<https://devfeed.tech/topics/code-style.md>), [ESLint](<https://devfeed.tech/topics/eslint.md>), [React](<https://devfeed.tech/topics/react.md>), [Redux](<https://devfeed.tech/topics/redux.md>), [MongoDB](<https://devfeed.tech/topics/mongodb.md>), [Promise](<https://devfeed.tech/topics/promise.md>), [CommonJS](<https://devfeed.tech/topics/commonjs.md>), [middleware](<https://devfeed.tech/topics/middleware.md>)

Tags: [callback](<https://devfeed.tech/tags/callback.md>), [code](<https://devfeed.tech/tags/code.md>), [code-style](<https://devfeed.tech/tags/code-style.md>), [commonjs](<https://devfeed.tech/tags/commonjs.md>), [empire-node](<https://devfeed.tech/tags/empire-node.md>), [eslint](<https://devfeed.tech/tags/eslint.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [modules](<https://devfeed.tech/tags/modules.md>), [mongodb](<https://devfeed.tech/tags/mongodb.md>), [new-york-city](<https://devfeed.tech/tags/new-york-city.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [react](<https://devfeed.tech/tags/react.md>), [redux](<https://devfeed.tech/tags/redux.md>)

### AI overview

Notes from Empire Node 2016 cover talks about HyperTerm and its React and Redux plugin architecture, ESLint rules and coding practices, and MongoDB, along with other programming topics.

### Source excerpt

Yesterday I had the good fortune to attend Empire Node at The National Museum of the American Indian, courtesy of InRhythm. A good time was had by all and we got to see some great talks! There was programmable music, smart ways to get into code style linting and, of

## Clarity Conf Day 1 Notes

DevFeed: [Clarity Conf Day 1 Notes](<https://devfeed.tech/articles/clarity-conf-day-1-notes-32297.md>)

Original publisher: [Read original article](<https://jack.ofspades.com/clarity-conf-day-1-notes/>)

Author: Jack Tarantino

Published: 2016-04-01T17:28:56Z

Content type: article

Language: en

Sources: [Jacopo Tarantino](<https://devfeed.tech/sources/jacopo-tarantino.md>)

Topics: [Design system](<https://devfeed.tech/topics/design-system.md>), [Frameworks](<https://devfeed.tech/topics/frameworks.md>), [Material Design](<https://devfeed.tech/topics/material-design.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [clarity-conf](<https://devfeed.tech/tags/clarity-conf.md>), [code-style](<https://devfeed.tech/tags/code-style.md>), [design](<https://devfeed.tech/tags/design.md>), [design-systems](<https://devfeed.tech/tags/design-systems.md>), [front-end](<https://devfeed.tech/tags/front-end.md>), [guides](<https://devfeed.tech/tags/guides.md>), [style-guide](<https://devfeed.tech/tags/style-guide.md>), [styleguide-driven-development](<https://devfeed.tech/tags/styleguide-driven-development.md>)

### AI overview

Notes from the first day of Clarity Conf covering style guides, design systems, pattern libraries, responsive design, and the practical reasons organizations adopt more consistent interfaces and workflows.

### Source excerpt

Here are my notes from day 1 of Clarity Conf. Apologies in advance to the speakers whom I am certain I misquoted and misrepresented. Also if I missed things. Also for having some personal stuff just in the middle of there. Also because there's probably like 90 typos. I may

## How Code Reviews Support Chromium's Code Quality and Team Resilience

DevFeed: [How Code Reviews Support Chromium's Code Quality and Team Resilience](<https://devfeed.tech/articles/code-reviews-for-fun-and-profit-35513.md>)

Original publisher: [Read original article](<https://meowni.ca/posts/code-reviews/>)

Author: Monica Dinculescu

Published: 2014-03-31T00:00:00Z

Content type: opinion

Language: en

Sources: [Monica Dinculescu](<https://devfeed.tech/sources/monica-dinculescu.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [Chromium](<https://devfeed.tech/topics/chromium.md>), [code style](<https://devfeed.tech/topics/code-style.md>), [bus factor](<https://devfeed.tech/topics/bus-factor.md>)

Tags: [bus-factor](<https://devfeed.tech/tags/bus-factor.md>), [chromium](<https://devfeed.tech/tags/chromium.md>), [code](<https://devfeed.tech/tags/code.md>), [code-reviews](<https://devfeed.tech/tags/code-reviews.md>), [code-style](<https://devfeed.tech/tags/code-style.md>)

### AI overview

The article explains how Chromium uses code reviews and style guides to manage a large, actively changing codebase. It argues that review helps catch broken or poor-quality code, maintain consistency, and reduce reliance on a small number of contributors.

### Source excerpt

Stats: a preamble I've been reading too much about March Madness brackets, so I thought I had to run some numbers around here like the cool kids do. Get your umbrella out, it's about to rain cold facts. In the history of time, Chromium has had 205,095 commits made by 1,943 contributors representing 7,431,088 lines of code. In the last 30 days, there have been 5021 commits, by 637 contributors, including 53 new hoomans. I did some advanced Nate Silver analysis here for you, and that's at least 167 commits and 1+ new committers a day. On average, that's at least 7 commits an hour. Every hour. All of the hours. That's an imperial ton of new code being added, by what it seems like new people. Imagine if everyone could commit code willy-nilly. Are you imagining a minefield? You should. Code reviews ftw Good news for our browser using audience! Chromium isn't a minefield, and on top of it, has pretty awesome looking code. This comes from the fact that any code changes need to be reviewed and blessed before they can land on the master branch. More eyes means less bugs means you're less likely to commit broken code and break the internet. And you really don't want to break the internet. Even if you have tests, and everything is going your way, you can write correct, but genuinely shitty code. 7 million lines of kinda-shitty code is not something anyone wants to work with, and are worth investing a little time in fixing. Code reviews also bring up the bus factor, which is my favourite sinister nerd metaphor. You know, the buuuuuus factor. The number of people that can get run over by a bus on a team before that team is royally and epically screwed. If all the code that you write has been closely read by a different person, then you're probably ok getting run over by a bus every once in a while. But still, you probably shouldn't. Who would feed your cat? Consistent code is the best code Code style guides are sooper neat, and are a huge part of code reviews, because ain't nobo

## C++ Practices from Chromium Code Style: Avoiding Copies and Using Debug Checks

DevFeed: [C++ Practices from Chromium Code Style: Avoiding Copies and Using Debug Checks](<https://devfeed.tech/articles/potentially-neat-c-protipz-35539.md>)

Original publisher: [Read original article](<https://meowni.ca/posts/protipz/>)

Author: Monica Dinculescu

Published: 2014-01-20T00:00:00Z

Content type: tutorial

Language: en

Sources: [Monica Dinculescu](<https://devfeed.tech/sources/monica-dinculescu.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Chromium](<https://devfeed.tech/topics/chromium.md>), [code style](<https://devfeed.tech/topics/code-style.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [debug](<https://devfeed.tech/topics/debug.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [chromium](<https://devfeed.tech/tags/chromium.md>), [clang](<https://devfeed.tech/tags/clang.md>), [code-style](<https://devfeed.tech/tags/code-style.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [debug](<https://devfeed.tech/tags/debug.md>), [test-coverage](<https://devfeed.tech/tags/test-coverage.md>)

### AI overview

A practical C++ article based on Chromium code style. It discusses preventing unwanted copy construction and assignment with a macro, and using debug-only checks to catch bad scenarios during development and testing.

### Source excerpt

Disclaimer: these aren't new protipz. I didn't make them up. They're actually straight out of the Chromium code style, they're pretty trivial, and you might already use them. But just in case you're not a Chromium committer (the outrage), or are fairly new at C++ and want to make your code less suck, here they are. I think they're neat. Copy constructors and their brethren You know that scene from The Fly when Jeff Goldblum, having not screwed up teleporting a small baboon, decides he should totally teleport himself? But then he screws that up (because software), manages to turn himself into a giant terrifying fly (because David Cronenberg), and continues to give me nightmares as an adult. That's exactly how I feel about copy constructors. You can absolutely get them right, but they're a pain, and among other crimes they're committing, they're sometimes deceivingly slow. The point is, most of the time you don't even need them. I mean, Jeff Goldblum teleported himself like three meters away. Couldn't he have just walked? What we tend to do instead is convince the compiler to get annoyed with us if we try to use a copy constructor. This is easy because the compiler <3s being annoyed with us. So we can define a nice macro (stay with me) that adds a private declaration, but doesn't implement it: #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \ void operator=(const TypeName&) Which you would then use in your private section of your class, like so: class Hooman { public: Hooman(); ~Hooman(); private: DISALLOW_COPY_AND_ASSIGN(Hooman); }; Now, when you try to be ambitious and clone Jeff Goldblum, Hooman jeffGoldblum; Hooman teleportedJeffGoldblum(jeffGoldblum); Clang will tell you something like "error: calling a private constructor of class 'Hooman'". Other compilers might tell you other things, but they'll generally have the same annoyed tone. Now would be a good time to apologize to your compiler for all the silly things you've done in the past.

## October 2013 Meeting Minutes

DevFeed: [October 2013 Meeting Minutes](<https://devfeed.tech/articles/october-2013-meeting-minutes-33163.md>)

Original publisher: [Read original article](<https://reactos.org/project-news/october-2013-meeting-minutes/>)

Published: 2013-11-14T00:00:00Z

Content type: news

Language: en

Sources: [Front Page on ReactOS Website](<https://devfeed.tech/sources/front-page-on-reactos-website.md>)

Topics: [ReactOS](<https://devfeed.tech/topics/reactos.md>), [Development](<https://devfeed.tech/topics/development.md>), [code style](<https://devfeed.tech/topics/code-style.md>)

Tags: [code-style](<https://devfeed.tech/tags/code-style.md>), [development](<https://devfeed.tech/tags/development.md>), [free](<https://devfeed.tech/tags/free.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [os](<https://devfeed.tech/tags/os.md>), [react](<https://devfeed.tech/tags/react.md>), [reactos](<https://devfeed.tech/tags/reactos.md>), [win32](<https://devfeed.tech/tags/win32.md>), [winapi](<https://devfeed.tech/tags/winapi.md>)

### AI overview

Minutes from the ReactOS project's October 31, 2013 meeting cover team coordination, adoption of a coding style guideline, and the availability of foundation funds for development hardware.

### Source excerpt

2013-10-31 19:00 UTC dev.reactos.org, #meeting Proceedings Meeting started at 19:08 by Aleksey Bragin. Point 1: CoordinationPoint 2: Code Style GuidelinesPoint 3: Donations and HardwarePoint 1Aleksey Bragin opened up the meeting with a statement that the project's members need to coordinate and work better together to avoid internal confusion as to what work is being done and what work requires some help due to other commitments by team members. Point 2Colin Finck presented for approval a finalized draft for the project's coding style guideline.

## Tip for 1-click indentation settings changes in Visual Studio

DevFeed: [Tip for 1-click indentation settings changes in Visual Studio](<https://devfeed.tech/articles/tip-for-1-click-indentation-settings-changes-in-visual-studio-38406.md>)

Original publisher: [Read original article](<https://khmylov.com/2011/02/tip-for-1-click-indentation-settings-changes-in-visual-studio/>)

Author: Andrew Khmylov

Published: 2011-02-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Despite the odds](<https://devfeed.tech/sources/despite-the-odds.md>)

Topics: [Visual Studio](<https://devfeed.tech/topics/visual-studio.md>), [code style](<https://devfeed.tech/topics/code-style.md>), [Automation](<https://devfeed.tech/topics/automation.md>), [ide](<https://devfeed.tech/topics/ide.md>), [C#](<https://devfeed.tech/topics/csharp.md>)

Tags: [automation](<https://devfeed.tech/tags/automation.md>), [change](<https://devfeed.tech/tags/change.md>), [code](<https://devfeed.tech/tags/code.md>), [code-style](<https://devfeed.tech/tags/code-style.md>), [csharp](<https://devfeed.tech/tags/csharp.md>), [ide](<https://devfeed.tech/tags/ide.md>), [macros](<https://devfeed.tech/tags/macros.md>), [spaces](<https://devfeed.tech/tags/spaces.md>), [style](<https://devfeed.tech/tags/style.md>), [visual-studio](<https://devfeed.tech/tags/visual-studio.md>)

### AI overview

A tutorial explains how to create a Visual Studio macro that toggles the C# indentation setting between tabs and spaces. It uses the DTE TextEditor CSharp InsertTabs property and provides keyboard-accessible macro commands.

### Source excerpt

I work at several projects at a time, and I have different settings/requirements concerning the code style for each of them. The main issue is 'Tabs vs. Spaces' option - the first project requires using tabs, the second - spaces. It's obvious that going Tools -> Settings -> ... is not an option for everyday use. Sounds like a good task for the automation macros, right? Navigate to Tools -> Macros -> Macros IDE (or use Alt+F11) Create new macros in Project Explorer (Project - Add Module) Write a method that changes the indentation settings: Public Module TabsModule Public Sub ToggleTabs() Dim currentSetting As Boolean = DTE.Properties("TextEditor", "CSharp").Item("InsertTabs").Value DTE.Properties("TextEditor", "CSharp").Item("InsertTabs").Value = Not currentSetting End Sub End Module Now you can use Macros Explorer (Alt+F8, also you can dock it as one of your panels) to quickly change settings (by double-clicking on the corresponding item name in the macros tree)