<John_Ivan__>
adam12, what is your suggestion? go with an orm/sql, or go ahead and make walking skeleton tests?
<adam12>
John_Ivan__: I'm still not sure what you're looking to achieve. You provided a C#? example and are not set on writing a lot of tests.
<adam12>
John_Ivan__: This is easily achievable in Ruby. Since this is a Ruby channel, that's what I optimized my answer for.
<John_Ivan__>
i see.
<John_Ivan__>
adam12, yeah, honestly, i don't even know what I want tbh.
shimme12 has joined #ruby
<adam12>
John_Ivan__: At a certain point, some tests are not "necessary" or "sufficient", two pieces of criteria one can use to evaluate what tests to write or keep.
<adam12>
John_Ivan__: If I'm using PStore/YAML::Store as shown in my example, I might not test aspects of those already covered by their own comprehensive test suites.
<adam12>
(in the same way if I was using an ORM I wouldn't test certain aspects of the data being written to the DB)
<John_Ivan__>
adam12, I see.
<adam12>
Back to your original question, you could ORM/SQL _and_ walking skeleton test. They are not mutually exclusive.
<adam12>
I might not ORM/SQL immediately, but marshalling YAML is going to be slow (as is parsing/updating `ini`, likely). Moving to a sqlite database would be an easy enough win to be a bit future-proof.
<John_Ivan__>
adam12, understood. thank you.
<John_Ivan__>
then I'll move it over to sql
<John_Ivan__>
my c# version.
keypresser86 has quit []
<adam12>
John_Ivan__: IMHO, follow the quote from Kent Beck
<adam12>
Make it work. Make it right. Make it fast.
<John_Ivan__>
adam12, I often get stuck in between those. i make it work. i don't know if i make it right. i make it "fast enough" to not bother me.
<adam12>
John_Ivan__: It's usually just something you acquire over time.
<John_Ivan__>
and then I'm left with question marks thinking to myself
<John_Ivan__>
adam12, "i can break this in 20 different ways and I don't trust what I wrote. fuck yes. i'm not gonna use this"
<adam12>
But I'd probably try to extract out a small piece and ask for feedback on how to improve it. But code examples go a long way here (obviously).
<John_Ivan__>
and then I leave it or re-write it in another language. at least, that's how this little "string/parsing" project has been for me.
<John_Ivan__>
adam12, sometimes going for functional language in the hope that the code I write will be forcefully more "correct and concise"
johnjaye has quit [Read error: Connection reset by peer]
<adam12>
(you could build your own .ini parser with it)
<adam12>
tho it's maybe way out of your way now. I'd just use built-in's until I couldn't. At least for Ruby, the batteries included stdlib is a huge attraction.
<John_Ivan__>
adam12, i merely went with an ini parser because I knew the amount of entries i'll ever write in it won't go over 10k
<leftylink>
but that is the only way I could think of that you could get a colon to appear after `if` and still have it work
<leftylink>
but that syntax error ruins it
<leftylink>
an of course I use the word "work" in a flexible manner anyway
<leftylink>
since the condition doesn't matter
Jojero has joined #ruby
fakenullie has left #ruby [WeeChat 2.8]
MarvelousWololo has joined #ruby
Jojero has quit [Read error: Connection reset by peer]
Jojero has joined #ruby
caedmon has joined #ruby
jess has joined #ruby
caedmon has quit [Ping timeout: 260 seconds]
gambol has quit [Remote host closed the connection]
Jojero has quit [Remote host closed the connection]
markong has joined #ruby
shokohsc5 has quit [Ping timeout: 245 seconds]
shokohsc5 has joined #ruby
shokohsc50 has joined #ruby
shokohsc5 has quit [Ping timeout: 246 seconds]
shokohsc50 is now known as shokohsc5
glider_ is now known as glider
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
markong has quit [Ping timeout: 272 seconds]
Pixi` has quit [Quit: Leaving]
impomatic has joined #ruby
<impomatic>
Hi, I've written a short program to calculate optima numbers. It works fine, but I wondered if anyone has a moment to suggest any improvements please. New to Ruby, so not sure if anything is considered bad practice / style, or if there's a simpler way to implement. https://corewar.co.uk/optima/optima.rb