archived stringclasses 2
values | author stringlengths 3 20 | author_fullname stringlengths 4 12 ⌀ | body stringlengths 0 22.5k | comment_type stringclasses 1
value | controversiality stringclasses 2
values | created_utc stringlengths 10 10 | edited stringlengths 4 12 | gilded stringclasses 7
values | id stringlengths 1 7 | link_id stringlengths 7 10 | locked stringclasses 2
values | name stringlengths 4 10 ⌀ | parent_id stringlengths 5 10 | permalink stringlengths 41 91 ⌀ | retrieved_on stringlengths 10 10 ⌀ | score stringlengths 1 4 | subreddit_id stringclasses 1
value | subreddit_name_prefixed stringclasses 1
value | subreddit_type stringclasses 1
value | total_awards_received stringclasses 19
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
True | [deleted] | null | So.. if we have `List<[Rectangle]>` can we downcast it to `List<[Shape]>` somehow?
Assuming that rectangle is subclass of Shape.
And we want compile time type checks. | null | 0 | 1316065075 | False | 0 | c2k03rj | t3_kfvm7 | null | t1_c2k03rj | t3_kfvm7 | null | 1427602398 | 2 | t5_2fwo | null | null | null |
True | [deleted] | null | [deleted] | null | 0 | 1316065190 | False | 0 | c2k045j | t3_kfirl | null | t1_c2k045j | t1_c2jxu2a | null | 1427602403 | 0 | t5_2fwo | null | null | null |
True | tinou | null | You can do that in ocaml too, and it is strict :
let rec xs = 1::2::3::xs;; | null | 0 | 1316065279 | False | 0 | c2k04g6 | t3_kfvm7 | null | t1_c2k04g6 | t1_c2jz3ti | null | 1427602407 | 5 | t5_2fwo | null | null | null |
True | splicerslicer | null | March 3, 2012 I believe.
I simply cannot believe you did not fully read the terms before agreeing to them. ;)
edit: wrong year, I'm an idiot | null | 0 | 1316065350 | True | 0 | c2k04nw | t3_kewkd | null | t1_c2k04nw | t1_c2juge8 | null | 1427602410 | 2 | t5_2fwo | null | null | null |
True | howardRoark36 | null | only for basic types. everything else is a reference. in the example, it'd be better to pass a StringBuilder | null | 0 | 1316065433 | False | 0 | c2k04x1 | t3_kg7nl | null | t1_c2k04x1 | t3_kg7nl | null | 1427602414 | 4 | t5_2fwo | null | null | null |
True | splicerslicer | null | Why did they hide WMP? Their start screen should really contain all of the available programs. | null | 0 | 1316065441 | False | 0 | c2k04xq | t3_kewkd | null | t1_c2k04xq | t1_c2juluk | null | 1427602414 | 1 | t5_2fwo | null | null | null |
True | splicerslicer | null | Link? | null | 0 | 1316065499 | False | 0 | c2k0551 | t3_kewkd | null | t1_c2k0551 | t1_c2jv282 | null | 1427602417 | 1 | t5_2fwo | null | null | null |
True | munificent | null | > The bigger the game, the more wasteful ineffective code becomes. The State Pattern allows us to have the same behaviour without all of that unnecessary checking.
The code is still doing that checking, it's just doing it with polymorphic dispatch instead of an `if`. There's indirection (and likely a cache miss) ei... | null | 0 | 1316065567 | True | 0 | c2k05ch | t3_kfuqy | null | t1_c2k05ch | t3_kfuqy | null | 1427602419 | 8 | t5_2fwo | null | null | null |
True | splicerslicer | null | I did this. I was really surprised it worked. I just had a Win7 partition I wasn't using so I mounted it using Daemon started it up, took a shower, came back and I had Windows 8. | null | 0 | 1316065595 | False | 0 | c2k05ff | t3_kewkd | null | t1_c2k05ff | t1_c2juh5s | null | 1427602420 | 1 | t5_2fwo | null | null | null |
True | newbill123 | null | Gotcha. I thought it was an incestuous "inside Redmond campus" always knows what's right for 3rd party developers or something. Thanks for the clarification. | null | 0 | 1316065620 | False | 0 | c2k05ic | t3_hq4zm | null | t1_c2k05ic | t1_c2k034n | null | 1427602422 | 1 | t5_2fwo | null | null | null |
True | Negitivefrags | null | In terms of ease of use, I think that there is there is value to be had in composing two simple primitives in a natural way.
In terms of boost as a dependency, one thing we have found in our code base is that >90% of the boost we used before were the smart pointers and things like ptr_vector that we can now avoid.
... | null | 0 | 1316065728 | False | 0 | c2k05u8 | t3_kf43e | null | t1_c2k05u8 | t1_c2jxld7 | null | 1427602426 | 2 | t5_2fwo | null | null | null |
True | timbowen | null | Reclaimer: I have been a professional iOS developer for 3 years and these are all valid criticisms. I can take them uno by uno.
* JSONKit is good but if the built in interpreter is better or even just good enough it is almost always better to prevent code bloat by using built in resource. I was also diving into JS... | null | 0 | 1316065769 | False | 0 | c2k05yi | t3_kfirl | null | t1_c2k05yi | t1_c2jy770 | null | 1428194055 | 5 | t5_2fwo | null | null | null |
True | munificent | null | Sum types wouldn't eliminate the pattern, since matching on the constructors is no different than doing a switch on an enum in this case, where the arms of the sum don't have different data.
Function values would work here since the states are stateless, and you can indeed do that in C++. | null | 0 | 1316065818 | False | 0 | c2k0643 | t3_kfuqy | null | t1_c2k0643 | t1_c2jyspz | null | 1427602429 | 2 | t5_2fwo | null | null | null |
True | munificent | null | > Think about structures like circularly linked lists.
Those aren't too bad if you're willing to sacrifice immutability for the relatively few cases where this turns up. Just initialize to a sentinel value (or make its type nullable and initialize to null) then wire it back up later. | null | 0 | 1316065949 | False | 0 | c2k06ke | t3_kfvm7 | null | t1_c2k06ke | t1_c2jz3ti | null | 1427602435 | 2 | t5_2fwo | null | null | null |
True | munificent | null | It's a perfectly good reason to *make* one. Everyone is free to re-invent, and it's a profitable exercise for the re-inventor. It may not be a good reason for *someone else* to *use* that language, but that's a different question entirely. | null | 0 | 1316066057 | False | 0 | c2k06ww | t3_kfvm7 | null | t1_c2k06ww | t1_c2jzy1n | null | 1427602440 | 22 | t5_2fwo | null | null | null |
True | kirakun | null | I'm pretty sure I know how apps work. (I wrote a few of them.)
Just curious, what made you say that?
BTW, I was just joking on the ridiculous restrictions (or what used to be) that Apple placed on the developers. I had to mention that because I don't think you understand jokes. :) | null | 0 | 1316066087 | True | 0 | c2k070i | t3_kfirl | null | t1_c2k070i | t1_c2k045j | null | 1427602441 | 2 | t5_2fwo | null | null | null |
True | Nok1 | null | quite possibly the best thing to come out of BUILD are the new VS tools | null | 0 | 1316066112 | False | 0 | c2k073g | t3_kg44k | null | t1_c2k073g | t3_kg44k | null | 1427602452 | 2 | t5_2fwo | null | null | null |
True | alexeyr | null | > Let's say I've got a variable named "sum". Why should I have to explicitly initialize it to 0?
Because you don't want to have the default value depend on variable name? | null | 0 | 1316066151 | False | 0 | c2k077z | t3_kfvm7 | null | t1_c2k077z | t1_c2jy18p | null | 1428194055 | 3 | t5_2fwo | null | null | null |
True | chaoticprout | null | Tile Puzzle is included in the Developer Preview build of Windows 8! | null | 0 | 1316066194 | False | 0 | c2k07ct | t3_kewkd | null | t1_c2k07ct | t1_c2k0551 | null | 1427602445 | 1 | t5_2fwo | null | null | null |
True | wot-teh-phuck | null | UnknownTales3 is a "pro-haskell" troll. Please don't try to take his words seriously. | null | 0 | 1316066419 | False | 0 | c2k081r | t3_kful5 | null | t1_c2k081r | t1_c2jyfeo | null | 1427602454 | 5 | t5_2fwo | null | null | null |
True | cashto | null | class Player
{
std::function<void (int)> damageStrategy;
int health;
public:
void setStateShielded()
{
damageStrategy = [health&](int i) { health -= i / 2; };
}
void setStateNormal()
{
damageStrategy = [health&... | null | 0 | 1316066427 | True | 0 | c2k082m | t3_kfuqy | null | t1_c2k082m | t1_c2k03mp | null | 1427602455 | 1 | t5_2fwo | null | null | null |
True | eric_t | null | Decent introduction to Mathematica, but given the title I expected to see some skin renders... | null | 0 | 1316066810 | False | 0 | c2k097m | t3_kfc1f | null | t1_c2k097m | t3_kfc1f | null | 1427602469 | 1 | t5_2fwo | null | null | null |
True | danharaj | null | Yeah, the sums are irrelevant here, I just included them for completeness sake. Function values and strong sum types are the low-hanging fruit of high level languages. | null | 0 | 1316066824 | False | 0 | c2k0990 | t3_kfuqy | null | t1_c2k0990 | t1_c2k0643 | null | 1427602470 | 2 | t5_2fwo | null | null | null |
True | [deleted] | null | [deleted] | null | 0 | 1316066973 | False | 0 | c2k09ok | t3_kfms2 | null | t1_c2k09ok | t1_c2jzx5m | null | 1427602476 | 1 | t5_2fwo | null | null | null |
True | [deleted] | null | [deleted] | null | 0 | 1316067020 | False | 0 | c2k09tk | t3_kfvm7 | null | t1_c2k09tk | t1_c2jxl4n | null | 1427602477 | 1 | t5_2fwo | null | null | null |
True | danthrax | null | I thought I read March 2012 in the ToC. | null | 0 | 1316067046 | False | 0 | c2k09w8 | t3_kewkd | null | t1_c2k09w8 | t1_c2k04nw | null | 1427602478 | 1 | t5_2fwo | null | null | null |
True | splicerslicer | null | lol thanks | null | 0 | 1316067309 | False | 0 | c2k0ap0 | t3_kewkd | null | t1_c2k0ap0 | t1_c2k09w8 | null | 1427602489 | 1 | t5_2fwo | null | null | null |
True | aivarannamaa | null | For a new baggage-less language, having null value in all (reference) types looks like a serious mistake. Better use disjoint sum types for nullable things and provide concise syntax for it (eg. String?) | null | 0 | 1316067340 | False | 0 | c2k0asb | t3_kfvm7 | null | t1_c2k0asb | t3_kfvm7 | null | 1427602490 | 23 | t5_2fwo | null | null | null |
True | splicerslicer | null | Hah! I already played it and didn't even make the connection.
Congrats, it's a fun game. | null | 0 | 1316067438 | False | 0 | c2k0b23 | t3_kewkd | null | t1_c2k0b23 | t1_c2k07ct | null | 1427602493 | 1 | t5_2fwo | null | null | null |
True | dauphic | null | It is! It could be re-implemented using placement new, as long as you make sure the sub-classes all have the same size. | null | 0 | 1316067570 | False | 0 | c2k0bex | t3_kfuqy | null | t1_c2k0bex | t1_c2jzum2 | null | 1428194052 | 3 | t5_2fwo | null | null | null |
True | aivarannamaa | null | There's big difference: lambdas allow writing higher level code, mutexes and possibility for instruction twiddling are low level features. | null | 0 | 1316067641 | False | 0 | c2k0bmr | t3_kf2xi | null | t1_c2k0bmr | t1_c2jvk7r | null | 1427602502 | 2 | t5_2fwo | null | null | null |
True | deltageek | null | Um, what? Perhaps you're not aware, but Java only supports pass-by-value. References to objects are still passed by value.
In order to get the functionality of pass-by-reference in which the called method can change what object the caller's reference refers to, you need to wrap the value you're passing. This way, the ... | null | 0 | 1316067714 | False | 0 | c2k0bu8 | t3_kg7nl | null | t1_c2k0bu8 | t1_c2k04x1 | null | 1427602505 | 5 | t5_2fwo | null | null | null |
True | dauphic | null | I think the real headline here is the DirectX debugging and diagnostic support. Debugging graphical applications is a gigantic pain in the ass. | null | 0 | 1316068107 | False | 0 | c2k0cxu | t3_kg44k | null | t1_c2k0cxu | t3_kg44k | null | 1427602521 | 26 | t5_2fwo | null | null | null |
True | Cintax | null | Three words: Honeycomb closed source. | null | 0 | 1316068148 | False | 0 | c2k0d2e | t3_kcwx2 | null | t1_c2k0d2e | t1_c2jxhcm | null | 1427602522 | -1 | t5_2fwo | null | null | null |
True | grauenwolf | null | The example was simplified for explanatory purposes. In read code the line `x ="sam"` may actually be several lines long or contain other conditional logic.
The == for assignment was a typo. | null | 0 | 1316068528 | False | 0 | c2k0e39 | t3_kfvm7 | null | t1_c2k0e39 | t1_c2jyvlb | null | 1427602534 | 1 | t5_2fwo | null | null | null |
True | grauenwolf | null | thanks | null | 0 | 1316068538 | False | 0 | c2k0e4a | t3_kfuii | null | t1_c2k0e4a | t1_c2jyqc0 | null | 1427602534 | 1 | t5_2fwo | null | null | null |
True | andersonimes | null | Generics support in MEF will be great. Have to work around that a lot now. | null | 0 | 1316068561 | False | 0 | c2k0e6b | t3_kfuii | null | t1_c2k0e6b | t3_kfuii | null | 1427602535 | 1 | t5_2fwo | null | null | null |
True | grauenwolf | null | I hear that most of WPF is hardware accelerated, but not from reliable sources. | null | 0 | 1316068591 | False | 0 | c2k0e93 | t3_kfuii | null | t1_c2k0e93 | t1_c2jyqb8 | null | 1427602536 | 2 | t5_2fwo | null | null | null |
True | grauenwolf | null | It was a simplifed example, in real code there could be a lot more logic within each if block. Had my code really been that simple I would have simply using a ternary operator as you did. | null | 0 | 1316068675 | False | 0 | c2k0ehb | t3_kfvm7 | null | t1_c2k0ehb | t1_c2jykvd | null | 1427602539 | 1 | t5_2fwo | null | null | null |
True | grauenwolf | null | Another example:
class Foo
int product
In C# it will initialize product to 0. Why does it do this if it won't initialize a local of the same type? | null | 0 | 1316068757 | False | 0 | c2k0ep6 | t3_kfvm7 | null | t1_c2k0ep6 | t1_c2jyi4d | null | 1427602543 | 1 | t5_2fwo | null | null | null |
True | grauenwolf | null | Then why aren't you required to initialize fields on classes in Java or C#? | null | 0 | 1316068787 | False | 0 | c2k0esi | t3_kfvm7 | null | t1_c2k0esi | t1_c2jy7v8 | null | 1427602542 | -2 | t5_2fwo | null | null | null |
True | grauenwolf | null | That sentinel value would be semantically identical to a null. | null | 0 | 1316069086 | False | 0 | c2k0fk0 | t3_kfvm7 | null | t1_c2k0fk0 | t1_c2jzvds | null | 1427602553 | 18 | t5_2fwo | null | null | null |
True | MatrixFrog | null | True, but I've still found that my favorite thing about Haskell is the lack of NullPointerExceptions. Until I learned Haskell, it never occurred to me that a language without null pointers was even possible. And even if it is more complicated, you could still say
x = if complicatedBooleanExpression then
co... | null | 0 | 1316069172 | False | 0 | c2k0fro | t3_kfvm7 | null | t1_c2k0fro | t1_c2k0ehb | null | 1427602555 | 2 | t5_2fwo | null | null | null |
True | DanielKeep | null | I chose it for writing a modular microsimulation system five years ago. I'd had some experience with it before and felt that the combination of a relatively clean syntax, good native performance and great metaprogramming capabilities would be an advantage.
I still maintain that the project wouldn't have gotten as far... | null | 0 | 1316069187 | False | 0 | c2k0fsw | t3_kaxjq | null | t1_c2k0fsw | t1_c2itwzg | null | 1427602556 | 2 | t5_2fwo | null | null | null |
True | Iggyhopper | null | I'm not familiar with threads. What would be a better solution? | null | 0 | 1316069222 | True | 0 | c2k0fvl | t3_kfiuk | null | t1_c2k0fvl | t1_c2jxb7j | null | 1427602556 | 1 | t5_2fwo | null | null | null |
True | howardRoark36 | null | > References to objects are still passed by value
"passing by reference" has a specific technical meaning, as you noted. i just wanted to make it clear that most objects refer to the object passed; not, for example, a deep copy. and that the proposed workaround is rarely (if ever) needed - including by the exampl... | null | 0 | 1316069256 | False | 0 | c2k0fyp | t3_kg7nl | null | t1_c2k0fyp | t1_c2k0bu8 | null | 1427602557 | 2 | t5_2fwo | null | null | null |
True | elmuerte | null | C and C++ are different languages. Just because C++ builds upon C doesn't mean that C should be part of C++ or vice versa. Because they look so much alike ohloh's tools sometimes cannot distinguish between C and C++.
But anyway, it's just lies, damned lies, and statistics.
It talks about commits. Maybe Java developer... | null | 0 | 1316069379 | False | 0 | c2k0g9t | t3_kftz8 | null | t1_c2k0g9t | t1_c2jxf33 | null | 1427602562 | 1 | t5_2fwo | null | null | null |
True | Iggyhopper | null | But, but...
someone can see my code and steal it! Nooooo! | null | 0 | 1316069430 | False | 0 | c2k0gen | t3_kg2sg | null | t1_c2k0gen | t1_c2jz4ax | null | 1427602563 | 1 | t5_2fwo | null | null | null |
True | Excalibor | null | It's interesting, a new way of watching things from a C++ perspective. Things I find less interesting are:
let as final? let is used to introduce lexicals in most languages, including those he explicitly mentions (like Lisp, Ocaml, ...), this is a really ugly false friend for any other programmer...
"As Python is to ... | null | 0 | 1316069696 | False | 0 | c2k0h3u | t3_kfvm7 | null | t1_c2k0h3u | t3_kfvm7 | null | 1427602572 | 3 | t5_2fwo | null | null | null |
True | munificent | null | Yeah, but those functions aren't actually *closing* over anything. Why not [just do this](http://www.reddit.com/r/programming/comments/kfuqy/design_patterns_the_state_pattern_in_c/c2k05ch)? | null | 0 | 1316069841 | False | 0 | c2k0hhc | t3_kfuqy | null | t1_c2k0hhc | t1_c2k082m | null | 1427602576 | 2 | t5_2fwo | null | null | null |
True | [deleted] | null | Interesting to think of it as a scripting language. Cheers :) | null | 0 | 1316069906 | False | 0 | c2k0hms | t3_kaxjq | null | t1_c2k0hms | t1_c2jx6l5 | null | 1427602579 | 2 | t5_2fwo | null | null | null |
True | ehird | null | Probably because it's a bit of a pain to get the types right so that you have to assign every field in a constructor -- the object has to "exist" but not be passable to any methods expecting anything of its type, because the fields aren't assigned yet.
Of course, that doesn't make it a good idea. | null | 0 | 1316069991 | False | 0 | c2k0hu1 | t3_kfvm7 | null | t1_c2k0hu1 | t1_c2k0ep6 | null | 1427602581 | 2 | t5_2fwo | null | null | null |
True | [deleted] | null | You are, if you want them to have the right values. | null | 0 | 1316070131 | False | 0 | c2k0i6j | t3_kfvm7 | null | t1_c2k0i6j | t1_c2k0esi | null | 1427602586 | 3 | t5_2fwo | null | null | null |
True | kenshou22 | null | Ohh! I get it now /facepalm. Truthfully I've had a lot of difficulty in learning design patterns but I'll revise the blog post tonight to make sure that I'm actually manipulating *states* and not just buried function implementations. Thank you for posting this, it really helped! | null | 0 | 1316070205 | False | 0 | c2k0icu | t3_kfuqy | null | t1_c2k0icu | t1_c2jzjuy | null | 1427602588 | 3 | t5_2fwo | null | null | null |
True | Iggyhopper | null | What about a class wrapper? Do you need the bloat of a StringBuilder? | null | 0 | 1316070236 | False | 0 | c2k0ifl | t3_kg7nl | null | t1_c2k0ifl | t1_c2k04x1 | null | 1427602589 | 1 | t5_2fwo | null | null | null |
True | alexs | null | The keys change but I don't think there's any feedback from the plaintext into the keystream that's used for the values that are XORed to produce the ciphertext. | null | 0 | 1316070443 | False | 0 | c2k0ixu | t3_kfby2 | null | t1_c2k0ixu | t1_c2jywda | null | 1427602596 | 1 | t5_2fwo | null | null | null |
True | x-skeww | null | >Notch isn't a great programmer, he isn't even a good programmer.
You are full of shit. Seriously. | null | 0 | 1316070459 | False | 0 | c2k0izb | t3_kfiuk | null | t1_c2k0izb | t1_c2jurq3 | null | 1427602597 | -2 | t5_2fwo | null | null | null |
True | howardRoark36 | null | i disagree that StringBuilder is bloated (StringBuffer is). of course wrappers work | null | 0 | 1316070508 | True | 0 | c2k0j3q | t3_kg7nl | null | t1_c2k0j3q | t1_c2k0ifl | null | 1427602598 | 1 | t5_2fwo | null | null | null |
True | zeroRepent | null | Its looks really awesome, can't wait to test everything out! | null | 0 | 1316070666 | False | 0 | c2k0jhi | t3_kg44k | null | t1_c2k0jhi | t3_kg44k | null | 1427602602 | 1 | t5_2fwo | null | null | null |
True | grauenwolf | null | Unless the the default happens to be correct.
Or the field never happens to be used in that scenario.
Or the class is designed to detect unitialized values and lazily populate them.
At least try to make an argument that isn't completely nonsensical. | null | 0 | 1316070760 | False | 0 | c2k0jp0 | t3_kfvm7 | null | t1_c2k0jp0 | t1_c2k0i6j | null | 1427602607 | 2 | t5_2fwo | null | null | null |
True | pr1ntscreen | null | Just change your network settings from NAT to bridged. That way you get a "real" ip from your router/isp.
Then activate remote desktop sessions in system properties (remote tab).
Then just run mstsc.exe and connect to the IP given to your virtual machine. Oh and don't say you're sorry for trying to learn new things ... | null | 0 | 1316070787 | False | 0 | c2k0jrd | t3_kewkd | null | t1_c2k0jrd | t1_c2jzl2w | null | 1427602608 | 2 | t5_2fwo | null | null | null |
True | kenshou22 | null | Wow, I had no idea that *this* was how it works. I've got a lot to learn still. Thank you for your feedback! I'll be revising the post later today. | null | 0 | 1316070811 | False | 0 | c2k0jsw | t3_kfuqy | null | t1_c2k0jsw | t1_c2k05ch | null | 1427602608 | 1 | t5_2fwo | null | null | null |
True | grauenwolf | null | Haskell has null pointers, it just happens to express them via the Option monad.
As for no null pointer expections, is that really true? Or is it only kinda-sorta true like it is with F#? Or in other words, does the compiler really prevent you from trying to read an empty Option monad in all cases? | null | 0 | 1316070910 | False | 0 | c2k0k0l | t3_kfvm7 | null | t1_c2k0k0l | t1_c2k0fro | null | 1427602616 | -4 | t5_2fwo | null | null | null |
True | bonzinip | null | You can do speculative type inference, and always fall back to the slower code when it fails. | null | 0 | 1316071050 | False | 0 | c2k0kb6 | t3_kf4hn | null | t1_c2k0kb6 | t1_c2jv3y0 | null | 1427602615 | 2 | t5_2fwo | null | null | null |
True | [deleted] | null | Ehird explained the case of "sum" (ie. it's rare).
Your other example could be written as:
string x = y ? "sam" : "bob";
The `?:` syntax for if is pretty ugly, but luckily this is a new language that does not have to inherit that ;-) | null | 0 | 1316071072 | False | 0 | c2k0kch | t3_kfvm7 | null | t1_c2k0kch | t1_c2jy18p | null | 1427602616 | 1 | t5_2fwo | null | null | null |
True | bonzinip | null | That's exactly the point. | null | 0 | 1316071151 | False | 0 | c2k0kjp | t3_kf4hn | null | t1_c2k0kjp | t1_c2jvoq7 | null | 1427602625 | 1 | t5_2fwo | null | null | null |
True | munificent | null | To be clear, what you describe is closer to the GoF state pattern than what I have here. (Actually, what you describe is closer to the strategy pattern.)
My point is just that if all you need to do is switch between some behavior, and that behavior doesn't need to store any data, you can use a bare function pointer. | null | 0 | 1316071190 | False | 0 | c2k0kn4 | t3_kfuqy | null | t1_c2k0kn4 | t1_c2k0jsw | null | 1427602618 | 2 | t5_2fwo | null | null | null |
True | secret_town | null | Meh - that was a /long/ time ago, I doubt that if any code needed changing, that it hasn't been. | null | 0 | 1316071210 | False | 0 | c2k0kot | t3_kf43e | null | t1_c2k0kot | t1_c2juuz8 | null | 1427602620 | 1 | t5_2fwo | null | null | null |
True | grauenwolf | null | No, but does it necessarily make it a bad idea either?
I've used both C# and Visual Basic for a long time. I have never once been in a situation where I wished for C#'s restriction on initializing simple local types in VB.
VB also implicitly returns the default value (0/null) if you don't use an explicit return state... | null | 0 | 1316071229 | False | 0 | c2k0kqq | t3_kfvm7 | null | t1_c2k0kqq | t1_c2k0hu1 | null | 1427602621 | 1 | t5_2fwo | null | null | null |
True | [deleted] | null | Here's one way to ensure all fields are initialized:
class Vector(public double x, public double y) {
public double magnitude = sqrt(x * x + y * y);
}
Vector v = new Vector(5, 7);
Let the class body be the constructor, and require that all variables are initialized on declaration. Scala does this... | null | 0 | 1316071280 | False | 0 | c2k0kuu | t3_kfvm7 | null | t1_c2k0kuu | t1_c2k0hu1 | null | 1427602622 | 3 | t5_2fwo | null | null | null |
True | secret_town | null | ... and double leading underscores. /from one of Herb Sutter's books. | null | 0 | 1316071311 | False | 0 | c2k0kxf | t3_kf43e | null | t1_c2k0kxf | t1_c2jxffs | null | 1427602623 | 1 | t5_2fwo | null | null | null |
True | kibo | null | Also, me.
Called many times, but it's all in code. | null | 0 | 1316071339 | False | 0 | c2k0kzr | t3_kfms2 | null | t1_c2k0kzr | t3_kfms2 | null | 1427602624 | 4 | t5_2fwo | null | null | null |
True | lanzkron | null | From the PDF:
> N2911 explains that the acronym **SCARY** “describes assignments and initializations that are **S**eemingly erroneous (**C**onstrained by conflicting generic parameters), but **A**ctually work with the **R**ight implementation (unconstrained b**Y** the conflict due to minimized dependencies).”
| null | 0 | 1316071362 | True | 0 | c2k0l1v | t3_kgaop | null | t1_c2k0l1v | t3_kgaop | null | 1427602625 | 18 | t5_2fwo | null | null | null |
True | grauenwolf | null | How does it handle overloading the constructor?
What happens if you have a DTO with a couple dozen fields? | null | 0 | 1316071366 | False | 0 | c2k0l24 | t3_kfvm7 | null | t1_c2k0l24 | t1_c2k0kuu | null | 1427602625 | 3 | t5_2fwo | null | null | null |
True | artsrc | null | One of the great wins for Java developers using Spring is that it help reduce OO programming. OO is to hard for many developers, so as long as the problem is simple, preventing it is a win. | null | 0 | 1316071402 | False | 0 | c2k0l54 | t3_kf2xi | null | t1_c2k0l54 | t3_kf2xi | null | 1427602626 | 1 | t5_2fwo | null | null | null |
True | ukaszg | null | being good programmer, and writing great game are two entirely different things - one does not interfere with the other. | null | 0 | 1316071527 | False | 0 | c2k0lfv | t3_kfiuk | null | t1_c2k0lfv | t1_c2k0izb | null | 1427602630 | 6 | t5_2fwo | null | null | null |
True | ukaszg | null | single thread event/select based? | null | 0 | 1316071562 | False | 0 | c2k0lii | t3_kfiuk | null | t1_c2k0lii | t1_c2k0fvl | null | 1427602631 | 7 | t5_2fwo | null | null | null |
True | [deleted] | null | All of those are valid use cases, *but*:
- The default value is rarely correct - so rare that it's not much of a bother to explicitly initialize it.
- When you detect uninitialized values, you usually do so via a getter method or similar, and thus there's no need for the field to have the "pretty" type, just use the c... | null | 0 | 1316071647 | False | 0 | c2k0lpz | t3_kfvm7 | null | t1_c2k0lpz | t1_c2k0jp0 | null | 1427602633 | 5 | t5_2fwo | null | null | null |
True | MatrixFrog | null | I don't know F# at all. In Haskell, a String is really a String. Not "either null or a String" but an actual String. In our example above, you want x to always be either "sam" or "bob" so you would use String, not Maybe String. And you would know that x could never be null, not because you looked at the code really car... | null | 0 | 1316071847 | False | 0 | c2k0m59 | t3_kfvm7 | null | t1_c2k0m59 | t1_c2k0k0l | null | 1427602640 | 3 | t5_2fwo | null | null | null |
True | [deleted] | null | [deleted] | null | 0 | 1316071873 | False | 0 | c2k0m7i | t3_kfirl | null | t1_c2k0m7i | t1_c2jy52e | null | 1427602641 | 3 | t5_2fwo | null | null | null |
True | grauenwolf | null | It is COM, but with enhancements from .NET such as constructors.
And there is a new language, C++ Component Extensions, which make working with it much easier. Here is my report on the topic:
http://www.infoq.com/news/2011/09/C-Component-Extensions
| null | 0 | 1316071874 | False | 0 | c2k0m7l | t3_kewaq | null | t1_c2k0m7l | t1_c2jqbhr | null | 1427602641 | 2 | t5_2fwo | null | null | null |
True | blergh- | null | For a lot of purposes, a web app is just not fast enough, especially on a mobile device. It is also much more difficult to code.
The idea that you can have a single thing for Android, iOS and Windows Phone is a pipe dream. Sure, if you work hard enough, your app will work on all of these, but it'll look and feel nativ... | null | 0 | 1316071901 | False | 0 | c2k0m9z | t3_kg2sg | null | t1_c2k0m9z | t1_c2jz4ax | null | 1427602642 | 2 | t5_2fwo | null | null | null |
True | secret_town | null | Well there's a down-tech reason too; in 2 places I've been it's because they already had hand-built bespoke collections and either didn't want to bother or, didn't want to muddy up the code with 2 kinds of collection. To be fair the 2nd company started coming around. I have to say though that you'll still see ads that ... | null | 0 | 1316071961 | False | 0 | c2k0meb | t3_kf43e | null | t1_c2k0meb | t1_c2juwpf | null | 1427602643 | 1 | t5_2fwo | null | null | null |
True | glibc | null | At the counter for revolution. | null | 0 | 1316071979 | False | 0 | c2k0mft | t3_ke4a9 | null | t1_c2k0mft | t1_c2jk5t6 | null | 1427602645 | 1 | t5_2fwo | null | null | null |
True | qiwi | null | At a glance, the only feature not in D I could find is runtime multiple dispatch: http://docs.tart.googlecode.com/hg/intro/generics.html -- otherwise it seems overlap extremely with D -- they're both a saner C++ inspired by the modern dynamically typed languages.
| null | 0 | 1316071981 | False | 0 | c2k0mg1 | t3_kfvm7 | null | t1_c2k0mg1 | t1_c2jz7zg | null | 1427602645 | 5 | t5_2fwo | null | null | null |
True | x-skeww | null | I never played Minecraft. I only tested some of the very first builds.
I think he is a pretty damn good programmer based on the things he wrote on JGO (some forum) and based on his 4k entries (I "know" him for over 8 years). He is a very skilled, knowledgeable, and helpful person. | null | 0 | 1316071983 | False | 0 | c2k0mgc | t3_kfiuk | null | t1_c2k0mgc | t1_c2k0lfv | null | 1427602645 | 1 | t5_2fwo | null | null | null |
True | Otis_Inf | null | 'null' isn't a value, it means the variable hasn't been set to a value. Seeing 'null' as a value limits yourself to the situation that the variable always has a value, but there can be situations that a variable doesn't have a value, e.g. when it's optional. | null | 0 | 1316072039 | False | 0 | c2k0mk6 | t3_kfvm7 | null | t1_c2k0mk6 | t1_c2jxl4n | null | 1427602645 | 0 | t5_2fwo | null | null | null |
True | grauenwolf | null | Yep. Here is some info on exporting WinRT components from .NET.
http://www.infoq.com/news/2011/09/DotNet-On-WinRT | null | 0 | 1316072106 | False | 0 | c2k0mpe | t3_kewaq | null | t1_c2k0mpe | t1_c2js58w | null | 1427602647 | 1 | t5_2fwo | null | null | null |
True | Hyperian | null | alright let me try to explain, probably wrong.
So this thing sits between your ex. PS3 and your HDTV. NeTV keeps track of the stream and when it sees the part of the screen that needs the overlay, it sends encrypted bits instead, and when that gets to the HDTV, the HDTV decrypts it and the overlay shows up.
pretty ne... | null | 0 | 1316072121 | False | 0 | c2k0mqs | t3_kfby2 | null | t1_c2k0mqs | t1_c2jx73v | null | 1427602647 | 1 | t5_2fwo | null | null | null |
True | MatrixFrog | null | Terseness should probably be one goal, but only to the extent that it encourages readability. Look up APL for a language that is unquestionably terse, but (IMHO) entirely unreadable. Then again, maybe I need to spend more time with it. But in any case, there is definitely such a thing as being *too* terse. | null | 0 | 1316072125 | False | 0 | c2k0mr7 | t3_kfvm7 | null | t1_c2k0mr7 | t1_c2k0kqq | null | 1427602647 | 1 | t5_2fwo | null | null | null |
True | grauenwolf | null | That is not true. The entire UI stack in WinRT is 100% native code, .NET isn't involved at all. | null | 0 | 1316072177 | False | 0 | c2k0mvp | t3_kewaq | null | t1_c2k0mvp | t1_c2jt0sf | null | 1427602658 | 4 | t5_2fwo | null | null | null |
True | [deleted] | null | Yes, complicating the type system is probably not the best way to solve this.
In this case, you may use a type that can indicate "not initialized yet", such as that `Option` type:
struct node { Option<node*> next; node() : next(None) {} node(node* n) : next(Some(n)) {} };
node* a = new node();
node*... | null | 0 | 1316072387 | False | 0 | c2k0ndq | t3_kfvm7 | null | t1_c2k0ndq | t1_c2jz3ti | null | 1427602665 | 5 | t5_2fwo | null | null | null |
True | syncsynchalt | null | I knew he grepped the usenet feed for his nick, maybe he greps reddit too. | null | 0 | 1316072438 | False | 0 | c2k0nht | t3_kfms2 | null | t1_c2k0nht | t1_c2jwros | null | 1428194047 | 1 | t5_2fwo | null | null | null |
True | FractalP | null | Wow, they *really* forced that one. | null | 0 | 1316072455 | False | 0 | c2k0niw | t3_kgaop | null | t1_c2k0niw | t1_c2k0l1v | null | 1427602657 | 29 | t5_2fwo | null | null | null |
True | thepowerofone | null | Even so, you don't want to teach noobs bad habits, which Microsoft is guilty of many times over. | null | 0 | 1316072498 | False | 0 | c2k0nlr | t3_kewaq | null | t1_c2k0nlr | t1_c2jttup | null | 1427602660 | 1 | t5_2fwo | null | null | null |
True | grauenwolf | null | Standard F# looks something like this:
let Exists(opt : string option) =
match opt with
| Some _ -> true
| None -> false
But nothing prevents you from writing this:
let x = None
let y = x.Value //NPE here | null | 0 | 1316072549 | False | 0 | c2k0np7 | t3_kfvm7 | null | t1_c2k0np7 | t1_c2k0m59 | null | 1427602661 | 1 | t5_2fwo | null | null | null |
True | [deleted] | null | It's not always possible to make a sentinel value; the constructor of the type in question may not be visible to you, or it may have undesirable side effects. Also, what grauenwolf said. | null | 0 | 1316072557 | False | 0 | c2k0npx | t3_kfvm7 | null | t1_c2k0npx | t1_c2jzvds | null | 1427602661 | 4 | t5_2fwo | null | null | null |
True | [deleted] | null | null is a value, and the meaning you ascribe to it outside of the language semantics is a matter of taste. | null | 0 | 1316072743 | True | 0 | c2k0o3f | t3_kfvm7 | null | t1_c2k0o3f | t1_c2k0mk6 | null | 1427602667 | 3 | t5_2fwo | null | null | null |
True | truthHIPS | null | Fair enough. Personally, after working on web apps and fighting with so many different rendering engines, versions, differences on each of those per platform and so on I no longer find the idea elegant.
Personally, my strategy is to make a minimal web app interface that has a badge somewhere to a proper native app th... | null | 0 | 1316072808 | False | 0 | c2k0o8r | t3_kc9ai | null | t1_c2k0o8r | t1_c2jsis8 | null | 1428194046 | 2 | t5_2fwo | null | null | null |
True | MatrixFrog | null | Nothing prevents you from doing that in Haskell either, but you can *only make that mistake when you're dealing with Maybes* which is the point I was trying to emphasize. It's impossible to do something like that with raw, un-maybed values. And you can only make that mistake if you call an unsafe function like `fromJus... | null | 0 | 1316072898 | False | 0 | c2k0og4 | t3_kfvm7 | null | t1_c2k0og4 | t1_c2k0np7 | null | 1427602674 | 3 | t5_2fwo | null | null | null |
Subsets and Splits
Filtered Reddit Uplifting News
The query retrieves specific news articles by their link IDs, providing a basic overview of those particular entries without deeper analysis or insights.
Recent Programming Comments
Returns a limited set of programming records from 2020 to 2023, providing basic filtering with minimal analytical value.