|
the comma operator has legit uses, like in "Practical UML Statecharts in C/C++" (pg 638) by Miro Samek, its used in a transition macro to perform an assignment and return a codecode:
|
# ? Apr 5, 2015 22:56 |
|
|
# ? May 28, 2024 16:34 |
|
Symbolic Butt posted:anyway serious question: what's the deal with the comma operator in C? it's an infix form of PROGN, obviously
|
# ? Apr 6, 2015 01:49 |
|
the comma operator is for when you want to save 5 seconds and remove a bunch of readability/maintainability, and/or ioccc
|
# ? Apr 6, 2015 01:54 |
|
Shinku ABOOKEN posted:why does OpenCV has its own String implementation??? part of doing a project in c++ is assuming you can do everything more efficiently than whatever libraries or frameworks you could have used, and then extending that assumption to the c++ stdlib too also it's possible OpenCV dates from an era before std::string was supported by all the compilers it would likely be used with, though Wikipedia says 1999-2000 and that's definitely beyond when I'd expect such bullshit. unless it had to work with VC++ 4 or GCC 2.7 or something equally terrible. I bet it had to work with VC++ 4 or GCC 2.7 or something.
|
# ? Apr 6, 2015 02:01 |
|
eschaton posted:part of doing a project in c++ is assuming you can do everything more efficiently than whatever libraries or frameworks you could have used, and then extending that assumption to the c++ stdlib too the specification for std::string allows optimizations which may or may not be implemented by the implementation of std::string you're using. (libstdc++ (the one that comes with gcc) does copy on write strings (until c++11 banned it), for example, which i don't think anyone else does). if you know your program is going to be using a bunch of short strings, it might be better to use a hand rolled implementation that has a guarantee of the short string optimization; if you know you have giant read only strings, cow is better
|
# ? Apr 6, 2015 02:08 |
|
rjmccall posted:terms and notations in algebra are universal and well-established as long as you carefully only read one textbook. good luck finding a wikipedia page about an algebraic structure that doesn't have a paragraph talking about how different authors use the term for slightly different things this is why I'm being precious about it, because it's one of the few conventions that are universally consistent in a world of inconsistent poo poo. dudes can't be bothered to check nlab or something
|
# ? Apr 6, 2015 02:55 |
|
rust is now in 1.0 beta and i still can't be arsed to care
|
# ? Apr 6, 2015 02:56 |
|
triple sulk posted:rust is now in 1.0 beta and i still can't be arsed to care rust's target audience is programmers who want to write safe code
|
# ? Apr 6, 2015 03:39 |
|
triple sulk posted:rust is now in 1.0 beta and i still can't be arsed to care i downloaded it and im trying it out
|
# ? Apr 6, 2015 03:47 |
|
Shinku ABOOKEN posted:why does OpenCV has its own String implementation??? yes, to the point that std::string_view was introduced specifically because nobody wants std::string semantics and everybody implements their own string type
|
# ? Apr 6, 2015 04:29 |
|
tef posted:rust's target audience is programmers who want to write safe code shots fired
|
# ? Apr 6, 2015 04:55 |
|
the safest code is the code that never gets written
|
# ? Apr 6, 2015 05:55 |
|
rust seems pretty fun so far. i've never learned c or c++ or anything with manual memory management beyond making a few leds blink on an arduino
|
# ? Apr 6, 2015 06:50 |
|
i like the immutability by default thing
|
# ? Apr 6, 2015 11:23 |
|
Stringent posted:the safest code is the code that never gets written I'm not slacking, i'm just really really security conscious
|
# ? Apr 6, 2015 12:46 |
|
Symbolic Butt posted:this is why I'm being precious about it, because it's one of the few conventions that are universally consistent in a world of inconsistent poo poo. dudes can't be bothered to check nlab or something some languages do "." for string concat and i guess that sort of looks like a \cdot but then you'd have all sorts of people getting all fussy about how its too confusing because it looks like the member selection operator
|
# ? Apr 6, 2015 13:40 |
|
StringBuilder concat = new StringBuilder(); String foo = "dick"; String bar = "butt"; System.out.println(concat.Concatenate(foo, bar));
|
# ? Apr 6, 2015 13:43 |
|
Symbolic Butt posted:this is why I'm being precious about it, because it's one of the few conventions that are universally consistent in a world of inconsistent poo poo. dudes can't be bothered to check nlab or something "why are programming language designers ignoring this convention that has developed in a non-programming-related field?" next up itt, linguists complain about the abuse of the word "object" for the subject of a sentence, and then i think we have hp hovercraft scheduled for another slot later this week on the subject of "software engineering"
|
# ? Apr 6, 2015 14:05 |
|
Forums Terrorist posted:StringBuilder concat = new StringBuilder(); much better
|
# ? Apr 6, 2015 14:07 |
|
fritz posted:some languages do "." for string concat and i guess that sort of looks like a \cdot but then you'd have all sorts of people getting all fussy about how its too confusing because it looks like the member selection operator strings have members so that wont work
|
# ? Apr 6, 2015 15:18 |
|
Soricidus posted:"why are programming language designers ignoring this convention that has developed in a non-programming-related field?" linguists have the right to express their feelings too even if they're actually sounding like asshats like I am because yospos birch
|
# ? Apr 6, 2015 15:55 |
|
*does a search in Eclipse* *minimizes and restores the window, turning the whole thing gray while it hangs* *goes home early*
|
# ? Apr 6, 2015 17:16 |
|
eclipse seems really great if you have a 32gb of ram and an ssd.
|
# ? Apr 6, 2015 17:46 |
|
FamDav posted:eclipse seems really great if you have a 32gb of ram and an ssd. ttgacs
|
# ? Apr 6, 2015 17:52 |
|
FamDav posted:eclipse seems really great if you have a 32gb of ram and an ssd. nope
|
# ? Apr 6, 2015 17:54 |
|
eclipse is good
|
# ? Apr 6, 2015 18:00 |
|
eclipse is fine but definitely needs some janitoring.
|
# ? Apr 6, 2015 18:04 |
|
Soricidus posted:ttgacs tttaam
|
# ? Apr 6, 2015 18:04 |
|
Valeyard posted:intellij is good
|
# ? Apr 6, 2015 18:08 |
|
intellij is trash
|
# ? Apr 6, 2015 18:09 |
|
java's greatest weakness is the lack of a usable ide.
|
# ? Apr 6, 2015 18:11 |
|
the problem with intellij is that everyone else will be using eclipse, and then you run into all these problems anda re like "haha guess nobody can help since everyone else is using eclipse and NOT intellij "
|
# ? Apr 6, 2015 18:15 |
|
Shaggar posted:intellij is trash Nah it's much better than eclipse, I tried it out Eclipse for a month and had way too many of those gray screen freezes. If you're build is IDE agnostic then I don't know what to tell you
|
# ? Apr 6, 2015 18:19 |
|
Just moved from Eclipse to IntelliJ. Much better performance all-around.
|
# ? Apr 6, 2015 18:52 |
|
intellij was slow and the layout was crap and the plugins sucked compared to eclipse.
|
# ? Apr 6, 2015 18:55 |
|
Not sure what I can say to that Shaggar. Its definitely more performant than eclipse and very needs-suiting.
|
# ? Apr 6, 2015 19:02 |
|
Forums Terrorist posted:StringBuilder concat = new StringBuilder(); someone put this man out of his misery also dont use a loving stringbuilder unless you're concatenating dozens or hundreds of strings the compiler is not stupid and it will generally turn "foo" + "bar" + "baz" into some strcpy call more efficient than instantiating a stringbuilder, etc.
|
# ? Apr 6, 2015 19:18 |
|
fleshweasel posted:also dont use a loving stringbuilder unless you're concatenating dozens or hundreds of strings AT RUN TIME
|
# ? Apr 6, 2015 19:23 |
|
fleshweasel posted:someone put this man out of his misery huh I always thought javac was actually super dumb and very literal with my dumb code (at least compared with gcc)
|
# ? Apr 6, 2015 19:34 |
|
|
# ? May 28, 2024 16:34 |
|
Symbolic Butt posted:huh I always thought javac was actually super dumb and very literal with my dumb code (at least compared with gcc) javac is pretty literal () but the VM and JIT do much more advanced optimizations. for "foo" + bar + "baz" I expect that it allocates a String with length of bar.length + 6 and copies right into that new String's buffer, as an example.
|
# ? Apr 6, 2015 19:41 |