Language:
switch to room list switch to menu My folders
Go to page: First ... 106 107 108 109 [110] 111 112 113 114 ... Last
[#] Sat Feb 07 2015 17:49:04 EST from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

yea, thats the theory.

however, I've heard that i.e. java or linters tend to be very picky about this, so people start doing empty catch handlers - wasting the original error with no trace.

Propper errorhandling is always a challenge.

I tend to find (and fix) quiet a bunch of them, wasting the original error condition and leaving no trace to the user to find their mistake without gdb :-(

Citserver has meanwile become pretty good at handling the errors, _and_ reporting.



[#] Sat Feb 07 2015 19:53:33 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


I find the exception handling jarring.

Instead of handling an error code with a clean if statement, you have this insane try/catch thing that fucks up the flow of the code such that it looks like a mess. It's much, much harder to read some of the simplest of conditions because of the fucked up approach required to deal with exception handling, as opposed to handling a return code.

Furthermore, you have no freaking idea who might have raised the exception.
You might want to assume the function you called raised the error, but that isn't necessarily true... it could have been raised by some other arbitrary thing that the function you called called.

And because of the omnipresent nature of exceptions, as used in fucking Java, even if you tried to enforce some kind of rule of 'make sure your function handles every possible exception that each function it calls could raise', you will still lose when someone adds some new exception that you can't anticipate later on.

And the code... the fucking code... it looks like someone puked all over it, it's so nasty.

Years ago, I thought exceptions were kind of cool. That an exception could be raised, cleanly (so I thought) handling any sort of memory management issues in C++ through a common idiom of using constructors and destructors to help manage memory and all that crap. But in practice, I find it's totally shit.
It encourages the writing of code that's harder to understand because the flow of control isn't obvious anymore.

For something absolutely catastrophic, sure, raise an exception. But the wholesale embracing of this form of error management for even the slightest of errors (as used in Java), it's just horrible.

[#] Sun Feb 08 2015 07:45:05 EST from TaMeR @ Uncensored

Subject: Coding is like magic

[Reply] [ReplyQuoted] [Headers] [Print]

Coding is like magic !
You get what you ask for !

TaMeR



[#] Mon Feb 09 2015 07:57:37 EST from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I guess for exceptions counts the same as for C++ 11 auto: you can make it to get your programm slink, but you have to act carefully, else you will end up with an unreadable mess.



[#] Mon Feb 09 2015 11:55:49 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Yeah... auto... I haven't embraced it.

I think in small doses it might be okay, but gads, if used liberally I think it's a poor excuse for knowing your types.

But then, I really, really like the strongly typed nature of C++.

[#] Mon Feb 09 2015 17:33:32 EST from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

auto is ok where it helps with DRY - http://en.wikipedia.org/wiki/Don%27t_repeat_yourself

but that should be about it.



[#] Mon Feb 09 2015 18:31:49 EST from TaMeR @ Uncensored to room_Programming@uncensored.citadel.org

Subject: Re: Coding is like magic

[Reply] [ReplyQuoted] [Headers] [Print]

I been playing with react a javascript toy by Facebook.
I wonder what else they will come up with.

Why can't they just use plain javascript I don't get it. Is it not cool
enough?

This is hello world in react:

```
var HelloMessage = React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});

React.render(<HelloMessage name="John" />, mountNode);
```

http://facebook.github.io/react/

[#] Mon Feb 09 2015 21:24:44 EST from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

however, I've heard that i.e. java or linters tend to be very picky
about this, so people start doing empty catch handlers - wasting the
original error with no trace.

Not really, yes java has strong type checking around checked exceptions, which requires you to catch that exception and deal with it or the compiler will barf--but if you then ignore it with an empty catch block you have only yourself to blame. There is a certain type of programmer - the type of person that doesn't understand that coding standards matter (I also call them assholes), who do this too much. Or maybe there's this mentality that it's OK to just sweep shit under the rug because the overall flow must go on and you're never going to debug it anyway and besides, it can't possibly be wrong because you're god...

I work with some jerks.

[#] Tue Feb 10 2015 08:42:18 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Heh... 'WET'... Write Everything Twice, or We Enjoy Typing. I like that.

[#] Tue Feb 10 2015 08:45:04 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


But, yeah, I see hints of 'auto' being used by some folks as a kind of lazy way to avoid dealing with type checking rather than an application of DRY, and I've already been bit by it where the guy responsible for the offense didn't quite understand what he was doing (wasn't paying attention to types).

This isn't to say I hate 'auto'. It's more to say, be careful how you use it.

[#] Wed Feb 11 2015 16:19:32 EST from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

But then, I really, really like the strongly typed nature of C++.

...until someone types "const" once, and you're stuck with it forever

[#] Fri Feb 13 2015 04:53:28 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Nope, I love const. It has protected me from many a disaster and has forced me to write better code. I embrace const. Although I might not kiss and make love to it.

[#] Fri Feb 13 2015 08:31:22 EST from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Heh, yes const.

nice faqs:

http://oroboro.com

especialy love the backtrace howto article.

(citserver has backtraces, doesn't need C++ demangling, but arangodb needs that...)



[#] Mon Feb 16 2015 12:52:46 EST from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

So my performance evaluation is online:

https://www.arangodb.com/2015/02/16/comparing-atomic-mutex-rwlocks

afaik atomics are also available in c; so maybe some of the citserver code should be adopted ;-)

interestingly atomics are half as fast on windows on the same machine...



[#] Mon Feb 16 2015 18:16:18 EST from TaMeR @ Uncensored to room_Programming@uncensored.citadel.org

Subject: Re: (no subject)

[Reply] [ReplyQuoted] [Headers] [Print]

On 02/16/2015 07:52 PM, dothebart wrote:
So my performance evaluation is online:

https://www.arangodb.com/2015/02/16/comparing-atomic-mutex-rwlocks

afaik atomics are also available in c; so maybe some of the citserver
code should be adopted ;-)

interestingly atomics are half as fast on windows on the same machine...



Yes you are right but it still looks to me like you get the best bang
for the bug on a Linux ARM (Allwinner A20 SOC on Cubie Truck).

What do those cost like $40?

[#] Mon Feb 16 2015 22:08:59 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


That's a very interesting read, dothebart.

[#] Tue Feb 17 2015 05:40:49 EST from dothebart @ Uncensored

Subject: Re: (no subject)

[Reply] [ReplyQuoted] [Headers] [Print]

well, the cubie truck isn't that cheap; However you can get Allwinner A20 boards for around that price.

It seems even MSVC-Devs feel urged to reply to something like that:

http://www.reddit.com/r/cpp/comments/2w3abx/comparing_lockless_programming_with_atomics_in_c/



[#] Wed Feb 18 2015 06:20:52 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


You're right (in reddit) about it being a shame that Microsoft invests so much time only to have something like that screw it all up.

But it's interesting to see them aware of the issue, and trying to come up with a way to improve the performance.

[#] Wed Feb 18 2015 09:58:31 EST from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

need nine more github starts to get the 1k followers filled

https://github.com/arangodb/arangodb

;-)



[#] Sun Feb 22 2015 00:33:57 EST from ax25 @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Yet another way for me to avoid Javascript!  Ho-ray :-)

http://jeanphix.me/Ghost.py/



Go to page: First ... 106 107 108 109 [110] 111 112 113 114 ... Last