es
Feedback
Блог*

Блог*

Ir al canal en Telegram

Блог со звёздочкой. Много репостов, немножко программирования. Небольшое прикольное комьюнити: @decltype_chat_ptr_t Автор: @insert_reference_here

Mostrar más
1 930
Suscriptores
-224 horas
+17 días
-130 días
Archivo de publicaciones
Repost from N/a
Я думал, это Панорама. На канале Пятница будет шоу "Отсидевшая в 16"
Я думал, это Панорама. На канале Пятница будет шоу "Отсидевшая в 16"

#prog #cpp #article (Not) detecting bugs The following code contains a bug. A developer has spent quite some time looking for the source. The intent of this code is to iterate over two vectors simultaneously, from the first up to the one-before-last element. Thus the most interesting tools that will be employed will be boost::zip_iterator and std::prev. <...> I have simplified the program to the minimum. I am using GCC 5.3. This code compiles fine, but when I run it, it goes on and on. In this post we will see where the bug is, but more importantly, we will look at why this bug has not been detected during the compilation, and wasted a fair deal of the developer’s time.

🥰
🥰

Если бы мне давали по доллару каждый раз, когда я кому-то снюсь и я об этом узнаю, у меня было бы два доллара. Это немного, но всё же странно, что это произошло дважды.

Каналы, которые не дают возможности поставить дизлайк, выглядят так жалко

Repost from ОРУ, СЭР!
photo content

Мета-#meme, всё, как я люблю

Так раздражает, когда люди, которые не пользуются на постоянной основе растом критикуют его. Не потому что раст идеален. Но потому что они критикуют его не за то. Они не знают настоящих проблем раста.

Не знаю, зачем вам это, но пусть будет: сборник сервисов для отслеживания перемещений самолётов, поездов и судов (большинство — в режиме реального времени или почти реального времени).

photo content

#prog #meme

#prog #rust #cpp #article Can you have too many programming language features? Bjarne Stroustrup famously said, “Within C++, there is a much smaller and cleaner language struggling to get out.” I think he regrets the quote, which he clarified is about the modern semantics of C++, held down by the outdated syntax of C. It’s such a compelling quote, though, because C++ is so messy and dirty, so we want to believe in a small clean underlying core. The truth, however, is that there isn’t one smaller and cleaner programming language struggling to get out. There’s multiple. And from the beginning, C++ was a glomming-together of multiple ideas: a Simula-like OOP system glued awkwardly to C, without a unified motivating vision. Operator overloading was intended to help integrate the two parts, which it did but at the expense of creating its own entire sub-paradigm. And then came templates, which tried to add generic containers and algorithms but unexpectedly exploded into their own programming paradigm. So inside C++, struggling to get out, is of course C, the original “portable assembly,” which does its very simple job well. There’s also Java/C# in there, if we take the OOP features on their own. For the operator overloading and RAII and templates, the closest I can really imagine is Rust, which I think if Bjarne was being fair, he would have to admit is close to what he specified when he clarified his quote: Rust does emphasize “programming styles, libraries and programming environments that emphasized the cleaner and more effective practices over archaic uses focused on the low-level aspects of C.”

#prog #go #article Changing one character wildly improved our application's performance (@go_perf) TL;DR: type uint128 = struct { hi uint64 lo uint64 } func less128(a, b uint128) bool { - return a.hi < b.hi || (a.hi == b.hi && a.lo <= b.lo) + return a.hi < b.hi || (a.hi == b.hi && a.lo < b.lo) } Из-за внесённой ошибки некоторые элементы ошибочно считались равными, из-за чего сортировка делала лишние перестановки в массиве. И вот тут я опять хочу привести в пример Rust как язык, в котором данную ошибку допустить гораздо сложнее: вместо того, чтобы вручную писать сравнение, проще добавить к определению #[derive(Ord)] (ладно, #[derive(PartialEq, Eq, PartialOrd, Ord)], но это всё равно меньше, чем писать руками). И да, неожиданно, но даже C++ в этом плане лучше (правда, лишь начиная со стандарта C++20). В нём можно заставить компилятор сгенерировать все функции сравнения, чтобы не писать их руками: #include <cstdint> #include <compare> struct uint128 { uint64_t hi; uint64_t lo; std::strong_ordering operator<=>(const uint128&) const & = default; };

photo content

Скажите, а к чему снится обстрел из пулемёта гражданских в городе с вертолёта? Причём с точки зрения одного из гражданских

photo content

#meme

программирование на расте - боль программирование на крестах - страдания я мазохистка и предпочитаю боль