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
kamatsu
null
> I'm not sure what having skills in "Multi-threading and long running applications" means exactly, so I'm assuming you're talking about servers and load balancing Er.. no, he's talking about multithreading and long running applications.
null
0
1318052648
False
0
c2pso5e
t3_l3tuj
null
t1_c2pso5e
t1_c2pr3nb
null
1427702511
1
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1318052836
False
0
c2psor6
t3_l4vo4
null
t1_c2psor6
t3_l4vo4
null
1427702523
1
t5_2fwo
null
null
null
True
Myrono
null
Why? Compiler optimization will never affect the output, except in the case of undefined behaviour. Strlen is a commonly used function, why would you not want it optimized as much as possible?
null
0
1318052998
False
0
c2pspas
t3_l4p6z
null
t1_c2pspas
t1_c2psmds
null
1427702529
2
t5_2fwo
null
null
null
True
i-hate-digg
null
Gcc is incredibly smart and it pains me when some people put it down so easily, just because of some little thing they don't like. Just because it's free software there must be something wrong with it, right? It especially hurts my brain when they compare it to MSVC. Even llvm is far behind. Llvm is elegantly coded, I...
null
0
1318053015
False
0
c2pspcn
t3_l4p6z
null
t1_c2pspcn
t3_l4p6z
null
1427702529
25
t5_2fwo
null
null
null
True
zzing
null
I am actually just getting back into c++ after being a hater for a rather long time. There is a lot to recommend it, and boost is simply amazing.
null
0
1318053030
False
0
c2pspen
t3_l4p6z
null
t1_c2pspen
t1_c2pskk9
null
1427702530
4
t5_2fwo
null
null
null
True
earthboundkid
null
Having two zeros is also dumb. :-) Anyway, I'm sure they have good reasons for their crazy choices (no doubt, it was something to do with the implementation making it easier to wire things up correctly in the CPU), but I still think those choices are crazy, and I don't think a higher level language should blindly follo...
null
0
1318053032
False
0
c2pspet
t3_l3mls
null
t1_c2pspet
t1_c2psnnd
null
1427702530
-2
t5_2fwo
null
null
null
True
i-hate-digg
null
Exactly. Llvm is divided into specific sections (code -> vm, vm -> assembly) for precisely that reason, despite the fact that such divisions cause it to produce somewhat poorer-performing code.
null
0
1318053292
False
0
c2psq8a
t3_l3tk5
null
t1_c2psq8a
t1_c2plnl5
null
1427702539
2
t5_2fwo
null
null
null
True
bms20
null
Rant: The easiest way to reduce memory in windows 8 would be to just upgrade it to linux.
null
0
1318053524
False
0
c2psqyb
t3_l48nw
null
t1_c2psqyb
t3_l48nw
null
1427702548
-29
t5_2fwo
null
null
null
True
nixcamic
null
Objective-C seems to be the language you're looking for....
null
0
1318053547
False
0
c2psr0d
t3_l4p6z
null
t1_c2psr0d
t1_c2ps92n
null
1427702549
0
t5_2fwo
null
null
null
True
kamatsu
null
>There is no runtime type system in C++, and no way to rebuild templated code for a new type at run time even if there was. If you just want parametric polymorphism (the reason templates exist, after all), you can easily do that without runtime types. Haskell does this, for example.
null
0
1318053921
False
0
c2pss6x
t3_l4p6z
null
t1_c2pss6x
t1_c2psj7f
null
1427702563
3
t5_2fwo
null
null
null
True
ZorbaTHut
null
So, wait . . . you prefer writing Java because you believe you understand exactly what the computer is doing?
null
0
1318054026
False
0
c2pssic
t3_l4p6z
null
t1_c2pssic
t1_c2psftr
null
1427702567
35
t5_2fwo
null
null
null
True
[deleted]
null
I would LOVE to have the time to do so :)
null
0
1318054119
False
0
c2psssp
t3_l466j
null
t1_c2psssp
t1_c2psahk
null
1427702572
2
t5_2fwo
null
null
null
True
sketerpot
null
On a Nehalem CPU, using an add instruction has a latency of 1 cycle and a peak throughput of 3 per cycle. The shift instruction (with a register and an immediate operand) has the same one-cycle latency, but only a 2-per-cycle peak throughput. [Reference (PDF)](http://www.agner.org/optimize/instruction_tables.pdf)
null
0
1318054280
False
0
c2pstae
t3_l4p6z
null
t1_c2pstae
t1_c2pskwk
null
1427702581
40
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1318054476
False
0
c2pstuw
t3_l4p6z
null
t1_c2pstuw
t3_l4p6z
null
1427702593
1
t5_2fwo
null
null
null
True
slurpme
null
You should never know how your code is compiled... unless you are writing a compiler... Programmers thinking they are smarter than the compiler leads to problems...
null
0
1318054546
False
0
c2psu1j
t3_l4p6z
null
t1_c2psu1j
t1_c2psftr
null
1427702588
13
t5_2fwo
null
null
null
True
Pfhreak
null
I got this one 'wrong' because I felt bitshift was the correct optimization for multiplying by two. So I said, 'This optimization is not correct.' The response was very smug.
null
0
1318054694
False
0
c2psugz
t3_l4p6z
null
t1_c2psugz
t1_c2psc6v
null
1427702595
6
t5_2fwo
null
null
null
True
2gooder
null
Sorry about the down vote, but this is not programming related at all. It would be better to post it in /r/tech or similar.
null
0
1318054870
False
0
c2psuyh
t3_l4vo4
null
t1_c2psuyh
t3_l4vo4
null
1427702600
1
t5_2fwo
null
null
null
True
mabufo
null
The design of this site is a bit off putting.
null
0
1318055076
False
0
c2psvj6
t3_l4p6z
null
t1_c2psvj6
t3_l4p6z
null
1427702607
-1
t5_2fwo
null
null
null
True
malkarouri
null
I have always wanted to escape my data. It tends to complicate my software a lot..
null
0
1318055160
False
0
c2psvsb
t3_l4dpk
null
t1_c2psvsb
t3_l4dpk
null
1427702612
7
t5_2fwo
null
null
null
True
MatrixFrog
null
I would really like to see a Java version of this post. I guess the options will be: * `javac` will optimize this at compile time. * The JVM will optimize this at runtime. * The JVM *may* optimize this at runtime if this code is JIT compiled. * This optimization will not happen. * This optimization is invalid. A...
null
0
1318055188
False
0
c2psvuz
t3_l4p6z
null
t1_c2psvuz
t1_c2prxs6
null
1427702612
15
t5_2fwo
null
null
null
True
Gh0stRAT
null
>Why not write to /dev/null? It's fast as hell. Laughed my ass off, thanks for the link!
null
0
1318055229
False
0
c2psvyq
t3_l4b56
null
t1_c2psvyq
t1_c2pocmf
null
1427702613
1
t5_2fwo
null
null
null
True
elder_george
null
I feel your pain. Recently I participated in interviewing about 15 candidates (that's what passed initial phone screening). For these positions, we don't require them to know .NET by heart. Just to know some basic knowledge of CS, understanding of OOP and ability to code. Is it hard? Yes, it is, apparently! Some guys...
null
0
1318055381
False
0
c2pswds
t3_l4bk8
null
t1_c2pswds
t1_c2pnu8q
null
1427702618
1
t5_2fwo
null
null
null
True
uriel
null
> On the other hand, topics like collation are only "esoteric and academic" if you don't try to localize your software. To international users, it's your software that becomes "not very useful" when it can't even sort or capitalize a string correctly. As a non-native English speaker living in another non-English s...
null
0
1318055478
False
0
c2pswmr
t3_l2z8p
null
t1_c2pswmr
t1_c2pn6jw
null
1427702622
1
t5_2fwo
null
null
null
True
repka
null
You've never used C++ fully. Perhaps you've tried it in college and hated doing the assignments. Or you were forced to get in touch with it at a job and by brief contact was appalled by how cryptic everything looked. Or even had to work with it for few years under some heavy language scope limiting restrictions, e.g. o...
null
0
1318055489
True
0
c2pswnt
t3_l4p6z
null
t1_c2pswnt
t1_c2ps92n
null
1427702622
8
t5_2fwo
null
null
null
True
[deleted]
null
I like to write my code is such a way that I still understand it next week and expect the compiler to figure out how to make it go fast.
null
0
1318055504
False
0
c2pswp3
t3_l4p6z
null
t1_c2pswp3
t1_c2psftr
null
1427702622
7
t5_2fwo
null
null
null
True
tryx
null
Why ever not? You're going from O(n) to O(1) space.
null
0
1318055919
False
0
c2psxsw
t3_l4p6z
null
t1_c2psxsw
t1_c2psa54
null
1427702636
32
t5_2fwo
null
null
null
True
[deleted]
null
Actually this article is slightly incorrect. The builtin function strlen has __attribute__((pure)) declared in the header. This attribute means it always returns the same value when called on the same input, so optimizations like this are correct. See http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
null
0
1318055961
False
0
c2psxwh
t3_l4p6z
null
t1_c2psxwh
t1_c2psmds
null
1427702637
13
t5_2fwo
null
null
null
True
evmar
null
In Emacs, C-cC-cp opens the current Markdown document in a browser (after converting to HTML, of course). These more complex systems seem... well, more complex.
null
0
1318055998
False
0
c2psxzv
t3_l47co
null
t1_c2psxzv
t3_l47co
null
1427702638
2
t5_2fwo
null
null
null
True
tryx
null
Because of the neater more modern codebase I would be very surprised if llvm didn't take the lead over the next few years.
null
0
1318056045
False
0
c2psy4j
t3_l4p6z
null
t1_c2psy4j
t1_c2pspcn
null
1427702640
32
t5_2fwo
null
null
null
True
[deleted]
null
I've never written or compiled C code in my life and I got all but one of these correct. Bizarre.
null
0
1318056238
False
0
c2psymk
t3_l4p6z
null
t1_c2psymk
t3_l4p6z
null
1427702647
3
t5_2fwo
null
null
null
True
zingbot3000
null
It's not the language they hate, it's its fans.
null
0
1318056291
False
0
c2psyrr
t3_l466j
null
t1_c2psyrr
t1_c2ps5uv
null
1427702649
3
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1318056325
False
0
c2psyv7
t3_l4p6z
null
t1_c2psyv7
t1_c2pspen
null
1427702651
1
t5_2fwo
null
null
null
True
tryx
null
My attitude to c++ is similar to my attitude to JavaScript. It is an immensely flawed language but because of its flexibility, some truly amazing things have been done with it. Very few things are actually impossible when you have a Turing complete type system.
null
0
1318056327
False
0
c2psyvd
t3_l4p6z
null
t1_c2psyvd
t1_c2pspen
null
1427702651
5
t5_2fwo
null
null
null
True
repka
null
Ah, thanks a lot for your correction and the link. I guess '-fno-builtin' is a confusing name for a compiler parameter.
null
0
1318056509
False
0
c2pszcu
t3_l4p6z
null
t1_c2pszcu
t1_c2psxwh
null
1427702658
3
t5_2fwo
null
null
null
True
tryx
null
I was under the impression that Haskell came with quite a large runtime?
null
0
1318056637
False
0
c2pszot
t3_l4p6z
null
t1_c2pszot
t1_c2pss6x
null
1427702661
2
t5_2fwo
null
null
null
True
angch
null
Sounds like someone who have not used the [Closure compiler](http://code.google.com/closure/compiler/), which does these, and more. Edit: It is comparable with Closure, esp. after gzip: https://github.com/mishoo/UglifyJS
null
0
1318056734
True
0
c2pszwv
t3_l3dsw
null
t1_c2pszwv
t3_l3dsw
null
1427702664
2
t5_2fwo
null
null
null
True
Kyeana
null
You can always not use optimization in gcc
null
0
1318057019
False
0
c2pt0nx
t3_l4p6z
null
t1_c2pt0nx
t1_c2psftr
null
1427702675
3
t5_2fwo
null
null
null
True
[deleted]
null
-fno-builtin does, as a side effect, disable this optimization if the non-builtin doesn't have the pure attribute.
null
0
1318057193
False
0
c2pt140
t3_l4p6z
null
t1_c2pt140
t1_c2pszcu
null
1427702685
3
t5_2fwo
null
null
null
True
kamatsu
null
Yes, but that runtime is for the purposes of green threads and garbage collection. The types are all erased at compile time.
null
0
1318057239
False
0
c2pt181
t3_l4p6z
null
t1_c2pt181
t1_c2pszot
null
1427702682
4
t5_2fwo
null
null
null
True
repka
null
My explanation was that it'd lead to bad user behavior: yeah, your compiler will compiler optimize this particular case, but run it on another compiler and all of the sudden your O(n) is O(n^2 ). I also didn't like the fact of *strlen* somehow being 'build-in' (why would my own functions could not be optimized in suc...
null
0
1318057261
False
0
c2pt19w
t3_l4p6z
null
t1_c2pt19w
t1_c2pspas
null
1427702683
1
t5_2fwo
null
null
null
True
bdunderscore
null
The x86 instruction set has a special two-byte encoding for one-bit shifts: 3: d1 e0 shl %eax 5: 01 c0 add %eax,%eax 7: c1 e0 02 shl $0x2,%eax
null
0
1318057326
False
0
c2pt1g2
t3_l4p6z
null
t1_c2pt1g2
t1_c2pskwk
null
1427702686
17
t5_2fwo
null
null
null
True
[deleted]
null
Anecdote: I once worked on a text-based game that had a custom extension language with its own garbage collector. One day I got curious and started reading the source, and I ran across the fact that the language's serialization functions called the garbage collector. I dug a little deeper and noticed that the collecto...
null
0
1318057407
False
0
c2pt1mt
t3_l4p6z
null
t1_c2pt1mt
t1_c2psxsw
null
1427702688
17
t5_2fwo
null
null
null
True
Genmutant
null
I'd like to see that too. I've a rough idea what the gcc will optimize, but I have no clue what HotSpot optimizes.
null
0
1318057712
False
0
c2pt2dv
t3_l4p6z
null
t1_c2pt2dv
t1_c2psvuz
null
1427702697
3
t5_2fwo
null
null
null
True
[deleted]
null
How come it doesn't transform X*2 to left-shift by 1 bit on all processors? I would think that's the easiest operation in an ALU.
null
0
1318057744
False
0
c2pt2gh
t3_l4p6z
null
t1_c2pt2gh
t3_l4p6z
null
1427702698
1
t5_2fwo
null
null
null
True
repka
null
From what I figured by "built-in" they (in the doc you've linked) mean standard library functions. Since a lot of them have such non-standard attributes, the compiler parameter was named that way.
null
0
1318057845
False
0
c2pt2ot
t3_l4p6z
null
t1_c2pt2ot
t1_c2pt140
null
1427702701
1
t5_2fwo
null
null
null
True
[deleted]
null
I was wondering the same thing. Your explanation makes sense.
null
0
1318058056
False
0
c2pt37h
t3_l4p6z
null
t1_c2pt37h
t1_c2pskwk
null
1427702707
-1
t5_2fwo
null
null
null
True
ruinercollector
null
TL;DR: I don't really understand how to use .NET, in particular interop, and have had several problems with it. Therefore I'm going to generalize and say that no one else does either. Here's my solution to the imaginary problem: you should use C++.
null
0
1318058134
False
0
c2pt3el
t3_l4xfg
null
t1_c2pt3el
t3_l4xfg
null
1427702709
11
t5_2fwo
null
null
null
True
xcbsmith
null
You'd be surprised. Particularly with arithmetic, Java does a ton of optimizations.
null
0
1318058441
False
0
c2pt44z
t3_l4p6z
null
t1_c2pt44z
t1_c2psftr
null
1427702719
6
t5_2fwo
null
null
null
True
ruinercollector
null
Most VB programmers still write VB.NET in a very imperative manner, and consider even LINQ to be a step outside of the norm. I can't entirely blame them with VB's ugly and until recently terribly limited lambda syntax.
null
0
1318058497
False
0
c2pt49p
t3_l1tjd
null
t1_c2pt49p
t1_c2pdgxx
null
1427702721
1
t5_2fwo
null
null
null
True
elperroborrachotoo
null
It's the end what counts, and whether you make it alive :)
null
0
1318058527
False
0
c2pt4c7
t3_l4p6z
null
t1_c2pt4c7
t1_c2prvlh
null
1427702721
6
t5_2fwo
null
null
null
True
drb226
null
Were you actually planning on writing a trading system that can handle high speed trades? Odds are if you are, then someone is paying you a lot of money and telling you to write it in a language that isn't Scala. You see, I know you aren't one of the big wigs that is employing people to write high speed trading system...
null
0
1318058834
False
0
c2pt519
t3_l466j
null
t1_c2pt519
t1_c2pmxze
null
1427702730
0
t5_2fwo
null
null
null
True
berkut
null
Yep, and the same goes for things like collections/iterators in C++. If you've got a for loop iterating over an std::vector<> with a comparison of items.end() each iteration, pretty much all compilers (when optimisation is turned on anyway) will hoist a cached version of items.end() out of the loop before it star...
null
0
1318058901
False
0
c2pt56c
t3_l4p6z
null
t1_c2pt56c
t1_c2ps9es
null
1427702733
3
t5_2fwo
null
null
null
True
Astrobastard
null
Something I've always been curious about is whether the compiler optimizes: x = y / 2.0f; into a multiplication of the reciprocal, like so: x = y * 0.5f where both x and y are floats. As I've understood it multiplication is faster than division, so would I be correct in assuming this optimization, or is t...
null
0
1318059212
False
0
c2pt5w1
t3_l4p6z
null
t1_c2pt5w1
t3_l4p6z
null
1427702744
6
t5_2fwo
null
null
null
True
kixx
null
No, HATEOAS is not equivalent to REST. It may seem that way because it's usually the last constraint an API must implement to become RESTful (I suspect it's usually the last because it's the hardest to conceptualize, URI opacity being a counterintuitive concept). You could theoretically build an API fulfilling the HAT...
null
0
1318059214
False
0
c2pt5w4
t3_l4l3n
null
t1_c2pt5w4
t1_c2prqzc
null
1427702744
3
t5_2fwo
null
null
null
True
Nolari
null
Wait, [Predator](http://wiki.teamliquid.net/starcraft2/Predator) and [Reaper](http://wiki.teamliquid.net/starcraft2/Reaper) [drone](http://wiki.teamliquid.net/starcraft2/Drone) fleet? I'm confused.
null
0
1318059248
False
0
c2pt5yw
t3_l4css
null
t1_c2pt5yw
t3_l4css
null
1427702744
1
t5_2fwo
null
null
null
True
mr_mumbles
null
One might say the website is not optimized for opera
null
0
1318059382
False
0
c2pt6a2
t3_l4p6z
null
t1_c2pt6a2
t1_c2psmk5
null
1427702748
44
t5_2fwo
null
null
null
True
[deleted]
null
I learned C/C++ (and Pascal!) back in the early 90s were all the rage, so I grew up with this idea that I could always outfox the compiler with a bit of assembly... ...then, after many years working in Perl and Java, I wrote an image-processing library in C. I figured I'd write it all in C at first to verify operatio...
null
0
1318059659
False
0
c2pt6v6
t3_l4p6z
null
t1_c2pt6v6
t3_l4p6z
null
1427702765
150
t5_2fwo
null
null
null
True
BrowsOfSteel
null
It’s a shame, too, because I loathe C++’s switch syntax.
null
0
1318059718
False
0
c2pt6zp
t3_l4p6z
null
t1_c2pt6zp
t1_c2psjfh
null
1427702758
4
t5_2fwo
null
null
null
True
BrowsOfSteel
null
See [this](http://www.reddit.com/r/programming/comments/l4p6z/will_it_optimize/c2pstae?context=2) comment chain. tl;dr: Nope. Shifting isn’t quite as fast.
null
0
1318059871
False
0
c2pt7a5
t3_l4p6z
null
t1_c2pt7a5
t1_c2psc6v
null
1427702762
5
t5_2fwo
null
null
null
True
spotter
null
Yes, why would you want to trace the execution with debugger and be able to view anything at given point, when you can just print some stuff and guess the rest. Printing works for ultra-small pieces of code, hey I do it too in code not longer than one screen, but it stops scaling fast.
null
0
1318059905
False
0
c2pt7cz
t3_l2vfc
null
t1_c2pt7cz
t1_c2pq43i
null
1427702762
4
t5_2fwo
null
null
null
True
BrowsOfSteel
null
See [this](http://www.reddit.com/r/programming/comments/l4p6z/will_it_optimize/c2pstae?context=2) comment chain. tl;dr: Nope. Shifting would be slower on x86.
null
0
1318059950
False
0
c2pt7g4
t3_l4p6z
null
t1_c2pt7g4
t1_c2pt2gh
null
1427702764
6
t5_2fwo
null
null
null
True
NorthboundFox
null
Run on single thread at ~2.10GHz (could be 1.9 - 2.10 due to performance flux with heat - laptop processor) I'm not sure if that would affect the outcome much or not, but just in case.
null
0
1318059990
False
0
c2pt7is
t3_l4ylc
null
t1_c2pt7is
t3_l4ylc
null
1427702765
1
t5_2fwo
null
null
null
True
bbibber
null
Yes but not in the hot sections (I may hope)
null
0
1318060034
False
0
c2pt7lx
t3_l3tk5
null
t1_c2pt7lx
t1_c2plkl4
null
1427702765
3
t5_2fwo
null
null
null
True
WalterGR
null
But this is /r/programming, and since it doesn't have anything positive or neutral to say about .NET, we upvote.
null
0
1318060049
False
0
c2pt7mq
t3_l4xfg
null
t1_c2pt7mq
t1_c2pt3el
null
1427702765
-1
t5_2fwo
null
null
null
True
cC2Panda
null
Either I understand this better while drunk, or I got lucky.
null
0
1318060063
False
0
c2pt7nu
t3_l4p6z
null
t1_c2pt7nu
t3_l4p6z
null
1427702767
1
t5_2fwo
null
null
null
True
devynci
null
[Real World Haskell](http://book.realworldhaskell.org/read/) is good for Haskell. [Learn You a Haskell](http://learnyouahaskell.com/chapters) is great for the basics. I strongly recommend reading both. Learning Haskell is extremely rewarding and useful.
null
0
1318060431
False
0
c2pt8ge
t3_l466j
null
t1_c2pt8ge
t1_c2pmxze
null
1427702777
1
t5_2fwo
null
null
null
True
Deinumite
null
Heh, fourth would be C/C++
null
0
1318060534
False
0
c2pt8ok
t3_l38op
null
t1_c2pt8ok
t1_c2pp2v2
null
1427702779
1
t5_2fwo
null
null
null
True
adrianmonk
null
It's a compiler/runtime space reduction, not a user data structure optimization. But less space is used, so I think it counts.
null
0
1318060754
False
0
c2pt94t
t3_l4p6z
null
t1_c2pt94t
t1_c2psa54
null
1427702785
3
t5_2fwo
null
null
null
True
f2u
null
Floating point multiplication is faster than floating point addition in some cases, and GCC seems to prefer addition even in those cases, so the value of this optimization appears to be questionable.
null
0
1318060983
True
0
c2pt9lp
t3_l4p6z
null
t1_c2pt9lp
t3_l4p6z
null
1427702791
0
t5_2fwo
null
null
null
True
unpopular_opinion
null
Usually people try to make a point, but you forgot that part.
null
0
1318061304
False
0
c2pta9f
t3_l4bk8
null
t1_c2pta9f
t1_c2prci1
null
1427702799
2
t5_2fwo
null
null
null
True
panic
null
In fact it does for `/ 2.0f`: $ gcc --version i686-apple-darwin10-gcc-4.2.1 $ gcc -O3 -x c -S -o - - float f(float y) { return y / 2.0f; } ^D .text .align 4,0x90 .globl _f _f: pushl %ebp movl %esp, %ebp subl $4, %esp call L3 "L0000...
null
0
1318061489
False
0
c2ptam9
t3_l4p6z
null
t1_c2ptam9
t1_c2pt5w1
null
1427702804
20
t5_2fwo
null
null
null
True
qpingu
null
Floating point multiplication is significantly faster than division, so I'd imagine that optimization is done for 2. However, odd and larger even divisors would't be optimized the same way because of floating point error. x / 2.0f == x * 0.5f x / 3.0f != x * 0.3333333..f
null
0
1318061674
False
0
c2ptaz4
t3_l4p6z
null
t1_c2ptaz4
t1_c2pt5w1
null
1427702809
3
t5_2fwo
null
null
null
True
sparklingrainbows
null
Which is good, because gcc deserves some decent competition in foss world.
null
0
1318061720
False
0
c2ptb1v
t3_l4p6z
null
t1_c2ptb1v
t1_c2psy4j
null
1427702810
18
t5_2fwo
null
null
null
True
alofons
null
GCC does it: [alofons@localhost ~]$ echo "volatile float test1(float x) { return x/2.0f; } volatile float test2(float x) { return x*0.5f; } int main(void) { return 0; }" > test.c [alofons@localhost ~]$ gcc -S test.c -O10 [alofons@localhost ~]$ cat test.s [...] test1: .LFB0: ...
null
0
1318061730
True
0
c2ptb2j
t3_l4p6z
null
t1_c2ptb2j
t1_c2pt5w1
null
1427702810
3
t5_2fwo
null
null
null
True
[deleted]
null
>You've never used C++ fully. The best thing about C++ is that you don't have to use all of it.
null
0
1318061856
False
0
c2ptbaz
t3_l4p6z
null
t1_c2ptbaz
t1_c2pswnt
null
1427702815
2
t5_2fwo
null
null
null
True
alexeyr
null
It's wrong as well: http://www.infoworld.com/d/application-development/oracles-ambitious-plan-client-side-java-175241
null
0
1318061901
False
0
c2ptbea
t3_l4esf
null
t1_c2ptbea
t1_c2ppx8l
null
1427702815
3
t5_2fwo
null
null
null
True
tinou
null
For integer division, it does. ~~See C99, 6.5.5, §6.~~ edit: this is for c99. See wnoise's comment.
null
0
1318061976
True
0
c2ptbjn
t3_l4p6z
null
t1_c2ptbjn
t1_c2ps01j
null
1427702817
13
t5_2fwo
null
null
null
True
Expresionista
null
python's assignment does return a value: >>> b = a = 1 >>> a 1 >>> b 1
null
0
1318062137
False
0
c2ptbtv
t3_l3mls
null
t1_c2ptbtv
t3_l3mls
null
1427702821
1
t5_2fwo
null
null
null
True
derleth
null
You're the one who said "hypercorrect language is a geek thing" when someone got called on lying outright.
null
0
1318062154
False
0
c2ptbv4
t3_l4b56
null
t1_c2ptbv4
t1_c2pr6jw
null
1427702821
2
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1318062354
False
0
c2ptc94
t3_l4yxy
null
t1_c2ptc94
t3_l4yxy
null
1427702832
1
t5_2fwo
null
null
null
True
Fabien4
null
> I personally believe the "best" compromise for medium-sized projects is to use C#/.NET to create the GUI and small helper scripts/utilities, but to build the core in C++ with an exposed C API or commandline interface. That's what was said about Visual Basic...
null
0
1318063008
False
0
c2ptde1
t3_l4xfg
null
t1_c2ptde1
t3_l4xfg
null
1427702841
1
t5_2fwo
null
null
null
True
bodski
null
600 votes might be something to do with the reputation of Zed's previous, well received book, LPTHW.
null
0
1318063264
False
0
c2ptdtc
t3_l2vfc
null
t1_c2ptdtc
t1_c2pq9jw
null
1427702845
2
t5_2fwo
null
null
null
True
thecrikster
null
erghh why did I look at this before I had my coffee?
null
0
1318063354
False
0
c2ptdz5
t3_l4p6z
null
t1_c2ptdz5
t3_l4p6z
null
1427702847
0
t5_2fwo
null
null
null
True
OffColorCommentary
null
Assuming it triggers on a give chunk of code, it does almost exactly the same things that gcc would do. The biggest difference is that there are more cases in Java where correctness-preserving prevents a potential optimization, particularly when dealing with floating point math. The "optimize if same amount or better...
null
0
1318063383
False
0
c2pte1d
t3_l4p6z
null
t1_c2pte1d
t1_c2pt2dv
null
1427702849
1
t5_2fwo
null
null
null
True
morricone42
null
>Also, C++ isn't the lowest level either. There's lower levels. Hell even straight C, which is a much better choice for performance-constrained programs than C++. You do realize that C is almost a subset of C++?
null
0
1318063390
False
0
c2pte1p
t3_l4p6z
null
t1_c2pte1p
t1_c2psmv9
null
1427702849
3
t5_2fwo
null
null
null
True
tinutinu
null
Incidentally, the same error is present in the GC of Sun's JVM (or was until recently), and is triggered by public class Crash { public static void main(String[] args) { Object[] o = null; while (true) { o = new Object[] {o}; } } }
null
0
1318063402
False
0
c2pte2k
t3_l4p6z
null
t1_c2pte2k
t1_c2pt1mt
null
1427702849
14
t5_2fwo
null
null
null
True
jyper
null
> Speed that rivals ~~C and C++~~ Java
null
0
1318063404
False
0
c2pte2n
t3_l466j
null
t1_c2pte2n
t1_c2pmjmt
null
1427702849
1
t5_2fwo
null
null
null
True
[deleted]
null
[deleted]
null
0
1318063417
False
0
c2pte3b
t3_l4xfg
null
t1_c2pte3b
t3_l4xfg
null
1427702849
1
t5_2fwo
null
null
null
True
morricone42
null
> In C++ this is supposed to have been fixed with std::string... except that we still have char* still hanging around so we can call into old C code. Why would you take char pointers away from the language just because there's std::string now?
null
0
1318063480
False
0
c2pte7g
t3_l4p6z
null
t1_c2pte7g
t1_c2ps92n
null
1427702851
6
t5_2fwo
null
null
null
True
masklinn
null
> If that's your position, then HATEOAS is equivalent to REST. No, HATEOAS is an essential subset of REST.
null
0
1318063754
False
0
c2pteof
t3_l4l3n
null
t1_c2pteof
t1_c2prqzc
null
1427702857
2
t5_2fwo
null
null
null
True
masklinn
null
> Wow , so the situation went from bad to worse. Not really. The end result of #1 is that the process is stuck and Windows will have to display a screen saying "process X is stuck, do you want to kill it with great prejudice or wait a bit longer to see if it comes unstuck". The end result of #2 is that the proces...
null
0
1318063887
False
0
c2ptexh
t3_l4d5e
null
t1_c2ptexh
t1_c2poht8
null
1427702861
4
t5_2fwo
null
null
null
True
masklinn
null
> Escaping is part of the process of displaying data "Displaying" is the wrong word here. I think "serializing" is more correct, as it has to happen anytime you get your data out of the system, not only to be displayed to the user (HTML) but to be sent to a third-party (API call or response), sent to a storage ser...
null
0
1318063997
False
0
c2ptf4e
t3_l4dpk
null
t1_c2ptf4e
t1_c2polgi
null
1427702863
3
t5_2fwo
null
null
null
True
Fabien4
null
With good lawyers, you can copyright whatever you damn please.
null
0
1318065011
False
0
c2ptgt8
t3_l3tx9
null
t1_c2ptgt8
t1_c2pm6i4
null
1427702886
3
t5_2fwo
null
null
null
True
sltkr
null
Nope, it's a common misconception that shifting is super fast. It *is* much faster than a multiplication but it is *not* faster than simple addition. To quote my Intel Optimization Reference Manual (from the Pentium 4 era): > The latency of a sequence of adds will be shorter for left shifts of three or less. That ...
null
0
1318065050
False
0
c2ptgvj
t3_l4p6z
null
t1_c2ptgvj
t1_c2ps6ft
null
1427702887
35
t5_2fwo
null
null
null
True
nikosk
null
I think it's a good idea to add .json|xml to denote response type and I'm very much inclined to incorporate it in my next project. Any tips on why I shouldn't ?
null
0
1318065113
False
0
c2ptgzj
t3_l4l3n
null
t1_c2ptgzj
t1_c2ps3b2
null
1427702890
1
t5_2fwo
null
null
null
True
[deleted]
null
Then again, "Java done right" is akin to "genocide done right".
null
0
1318065316
False
0
c2pthan
t3_l38op
null
t1_c2pthan
t1_c2pf5lj
null
1427702892
1
t5_2fwo
null
null
null
True
[deleted]
null
Neat. Thanks!
null
0
1318065429
False
0
c2pthh4
t3_l4p6z
null
t1_c2pthh4
t1_c2psctg
null
1427702896
2
t5_2fwo
null
null
null
True
icebraining
null
See masklinn's reply. As an analogy, it's like someone producing CH₂ and calling it 66% water, since it has two hydrogen atoms. No, that's methylene, because oxygen is *essential* to water, despite not being water by itself.
null
0
1318065587
False
0
c2pthpk
t3_l4l3n
null
t1_c2pthpk
t1_c2prqzc
null
1427702898
2
t5_2fwo
null
null
null
True
[deleted]
null
* Bug ID: [4152790](http://bugs.sun.com/view_bug.do?bug_id=4152790) * Synopsis: StackOverFlowError serializing/deserializing a large graph of objects. * Reported Against: 1.0, 1.3, b10, 1.1.6, 1.4.2, 1.1.7a, 1.3.0_01 * State: 6-Fix Understood, request for enhancement * Submit Date: 26-JUN-1998 It's not closed, so the...
null
0
1318065761
False
0
c2pthyh
t3_l4p6z
null
t1_c2pthyh
t1_c2pte2k
null
1427702900
10
t5_2fwo
null
null
null
True
Junglebook3
null
Putting data you frequently use in faster memory.
null
0
1318066048
False
0
c2ptier
t3_l4cv3
null
t1_c2ptier
t1_c2pqd7q
null
1427702907
1
t5_2fwo
null
null
null