#codestyle — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #codestyle, aggregated by home.social.
-
Is this C++ code really too fancy and advanced, so that it requires a comment explaining:
- How it avoids side effects for macro arguments.
- That it uses structured bindings? -
Is this C++ code really too fancy and advanced, so that it requires a comment explaining:
- How it avoids side effects for macro arguments.
- That it uses structured bindings? -
Immer wieder lese ich Beiträge aus dem Anfängerbereich des Java-Forums und muss feststellen, dass die Grundlagen der Java Konventionen nicht eingehalten werden. Die meisten kommen vielleicht aus anderen Programmiersprachen oder fangen ganz neu mit Java an was die großen Wissensdefizite erklärt.
https://magicmarcy.de/kamele-in-java
#CamelCase #Konvention #lowerCamelCase #UpperCamelCase #CodeStyle
-
@aligorith @foxylad Alphabetical order :blobcatokhand: but is there any reason to use "reverse #C++" import order in #Python? I use "top-down" order, alphabetical, blocks (stdlib, external deps, other modules, my modules) for Python and that hasn't ruined my day yet.
(The only import #order I still sway on is whether "import" goes before/after/between "from ... import".)
-
@aligorith @foxylad Alphabetical order :blobcatokhand: but is there any reason to use "reverse #C++" import order in #Python? I use "top-down" order, alphabetical, blocks (stdlib, external deps, other modules, my modules) for Python and that hasn't ruined my day yet.
(The only import #order I still sway on is whether "import" goes before/after/between "from ... import".)
-
C programmers commit fresh crimes against readability
Comments: https://news.ycombinator.com/item?id=48803347
#HackerNews #CProgramming #Readability #CodeStyle #DeveloperHumor #TechNews
-
C programmers commit fresh crimes against readability
Comments: https://news.ycombinator.com/item?id=48803347
#HackerNews #CProgramming #Readability #CodeStyle #DeveloperHumor #TechNews
-
#Java developers question:
Having some order in a class where the public, private, static, non-static methods go, seems nice. At the last company I worked for, we had rules.
Yet. A method may easily ping-pong between static and non-static during development, from commit to commit, as the code evolves. Sometimes this is even true for public/private.
But moving the method around in the code will screw up the diffs, so this seems silly.
What is your strategy?
-
#Java developers question:
Having some order in a class where the public, private, static, non-static methods go, seems nice. At the last company I worked for, we had rules.
Yet. A method may easily ping-pong between static and non-static during development, from commit to commit, as the code evolves. Sometimes this is even true for public/private.
But moving the method around in the code will screw up the diffs, so this seems silly.
What is your strategy?
-
Agents por Diretório — Documente cada pasta com agents.md
Quer que seu agente entenda o projeto sem vasculhar todo o repositório? 🤔
- ✅ O que é: crie um "agents.md" em cada diretório para resumir o propósito daquela pasta (front-end, back-end, DB, área compartilhada, etc.)
- 🚀 Benefícios: o agente não precisa ler arquivo por arquivo — ele encontra o agents.md, traz para a memória e já sabe o que aquele...#agents #repositorio #ia #dev #programacao #codestyle #arquitetura #MorningCrypto
-
Bevor du nicht mindestens tausend Getter & Setter geschrieben hast, verwendest du kein Lombok! Mit diesem Worten meines Kollegen begann irgendwann meine Karriere als Java-Entwickler. Und er sollte damit auch recht behalten … Project Lombok, dass ist eine Java Bibliothek die einem viel Arbeit a
https://magicmarcy.de/project-lombok
#java #lombok #project-lombok #cleancode #codestyle
-
Bevor du nicht mindestens tausend Getter & Setter geschrieben hast, verwendest du kein Lombok! Mit diesem Worten meines Kollegen begann irgendwann meine Karriere als Java-Entwickler. Und er sollte damit auch recht behalten … Project Lombok, dass ist eine Java Bibliothek die einem viel Arbeit a
https://magicmarcy.de/project-lombok
#java #lombok #project-lombok #cleancode #codestyle
-
Интеграция утилиты Artistic Style в скрипт сборки прошивки
Есть утилита для автоматического выравнивания отступов в исходных кодах. Называется astyle.exe. В этом тексте я покажу, как работать с утилитой Astyle.
-
Immer wieder lese ich Beiträge aus dem Anfängerbereich des Java-Forums und muss feststellen, dass die Grundlagen der Java Konventionen nicht eingehalten werden. Die meisten kommen vielleicht aus anderen Programmiersprachen oder fangen ganz neu mit Java an was die großen Wissensdefizite erklärt.
https://magicmarcy.de/kamele-in-java
#CamelCase #Konvention #lowerCamelCase #UpperCamelCase #CodeStyle
-
Bevor du nicht mindestens tausend Getter & Setter geschrieben hast, verwendest du kein Lombok! Mit diesem Worten meines Kollegen begann irgendwann meine Karriere als Java-Entwickler. Und er sollte damit auch recht behalten … Project Lombok, dass ist eine Java Bibliothek die einem viel Arbeit a
https://magicmarcy.de/project-lombok
#java #lombok #project-lombok #cleancode #codestyle
-
Immer wieder lese ich Beiträge aus dem Anfängerbereich des Java-Forums und muss feststellen, dass die Grundlagen der Java Konventionen nicht eingehalten werden. Die meisten kommen vielleicht aus anderen Programmiersprachen oder fangen ganz neu mit Java an was die großen Wissensdefizite erklärt.
https://magicmarcy.de/kamele-in-java
#CamelCase #Konvention #lowerCamelCase #UpperCamelCase #CodeStyle
-
Zig needs to add a hard copiler error for using spaces for indentation instead of tabs, because it is a #footgun to use a non-flexible indentation, and also for writing too many comments in one place because if you can't read the code to understand, you already have too many #footguns , and you are a bad programmer, and you have to stop programming, as we have stated in zig zen "Focus on code rather than style.
", this is not about style. #zig #ziglang #Zigtools #programming #codestyle -
Formatting code should be unnecessary (and we knew this back in the 80s)
https://maxleiter.com/blog/formatting
#HackerNews #FormattingCode #Unnecessary #80sTech #HackerNews #CodingCulture #CodeStyle
-
Formatting code should be unnecessary (and we knew this back in the 80s)
https://maxleiter.com/blog/formatting
#HackerNews #FormattingCode #Unnecessary #80sTech #HackerNews #CodingCulture #CodeStyle
-
I like coding convenience, so I always try to promote unpacked parameters when it's feasible, especially strings.
✅ The dev uses multiple parameters
✅ The dev uses a single array
✅ The dev unpacks an arrayWhen I need the function to accept two types of parameters, I never use unpacked parameters (because these SHOULD be the same type).
#Programming #Coding #Code #Software #SoftwareDevelopment #WebDevelopment #WebDev #PHP #CodeStyle
-
I like coding convenience, so I always try to promote unpacked parameters when it's feasible, especially strings.
✅ The dev uses multiple parameters
✅ The dev uses a single array
✅ The dev unpacks an arrayWhen I need the function to accept two types of parameters, I never use unpacked parameters (because these SHOULD be the same type).
#Programming #Coding #Code #Software #SoftwareDevelopment #WebDevelopment #WebDev #PHP #CodeStyle
-
Мне всё равно, какой у вас код-стайл
Привет, Хабр. Меня зовут Рогатнев Сергей. Я работаю в Контуре ведущим разработчиком уже более 7 лет. За это время я поработал как минимум над десятью разными проектами в разных командах. Это были и проекты с историей на 10 лет, и стартапы, делающие свои первые шаги. Где-то я был всего 2-3 месяца, а где-то задерживался на пару лет. Такой формат работы позволил мне увидеть совершенно разные подходы к работе и написанию кода. За это время я адаптировался к переходам и смене команд, но мой собственный code style практически исчез, потому что нет двух команд с одинаковым стилем. В этой статье я хочу показать вам примеры таких холиваров, которые я встретил работая над разными C#-проектами.
-
My rules on PHP:
- Class constants: SCREAMING_CASE
- Enum cases in StudlyCaseEnd of discussion
#PHP #Programming #CodeStyle #Coding #WebDevelopment #WebDev #SoftwareDevelopment #AppDevelopment
-
My rules on PHP:
- Class constants: SCREAMING_CASE
- Enum cases in StudlyCaseEnd of discussion
#PHP #Programming #CodeStyle #Coding #WebDevelopment #WebDev #SoftwareDevelopment #AppDevelopment
-
Any recommendations for PHP code linters or static analysis tools?
-
Any recommendations for PHP code linters or static analysis tools?
-
CodeStyle на Flutter-проектах: базовые принципы и правила — шаблон на все случаи жизни
Привет! Меня зовут Никита Грибков, я Flutter-разработчик в AGIMA. Хочу в очередной раз поднять важную тему — CodeStyle. Думаю, что все понимают преимущества единообразного, понятного, красивого кода. Но к сожалению, оформить единые правила для всей команды — это большая задача, и выделить на нее время получается не всегда. Мы решили эту ситуацию изменить. Недавно я осознал, как сильно раздражает разбираться с долгосрочными проектами, которые мы развиваем годами. За это время команда неизбежно меняется, и каждый разработчик привносит свой уникальный стиль. Как результат, понять, что хотел сделать предыдущий автор, бывает настоящим испытанием. Именно поэтому мы с коллегами решили внедрить единый стандарт разработки, которым я теперь делюсь с читателями Хабра. Надеюсь, собранные здесь правила помогут вам сэкономить пару-тройку рабочих часов, но главное — сберегут нервы.
https://habr.com/ru/companies/agima/articles/873576/
#codestyle #flutter #dart #мобильная_разработка #чистый_код #bloc_flutter #литеры_для_flutter #автоматизация_кода
-
Стилистический-Анализатор: Проверка Наличия Комментария в Конце Фигурной Скобки
Настал тот первый день, когда в программировании микроконтроллеров наконец пригодилась такая абстрактная структура данных как стек LIFO . У нас в организации существует обязательное внутреннее требование к оформлению исходных кодов на языке программирования Си для микроконтроллеров, которое звучит так: В конце каждого блока if(...) {...} ; switch(...) {...} ; for(...) {...} и т.п. необходимо пиcать комментарий // end of if(...). end of switch(...) end of for(...) соответственно. Я написал консольную утилиту, которая автоматически находит аномалии в коде согласно этому правилу.
https://habr.com/ru/articles/865536/
#codestyle #цензура #gerrit #code_review #стилистический_анализ #комментирование_кода #комментирование #С #lifo #стек
-
Hexadecimal numbers, how do you write them and why?
-
Hexadecimal numbers, how do you write them and why?
-
Как управлять техническим долгом и минимизировать его влияние на проект
Технический долг — это как оставлять грязные тарелки в раковине. Если все время откладывать, рано или поздно они превратятся в гору, с которой придется бороться. В этой статье мы поговорим о том, как не допустить, чтобы горы долга перекрыли все возможности для чистоты и порядка в проекте.
https://habr.com/ru/articles/857718/
#техдолг #legacyкод #технический_долг #документация #codestyle #styleguide #codereview #refactoring #documentation #чистый_код
-
пишешь код, а про документацию забываешь .
-
I like the evolving silent consensus standard that the character count limit for a line of source is still about 80 characters but the count now begins at the first non-whitespace character rather than the traditional start-of-line.
-
I like the evolving silent consensus standard that the character count limit for a line of source is still about 80 characters but the count now begins at the first non-whitespace character rather than the traditional start-of-line.
-
A foolish deviation makes little hobgoblins in the mind.
-
A foolish deviation makes little hobgoblins in the mind.
-
🎨 Rust Tip: Use cargo fmt to automatically format your code according to Rust style guidelines.
📝 You can even setup your editor to Auto-Format on save!VS Code Instructions:
- Install the Rust Analyzer extension
- Open settings
- Search for "Format on Save" and enable the settingOr you can add the following to your settings.json:
Link to ref: https://users.rust-lang.org/t/how-to-active-format-on-save-with-rust-analyzer-for-vs-code/41701
-
🎨 Rust Tip: Use cargo fmt to automatically format your code according to Rust style guidelines.
📝 You can even setup your editor to Auto-Format on save!VS Code Instructions:
- Install the Rust Analyzer extension
- Open settings
- Search for "Format on Save" and enable the settingOr you can add the following to your settings.json:
Link to ref: https://users.rust-lang.org/t/how-to-active-format-on-save-with-rust-analyzer-for-vs-code/41701
-
Интеграция Статического Анализа в общий Make Скрипт Сборки Проекта
В некоторых компаниях есть внутренние требования к стилю оформления исходных кодов на Си. В этом тексте я показал как можно интегрировать проверку стандарта оформления исходных кодов в общий процесс сборки программы, так чтобы вместе с бинарём получить и отчет с указанием мест нарушений.
-
-
-
I don't write code the way I used to
I turned 30 last week, and it made me realise I've been coding for more than half of my life now. I took a moment to reflect on my programming skills after a decade, and realised that 20-year-old me would probably facepalm if he'd seen my write code today. First, I gave up on most abstractions.
Tags: #codestyle, #coding
via Pocket https://ift.tt/4FYIbgA
August 19, 2024 at 03:44PM
-
Elixir Anti-Patterns - What Not to Do in Your Code
We all love Elixir and know how great it is, but that's not what this article is about. Today we will focus on things in Elixir that may cause you to shoot yourself in the foot (or blow your whole leg off).
Tags: #codestyle, #elixir
via Pocket https://ift.tt/4wJ8jkr
June 13, 2024 at 02:37PM
-
Heute mal wieder bei der .NET User Group gewesen. Insgesamt gab es drei Vorträge:Beim ersten ging es um #CodeStyle mit #Roslyn Analyzers, beim zweiten um CD mit #ArgoCD und #Kubernetes und beim dritten um #DevContainer. Das letzte Thema fand ich noch ganz interessant (wobei dank der Spielerei mit dem Dreamcast SDK auch schon bekannt), den Rest eher unspektakulär. Ich bin nicht mehr der Meinung, dass man auf alles ein Kubernetes loslassen muss. Die Komplexität ist für kleinere Anwendungen zu groß
-
So I've created a #wily report for one thousand Black (the Python formatter) commits.
You can see that there was a huge (and complex), 7k lines __init__.py that got broken up around May 2021.
There's a trend of increasing LOC and complexity.
This report shows me there's a lot to improve in wily's code. Hopefully I'm back at that.
#Python #Black #formatter #CodeStyle #Cyclomatic #Complexity #Halstead #codequality #codemetrics
-
We're approaching the end of the year, and that means only one thing:
There'll be a new Black v24 release soon (spoiler: in 2024) with an updated stable style.
That means now is the time to upgrade Black, try it on your projects with the --preview flags, and let them know what you like or don't like:
https://github.com/psf/black/issues/4042 #Python #Black #formatter #CodeStyle