|
I've been doing almost exclusively c# for the last few months and I like it a bunch. I just wish there were checked exceptions and a maven like. gonna be rewriting our existing call center app soon in wpf and its gonna own so much. make me ceo of Microsoft and i'll fix it ez.
|
# ? Mar 1, 2013 02:56 |
|
|
# ? Jun 11, 2024 01:03 |
|
Base Emitter posted:C is great and C++ ok as domain specific languages for loving with hardware and graphics and writing runtimes for other languages and doing other related things. but dude, what if its shifting it into the stream
|
# ? Mar 1, 2013 02:56 |
|
FamDav posted:jmp as gently caress yeah that was my assumption, whoops
|
# ? Mar 1, 2013 03:01 |
|
Werthog 95 posted:i'm only just now learning how to do c++ the right way but "gogo cleanup-code;" does not sound very exception-safe FamDav posted:im not sure how you're using it as an alternative since variables that are to be destructed at the end of a block will do so even if you use goto. Gazpacho fucked around with this message at 03:15 on Mar 1, 2013 |
# ? Mar 1, 2013 03:02 |
|
Shaggar posted:I've been doing almost exclusively c# for the last few months and I like it a bunch. I just wish there were checked exceptions and a maven like. checked exceptions are bad. they make sense if you only look at little toy projects but in any real world application they get to be unmanageable. enjoy your unchecked c# exceptions because c# is already right.
|
# ? Mar 1, 2013 03:02 |
|
Notorious b.s.d. posted:i'm not sure we can even call all of these "perks:" https://www.expensify.com/jobs/offshore somebody post that "startup culture fit" blog again because that was great
|
# ? Mar 1, 2013 03:19 |
|
Shaggar posted:also operator overloading is the worst thing Let's say I have two 3D vectors. Which looks better? v1 * v2 v1.multiply_by(v2) vec3fmult(v1, v2)
|
# ? Mar 1, 2013 03:25 |
|
Gazpacho posted:the cleanup code is specifically for the sake of variables that do not have destructors, or for which the wrapper class's semantics are not quite what you need even so, variables with automatic storage will still be destructed once they go out of scope. youre not avoiding raii if you have bare pointers or classes whose destructors cant independently destruct the class, you're just not taking advantage of it i imagine youre talking about dealing with junk like handles from windows apis but seriously man wrap that poo poo up. EDIT: i have no with problem goto i just think calling it an alternative to raii is silly. also goto's force you into declaring/initializing things upfront which is weird FamDav fucked around with this message at 03:32 on Mar 1, 2013 |
# ? Mar 1, 2013 03:25 |
|
Bream posted:Let's say I have two 3D vectors. Which looks better? Well, did you mean v1.multiply_components(v2); v1.inner_product(v2); v1.cross_product(v2); and this is why operator overloading is loving terrible. Unless an operator means the same thing every time, you can't read your goddamned code any more, and v1*v2 doesn't clearly and definitely mean a specific one of these, and every way the semantics of an operation differ from "real" * is an opportunity to gently caress something up. Also, every other project will choose differently than you did, so reading multiple code bases gets even worse.
|
# ? Mar 1, 2013 03:38 |
|
Base Emitter posted:Operator overloading is sketchy as gently caress however and overloading >> to mean io in C++ was the first sign that God had cursed it. operator overloading is loving fantastic if you're doing a lot of math with your C language
|
# ? Mar 1, 2013 03:38 |
|
and operator overloading gets argued about for the 400th time in this 427-page thread
|
# ? Mar 1, 2013 03:39 |
|
using operator overloading is fine unless you're writing libraries in which case DON'T!!!
|
# ? Mar 1, 2013 03:39 |
|
Base Emitter posted:Operator overloading is sketchy as gently caress however and overloading >> to mean io in C++ was the first sign that God had cursed it. operator overloading is loving fantastic if you're doing a lot of math with your C language Base Emitter posted:Well, did you mean this is no different than old fashioned paper math where X * Y means very different things for scalars and tensors
|
# ? Mar 1, 2013 03:39 |
|
operator overloading owns, dwi if you can't quickly get your head around what symbol means what operation then you probably couldn't handle math classes in the first place sure, it should be used sparingly outside of math... whatever man
|
# ? Mar 1, 2013 03:42 |
|
Base Emitter posted:checked exceptions are bad. they make sense if you only look at little toy projects but in any real world application they get to be unmanageable. enjoy your unchecked c# exceptions because c# is already right. this is super wrong and a sign your design is bad
|
# ? Mar 1, 2013 03:43 |
|
see e.g. the page in every math book ever that shows the author's own arbitrary scheme of symbols and fonts
|
# ? Mar 1, 2013 03:44 |
|
operator overloading is another form of code obfuscation that will be abused more often than its useful. sure it makes sense for math, but theres no way to restrict it to math.
|
# ? Mar 1, 2013 03:45 |
|
more ternary operators all the time use them a lot
|
# ? Mar 1, 2013 03:46 |
|
overload the ternary operator as rand(a) % b yospos ? 420 : 69
|
# ? Mar 1, 2013 03:49 |
|
everyone goes all pear shaped the minute they have to type a few words. I dont know why code terseness has been elevated to a position so out of proportion with its utility but it bugs me. I suspect its because people see these tiny, terse little examples in books and assume the terseness is there for a good technical reason instead of just because it had to fit on a page.
|
# ? Mar 1, 2013 03:49 |
|
Base Emitter posted:Well, did you mean But there's no such thing as a "real" * for non builtin types, so if you're already defining a type, then you probably know what you mean, right? I take your point that if someone were to hand you something out of context, this question would be appropriate, but once you've seen the definition and say "Oh, okay, they mean componentwise multiplication" then (especially) v1 *= v2 becomes a lot more readable than v1 = v1.multiply_components(v2).
|
# ? Mar 1, 2013 03:50 |
|
rotor do you need bigger type because of your old eyes
|
# ? Mar 1, 2013 03:51 |
|
Shaggar posted:operator overloading is another form of code obfuscation that will be abused more often than its useful. sure it makes sense for math, but theres no way to restrict it to math. Only your good sense, man-o. I want to hear stories of non-const overloads of ~ and & with bonus side effects!
|
# ? Mar 1, 2013 03:53 |
|
I'm young
|
# ? Mar 1, 2013 03:53 |
|
Bream posted:Only your good sense, man-o. overloading the reference operator could be useful if you want to implement some crazy memory management scheme under the hood. notice i said crazy
|
# ? Mar 1, 2013 03:59 |
|
teaching things from first principles isn't a controversial idea in any other field of engineering, and there isn't much to get about asm. it's not practical but neither is differentiating x^2 from first principles.
|
# ? Mar 1, 2013 04:00 |
|
Shaggar posted:operator overloading is another form of code obfuscation that will be abused more often than its useful. sure it makes sense for math, but theres no way to restrict it to math. every language feature can and has been abused badly, that's not a valid reason to strip it out see: junior developer death by reflection, or N-level inheritance/interface abstraction hierarchies
|
# ? Mar 1, 2013 04:04 |
@tef: yesss matz just explained a feature of parse.y to me - it did take a few minutes of grepping http://t.co/fRFJeYvoVs
|
|
# ? Mar 1, 2013 04:08 |
|
reflection is more work than doing it the right way, though, so you have to actively want to do the wrong thing. operator overloading is a shortcut for lazy shits who want to save a few keystrokes at the expense of readability.
|
# ? Mar 1, 2013 04:11 |
|
gucci void main posted:@tef: yesss matz just explained a feature of parse.y to me - it did take a few minutes of grepping http://t.co/fRFJeYvoVs This thread got so bad that tef stopped posting, and now sulk is just quoting his twitter account.
|
# ? Mar 1, 2013 04:15 |
|
tef isn't on the internet much lately
|
# ? Mar 1, 2013 04:16 |
|
Bream posted:But there's no such thing as a "real" * for non builtin types, so if you're already defining a type, then you probably know what you mean, right? I take your point that if someone were to hand you something out of context, this question would be appropriate, but once you've seen the definition and say "Oh, okay, they mean componentwise multiplication" then (especially) v1 *= v2 becomes a lot more readable than v1 = v1.multiply_components(v2). you probably know what you mean, but other people who want to use your code wont. (no one wants to use ur code tho so its cool)
|
# ? Mar 1, 2013 04:16 |
|
Shaggar posted:you probably know what you mean, but other people who want to use your code wont. (no one wants to use ur code tho so its cool) No one wants to read your posts, and yet . . .
|
# ? Mar 1, 2013 04:17 |
|
rotor posted:tef isn't on the internet much lately Maybe I can summon him by posting about the embeddable Prolog interpreter that I made PROLOG PROLOG PROLOG
|
# ? Mar 1, 2013 04:17 |
|
Shaggar posted:reflection is more work than doing it the right way, though, so you have to actively want to do the wrong thing. operator overloading is a shortcut for lazy shits who want to save a few keystrokes at the expense of readability. C# supports reflection and yet somehow you find the courage not to use it operator overloading works the same way
|
# ? Mar 1, 2013 04:24 |
|
java supports reflection too. in both cases its work to use. operator overloading is just another method.
|
# ? Mar 1, 2013 04:26 |
|
i dont totally get why the overloading thing is such a thing is it really that useful? i mean i get the ideas of simple indicators of complex things like vector multiplies, and why it'd be easy to work with, but how often is it really used
|
# ? Mar 1, 2013 04:53 |
|
Shaggar posted:java supports reflection too. in both cases its work to use. operator overloading is just another method. ok, C# apparently supports operator overloading as well and yet you never use it so maybe it's not as virulent as you think Jonny 290 posted:i dont totally get why the overloading thing is such a thing in math heavy code, literally everywhere computer math isn't so different from paper math that way, it's not like mathematicians couldn't write out "clockwise integral over a closed loop" instead of a tall S with a circle in it, but if they did it would make every equation really long hopefully some pedant points out you would never overload an operator to do that so I can paste a line of FEM code where replacing the unary ops with .multiply/.add etc would increase its length 500% flashbacks to grad school here, yospos is a bad trip tonight skeevy achievements fucked around with this message at 05:02 on Mar 1, 2013 |
# ? Mar 1, 2013 04:55 |
|
Jonny 290 posted:i dont totally get why the overloading thing is such a thing "augh typing is so hard I hate it!. I'm not writing a novel here!" - why people love operator overloading
|
# ? Mar 1, 2013 04:56 |
|
|
# ? Jun 11, 2024 01:03 |
|
http://ashkenas.com/literate-coffeescript/ ahhaahhhahaah
|
# ? Mar 1, 2013 05:07 |