Reputation
551
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
5 14
Impact
~10k people reached

May
1
comment What are the benefits of an input/output component design?
@AdamZuckerman We failed our last two projects, are now being sued, and are already overdue on our current project that is only 20% done. Yes, I think my design is better, but after being told "no", I am trying to fit in, and understand our design decisions. I was hoping others could shed light on the positives of this design, because I have not received any clear answers back from my team. From my perspective we are hammering in screws. I don't want to be confrontational, I just want to understand the merits of the design. I want to do my job well-- that's it.
Jul
20
comment Should I initialize C structs via parameter, or by return value?
@cmaster Ok, that's more clear. I can agree with that.
Jul
20
comment Should I initialize C structs via parameter, or by return value?
@cmaster Right. Ok. It's just, there's no actual constructors in C. In C++, it's impossible to get an instance of an object without "constructing" it. Constructors are called implicitly when getting an instance, and that's what I was trying to mimic here in C. But you might say that "C is not C++", in which case fine.
Jul
20
comment Should I initialize C structs via parameter, or by return value?
I didn't think copies would be an issue because of en.wikipedia.org/wiki/Copy_elision
Jul
20
comment Should I initialize C structs via parameter, or by return value?
@JacquesB I got " Every component that you build will be different than others. There is an Initialize() function used elsewhere for the struct. Technically speaking, calling it a constructor is misleading."
Jul
20
comment Should I initialize C structs via parameter, or by return value?
@Jefffrey We're in C, so we can't actually have methods. It's not always a direct set of values either. Sometimes initializing a struct is to get values(somehow), and performs some logic to initialize the struct.
Jul
20
comment Should I initialize C structs via parameter, or by return value?
Ok, seems reasonable. I was under the impression that initializing an object without being able to see what kind of input was initializing it, would lead to confusion. I was trying to follow the concept of data in / data out to produce predictable and testable code. Doing it the other way had seemed to increase coupling as the source file of my struct needed extra dependencies to perform the initialize. You're right though, in that I don't want to rock the boat unless one way is highly preferred over another.
Jul
20
comment Should I initialize C structs via parameter, or by return value?
@gnat This is an explicit question about struct initialization. That thread embodies some of the same rationale I would like to see applied for this particular design decision.
Jan
16
comment Is it a good idea to provide different function signatures that do the same thing?
lots of up-votes. I will stop immediately. thank you.
Sep
21
comment Why isn't the arrow operator in C++ just an alias of *.?
What does your example illustrate? Are you returning a smart pointer to a string and somehow outputting the size? I'm confused.