Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "metaprogramming"
-
One thing I learnt after over two years of working as a programmer is that sometimes making your code DRY is less important than making your code readable, ESPECIALLY if you're working on a shared codebase. All those abstractions and metaprogramming may look good in your eyes, but might cause your teammates their coding time because they need to parse your mini-framework. So code wisely and choose the best approach that works FOR YOUR TEAM.7
-
Metaprogramming maybe easy to write but is so fucking hard to read and harder to maintain. Why do people even like these dynamic languages anyway :-/
*a very loud and miserable groan which may be cry for help*
I hate my life right now.5 -
Just a thought.
If your project has good coverage with tests, it should be possible to develop an algorithm that recreates your production code entirely from tests.
Just look at IntelliJ - its autosuggestions on missing properties/methods are 99% times correct - I only need to hit that ENTER button. Add some AI to recreate some algorithms and there you go - you can use your tests as both: code specs and a part of QA.
Any takers for the next AI project? :)4 -
The worst question was asked by me once. At least I guess it must have been the worst question for an applicant. She applied for a job as Ruby dev and gave her knowledge of the language a solid 5 Star rating. Something I wouldn't give myself unless my name is Mats. So I prepared some really nice questions about metaprogramming and the object model and stuff. As a warm-up I decided to go easy on her and asked her something simple: "how do you define getters and setters in Ruby?" Which is like one of the first things you learn but not too simple. She got a really red face and told me she didn't know. In the end I had to learn that she never even really programmed Ruby but only wrote some method calls in a file she named .rb and she didn't even know what an object was m(5
-
You know that experience when you update a modern desktop app that uses a zillion abstraction layers and the first time you do anything it freezes for a little bit while the heavily deferred metaprogramming and asset transformations are executed and cached?
I always imagine polystyrene balls flying all over the place.1 -
I just started to learn metaprogramming with C++, and it's awesome. But sometimes I make errors which make me feel like if I'm a baby :o (use 0 instead of 0_c...)
-
define "good".
If it's "knowing one's way around" - then yes, I guess I'm good in the context of some languages. How did I get there?
1. good night sleep (yes, #1; I've learnt from my mistakes during studies)
2. accepting/making up challenging tasks
3. toying around with the tools and abusing them heavily (like creating video games in bash or doing some metaprogramming)
4. when you find it hard to find any material about the tool/language that would be new to you - consider yourself good at it. -
We need a list of functions with an associated string, keyed by a sequential int. Neither can change between program versions. In fact, any changes align perfectly to program versions.
The datastructure: a list of string and func with statically known parameters
The solution my PO insists on: a class with static methods that have an attribute for specifying the number, and a database table of number to string. Whenever you need to pass around the list, you pass around a Type object of the class.6 -
[New Collab]
Well it may be the only learning collab, I didn't read everything. But I started a Entity Component System library to learn some stuff like metaprogramming : https://devrant.io/collabs/826092/...
And I'll be really happy if some people could give me some advices / suggestions about generic C++ libraries and this code :D
I love you <3 -
Almost finish chapter 4 of rust book. I must say I'm so amazed by this language. Just like the first time I learn metaprogramming ruby.
Awesome in every level. You should try learning it too! :)12 -
Learning modern metaprogramming C++. Because I'm not even sure if there is others people working on it in my country x)2
-
TIL vanilla Java has the facilities to do (some form) of arbitrary compile time metaprogramming via annotation processors5
-
Oh, hi "metaprogramming" (PHP in runtime), long time no see. Which reminds me why I ended up hating Rails & Ruby so much back then.
-
I predict as soon as impl specialization enters stable Rust - if it will extend to member types - CRTP will become omnipresent, because the nature of CRTP is that it's an incredibly unintuitive solution that emerges from simple answers to common questions.2