taxorubio, It's one of those Mondays... #programming #cpp
vascorsd, You may not like it, but hear me out...
For new #scala code using the newer weird white space syntax you should try to configure the formatter to give you 3 spaces as the indent.
It just makes everything better. Go and try 🫣 :catPOWER:
I tried it the other day before turning the newer syntax off completely and it looked much better than 2 spaces.
:blobpeek:
vascorsd, @dwardoric seeing too deep nesting and the code running off the screen to the right kinda screams at you to try and simplify it earlier and to move things to other functions 🤔
vascorsd, Portuguese @ragb it's easy to mix them. For understanding when and how to use them you need a deep understanding of what they are meant to be used for, which newbies won't know or understand earlier in their career.
It happened a lot having parameters that you want to align and variable declarations and other things, but then having the tab key not expanding automatically to spaces means that you will use it in the middle of code to try to align things accidentally and inherently things will end up mixed.
oblomov, I have a question for people with better theoretical background on #ObjectOriented #programming and especially for #CPlusPlus developers.
#askFedi #fediHelp Is the following pattern known and does it have a name?
I have a number of classes (call them C1, C2, etc) that all derive from the same class B. I have a superclass (template, actually) D that derives from C1, C2 etc. To have a single B, the standard solution is to go with virtual inheritance to close the diamond (so far, so good).
1/n
omalley, @oblomov most of the newer languages (eg. #RustLang or #GoLang) don’t support inheritance between classes/structs. They only support implementation of traits, which only define interface and not implementation. In general, using inheritance for implementation reuse is brittle and I like to avoid it.
oblomov, @omalley as interesting this may be, it's not really what I was asking about 8-D
vascorsd, And am extremely confused with some of new syntax. So if I have a enum with a case X I can't simply add a method for a specific case by just doing
enum AST
case Str(v : String) {
def newMethodIWantHere...
}Seems very weird. Probably doing something wrong again 🤔😮💨
davesmith00000, @vascorsd This had me stumped for a long time, too! Here is how I think you're supposed to do it:
enum AST: case Str(v: String) case Num(i: Int) object AST: object Str: extension (s: Str) def foo: String = "value: " + s.v AST.Str("Hello").foo // AST.Num(0).foo // Does not compile
vascorsd, @davesmith00000 yeah that works. I ended up also using some of those extensions for the enum members as well for their companion objects. Like
extension (so: Str.type) { def empty = ... }
Kinda works, which is nice.
It's a little frustrating that I can't do
extension (_: Str.type)
orextension (Str.type)
.Extensions and enums kinda pair well with each other.
pbarker, Never, ever write the words:
"I'm planning to send [the next version of my patches] in the next hour or so, assuming my tests pass."
This is actually a magic spell which will cause your tests to immediately fail with a NULL pointer dereference.
philip_schwarz, just uploaded to https://fpilluminated.com 🚀🆕 : "A Sighting of filterA in Typelevel Rite of Passage" - based on a short extract from Rock the JVM's great video course #scala #cats #fp #functionalprogramming
direct link: https://fpilluminated.com/deck/220
BentiGorlich, It is very annoying that I think about working on mbin all the time when I am at work.
I started working on messages between users yesterday and I keep having new ideas how to implement them 😁
BentiGorlich, @melroy
Maybe that would be a good idea 🤔Btw I was impressed to learn that federation for messages is not only not working it is not implemented at all 😅
melroy, @BentiGorlich It is indeed not implemented at all in kbin indeed. It never was. So if we implement this, then Mbin has another new bullet point for on the readme page ;P
vascorsd, I was pointed out yesterday to scodec for #scala. It has some important things there that seem very useful and will likely use it.
It's just pretty sad that such a known, useful, stable library has most of the site with incomplete docs, broken links and incomplete released version numbers.
Example:
- incomplete docs: from this on https://scodec.org/guide/Collections.html
- https://scodec.org/api/ scodec-protocols 1.2.0 link broken; versions on the page are not latest and you need to check github
🫣
vascorsd, This library is better than official scala docs where I spent some hours the other day navigating the confusion of some Collections trying to understand the different ways I could create an ordered Map and basically giving up on the idea because I was unsure of what I should use.
I mean I eventually got the information I wanted, but it was from jumping between google, stack overflow, scala main page and a bunch of api docs.
But it didn't left with with any confidence for what I was doing.
😮💨
vascorsd, In general the official #scala API docs are very very lacking and generally suck.
Methods have barely any description on them. There are no examples in most methods to understand them. Important methods and collections lack explanation of their characteristics related to performance, runtime, O notations of each etc. Barely describe where each is more appropriate vs others, etc.
🫣
dominucco, JarJar is such an epic coder that he’s monitor is backwards #programming #starwars
bcon, @dominucco not pictured is a mirror. Jar Jar is all about his tricks… sneaky Jar Jar
hankg, @dominucco …at least they got the fingers right for once, ironically lol…
stevensanderson, New distribution stats functions in TidyDensity!!
Post: https://www.spsanderson.com/steveondata/posts/2024-06-04/
#R #RStats #RProgramming #Programming #Code #Coding #Data #DistributionStatistics #Statistics
vascorsd, Holy cow, I enabled strict equality on #scala to see if it fixed my problems and now I have to manually add a "derives CanEqual" to every enum that I want to compare. Wth :aaaa: :welp: :wyd: