Forwarded from Why Typescript is bad (Anton)
#prog #rust #rustlib
syntactic-for — a syntactic "for" loop Rust macro.
Take the sum of the bit-length of four integer types:
syntactic-for — a syntactic "for" loop Rust macro.
Take the sum of the bit-length of four integer types:
let sum = syntactic_for!{ ty in [ u8, u16, u32, u64 ] {
[$( <$ty>::BITS ),*].into_iter().sum::<u32>()
}};
assert_eq!(sum, 120);
Implement a trait for a set of types:syntactic_for!{ ty in [ u8, u16, u32, u64, u128 ] {$(
impl MyTrait for $ty {
// snip.
}
)*}}
В README есть больше примеров, где такой макрос может пригодиться.👍15🤯2
#prog #article
What if two programs did this?
Или о принципе, который позволяет отвергнуть добавление определённых фич в программную систему.
What if two programs did this?
Или о принципе, который позволяет отвергнуть добавление определённых фич в программную систему.
Microsoft News
What if two programs did this?
Another thought experiment when thinking through a feature.
👍1
Forwarded from Таксики и лытдыбр σποραδικος
YouTube
Andre Rieu and Johann Strauss Orchestra - Feuerfest 1996 !!! Polka Francaise - op 269. J. Strauss
Old TV recording of André Rieu and the Johann Strauss Orchestra during a television broadcast in 1996 on Dutch TV !!!
Feuerfest! ('Fireproof!') op. 269 is a polka-française composed by Josef Strauss in 1869.
----------------------------------------------…
Feuerfest! ('Fireproof!') op. 269 is a polka-française composed by Josef Strauss in 1869.
----------------------------------------------…
Если коротко, то проблема ошибок работы с памятью в том, что они добавляют в программу новые пути исполнения, которых нет в исходнике
🤔13👍7
#prog #article
YAGNI exceptions (перевод)
I'm essentially a believer in You Aren't Gonna Need It — the principle that you should add features to your software — including generality and abstraction — when it becomes clear that you need them, and not before.
However, there are some things which really are easier to do earlier than later, and where natural tendencies or a ruthless application of YAGNI might neglect them. This is my collection so far...
YAGNI exceptions (перевод)
I'm essentially a believer in You Aren't Gonna Need It — the principle that you should add features to your software — including generality and abstraction — when it becomes clear that you need them, and not before.
However, there are some things which really are easier to do earlier than later, and where natural tendencies or a ruthless application of YAGNI might neglect them. This is my collection so far...
Luke Plant's home page
YAGNI exceptions
A list of some exceptions to the principle of “You Ain't Gonna Need It” – that is, times when doing a bit more up front usually pays off.
👍9😁1
#prog #rust #article
Folding arguments into the macro
Об одной технике, которая позволяет в некоторых случаях сделать макросы для бойлерплейта более читаемыми.
Folding arguments into the macro
Об одной технике, которая позволяет в некоторых случаях сделать макросы для бойлерплейта более читаемыми.
nnmm’s blog
Folding arguments into the macro
In Rust, you might have written macros to define structs, functions etc. that are similar but not the same. This is a technique that can make these macros nicer in some cases. I’m sure it has been used before, but I haven’t seen it described anywhere yet.
👍1
#prog #rust #article
Zero To Production in Rust book review
<...>
It provides a comprehensive overview of how to make an API endpoint secure. The section covers Basic Authentication, password verification and storage, password reset, cookies, Session-based authentication, and building an Admin dashboard. I think most of us understand these concepts in abstract terms but implementing it from scratch helps you assimilate that knowledge. IMO it's worth buying the book for this chapter alone.
<...>
If you are stuck, you can join the Discord channel run by the author to ask for help or advice
<...>
One of the things I appreciated most about 'Zero to Production' was the author's emphasis on practical, real-world advice. He provides clear, actionable steps for achieving specific goals. In addition to being a valuable resource for developers, its also an enjoyable read. The writing style is clear and engaging, and is sprinkled with personal anecdotes and light humour to keep things interesting.
Zero To Production in Rust book review
<...>
It provides a comprehensive overview of how to make an API endpoint secure. The section covers Basic Authentication, password verification and storage, password reset, cookies, Session-based authentication, and building an Admin dashboard. I think most of us understand these concepts in abstract terms but implementing it from scratch helps you assimilate that knowledge. IMO it's worth buying the book for this chapter alone.
<...>
If you are stuck, you can join the Discord channel run by the author to ask for help or advice
<...>
One of the things I appreciated most about 'Zero to Production' was the author's emphasis on practical, real-world advice. He provides clear, actionable steps for achieving specific goals. In addition to being a valuable resource for developers, its also an enjoyable read. The writing style is clear and engaging, and is sprinkled with personal anecdotes and light humour to keep things interesting.
rusty-ferris.pages.dev
Zero To Production in Rust book review
<p>I recently had the opportunity to read <a rel="nofollow noreferrer" href="https://www.zero2prod.com/index.html">Zero to Production</a>,
a comprehensive guide to building and deploying Rust backend applications.
The book, written by a senior AWS engineer…
a comprehensive guide to building and deploying Rust backend applications.
The book, written by a senior AWS engineer…