|
nebby posted:Yeah. One thing I think I've come to conclude is that one small thing that would go a long way towards a middle ground between my (supposedly crazy) viewpoints and the "gently caress it do whatever you want and use 'common sense'" viewpoint is a convention to use noun-adjective instead of adjective-noun in variable names and return type-verb in method names (or, at the very least, be consistent.) I suppose the variable/function type would give some information. But not all of program in a strongly-typed language like C# or Java.
|
# ¿ Mar 29, 2008 08:10 |
|
|
# ¿ Apr 29, 2024 19:01 |
|
code:
|
# ¿ Apr 10, 2008 21:31 |
|
qntm posted:http://en.wikipedia.org/wiki/Python_%28programming_language%29 http://en.wikipedia.org/wiki/Rounding#Round_half_to_even
|
# ¿ Jun 12, 2010 21:09 |
|
Does it count as a horror to post a picture of HTML?
|
# ¿ Aug 3, 2012 00:53 |
|
My first thought was some sort of COM MTA/STA threading issue, but still, why would you sleep the current thread instead of joining the created one?
|
# ¿ Sep 16, 2012 11:31 |
|
Flobbster posted:The best kind of error handling is when you detect enough context to know exactly what the user wanted to do, but you still just don't do it. Command line processing can be enough of a pain in the rear end. Why add context guessing heuristics to the mix? I can only see that ending in madness.
|
# ¿ Sep 7, 2013 16:56 |
|
As a C# programmer who is learning Java for Android development, I am curious. What are Java's strengths?
|
# ¿ Oct 2, 2013 11:01 |
|
C# code:
|
# ¿ Dec 21, 2013 05:17 |
|
I dunno, seems roughly equivalent to me. It's either a hardcoded path string to a config file with file IO to read/parse information, or a hardcoded connection string to a database with SQL to read/parse information. Either way, things can go wrong at runtime.
|
# ¿ Jan 31, 2014 18:56 |
|
Isn't everything in the System.Drawing namespace just a thin wrapper over the GDI API?
|
# ¿ Feb 18, 2014 04:13 |
|
This entire conversation about nested iteration in Python is proof that LINQ is the best thing ever.
|
# ¿ Jun 20, 2014 00:43 |
|
Newf posted:It's definitely possible but I can't think of any reasonable scenario where it'd be the case. An I/O request with a decent chance of failure. Web, serial port, etc.
|
# ¿ Jul 29, 2015 03:45 |
|
Kazinsal posted:A lot of Windows' API has been unchanged for a distressing number of years. I mean, take a look at the Hello World example from the Windows SDK circa 1985 and tell me how many functions you recognize... You know, there's a 50/50 chance that you can compile and run that exact code.
|
# ¿ Aug 17, 2016 01:07 |
|
xtal posted:Commas are whitespace so commas and spaces are redundant. A map in Clojure is {key value key value}. Since when are commas whitespace?
|
# ¿ Sep 19, 2016 01:43 |
|
There is no idea so bad that no one hasn't implemented it.
|
# ¿ Sep 20, 2016 11:23 |
|
zergstain posted:I asked since it looked like RandomBlue was complaining about inconsistent behaviour with path separators. At any rate, I can see the rationale for why Path.Combine() works that way. What about paths with ".." in the middle, for example: c:\Windows\System32\..\..\Windows\..\ProgramData Try typing that into Explorer. It works.
|
# ¿ Mar 28, 2017 03:14 |
|
Python code:
|
# ¿ Jun 21, 2017 02:52 |
|
That seems OK to me as well. If iteration order is not defined or guaranteed, then randomizing the order is perfectly acceptable. I suppose randomization does have a performance cost, but would it matter on a practical level?
|
# ¿ Jul 7, 2017 03:40 |
|
code:
|
# ¿ Jul 16, 2017 06:24 |
|
JawnV6 posted:I worked with a contractor that didn’t escape strings. When the device was booting, it would print some garbage that included a bell character. My terminal would dutifully ding every clean boot. What's worse, using a bell character, even by accident, or the fact that it still works?
|
# ¿ Sep 12, 2017 04:59 |
|
code:
code:
|
# ¿ Sep 17, 2017 21:05 |
|
Considering that all the other casts are using types with explicit sizes, my first question would be, what is result of sizeof(int)?
|
# ¿ Dec 23, 2017 04:26 |
|
Shouldn't the default implementation of GetHashCode() or equivalent just return 0? You should either explicitly define a hashing method or not get one at all.
|
# ¿ Apr 26, 2018 04:02 |
|
Visual Studio is mother, Visual Studio is father. I'm likely the only one who will get this reference.
|
# ¿ May 11, 2018 22:56 |
|
I am starting to be of the belief that the assumption that char (a code unit of some encoding) == byte (an unsigned 8-bit integer value) is one of the two biggest mistakes ever made in the design of programming languages. The other is that sizeof(int) is platform dependent.
|
# ¿ Nov 23, 2019 04:55 |
|
I can see why a platform dependent integer type is needed, pointers for example. However, it shouldn't be the default int type. Going thru APIs like win32 or opengl shows how much effort people go thru nailing down int sizes. If I had a time machine, this is how integers should work in C and derivatives: byte / sbyte (maybe with a alias of int8 / sint8 for consistency) int16 / uint16 int32 / uint32 int64 / uint64 word / sword - a platform dependent integer type that is the native word size for the running system. Also: quote:target-determined type that can express any number of objects that you can have simultaneously in your program.
|
# ¿ Nov 23, 2019 05:55 |
|
|
# ¿ Apr 29, 2024 19:01 |
|
What is the definition of a 'library I/O function'? I assume that this is more specific than just any function (does in-lining matter?)
|
# ¿ Mar 12, 2020 13:01 |