|
Hammerite posted:Yes, a logical consequence of the arrangement I advocate for is that the order at declaration would have to be the opposite of the order when indexing. It doesn't matter. I mean, you're wrong. The bad consequence of doing it this way is that someone who gets the rule backwards encounters a compile-time failure when allocating a jagged nested array. The bad consequence of doing it the other way is that someone who gets the rule backwards has their code blow up dynamically when allocating a rectangular nested array. The rectangular array case is more common, and the failure mode is worse.
|
# ? Sep 14, 2018 23:44 |
|
|
# ? May 17, 2024 01:53 |
|
Hammerite posted:Just found out that if you want to declare a jagged array in C#, and you want to explicitly size the outer dimension of the array, you have to do it the wrong way around. I don't know what's going on there.
|
# ? Sep 14, 2018 23:48 |
|
Oh, does C# not directly support rectangular allocation? I guess I'd forgotten that it has multi-dimensional arrays for that case. Putting the bounds in the right position is still a good idea to reserve room to extend the language to do rectangular allocation.
|
# ? Sep 15, 2018 00:15 |
|
Another array horror is in Java when you try to annotate them @NonNull and you have to vet it exactly backwards in order to say you want a non-null array of elements vs. an array of non-null elements.
|
# ? Sep 15, 2018 01:50 |
|
CPColin posted:Another array horror is in Java when you try to annotate them @NonNull and you have to vet it exactly backwards in order to say you want a non-null array of elements vs. an array of non-null elements. Last time i checked @NonNull was not part of the standard. Is it now a part of the java specifications? I'm asking that because if @NonNull is not part of the standard, any complains you may have about its behavior cannot be brought against the language itself, but against the idiot IDE that you're using to program in said language.
|
# ? Sep 15, 2018 03:38 |
|
Java decides where annotations have to go in order to apply to things, so my complaint is still against Java, no matter the exact annotation.
|
# ? Sep 15, 2018 03:49 |
|
rjmccall posted:Oh, does C# not directly support rectangular allocation? I guess I'd forgotten that it has multi-dimensional arrays for that case. It does, new int[3, 5] is perfectly valid. Edit: that said, rectangular allocation of jagged arrays is not supported.
|
# ? Sep 15, 2018 08:39 |
|
Volguus posted:Last time i checked @NonNull was not part of the standard. Is it now a part of the java specifications? I'm asking that because if @NonNull is not part of the standard, any complains you may have about its behavior cannot be brought against the language itself, but against the idiot IDE that you're using to program in said language. It’s Lombok, which non-insane people use.
|
# ? Sep 16, 2018 00:24 |
|
return0 posted:It’s Lombok, which non-insane people use. Oh yes, Lombok. You're in the right thread then. Carry on.
|
# ? Sep 16, 2018 03:23 |
|
Eclipse also provides @NonNull and @Nullable. Or you can provide your own and tell Eclipse to use it, if you don't want to throw Eclipse's JAR into your project's dependency graph. But, again, what I said would have worked with any annotation:Java code:
|
# ? Sep 16, 2018 05:43 |
|
If you declared arrays like []Foo instead of Foo[] everything would make much more sense.
|
# ? Sep 16, 2018 06:03 |
|
Volguus posted:Oh yes, Lombok. You're in the right thread then. Carry on. Haha nice. Do go on, I’m interested in Lombok horrors if you have any stories?
|
# ? Sep 16, 2018 09:24 |
|
CPColin posted:Eclipse also provides @NonNull and @Nullable. Or you can provide your own and tell Eclipse to use it, if you don't want to throw Eclipse's JAR into your project's dependency graph. But, again, what I said would have worked with any annotation: Let me tell you about generic collections
|
# ? Sep 16, 2018 09:45 |
|
Sagacity posted:Let me tell you about generic collections Generic collections are totally fine. code:
|
# ? Sep 16, 2018 09:51 |
|
rjmccall posted:[M x [N x int]]. I spent quite a lot of time bikeshedding this for my own array plang, and we came to the conclusion that this is the right choice. It also means that for any time t, []t is an array with row type t. With C-style dimension notation, you have to jam the new dimension in the middle.
|
# ? Sep 16, 2018 11:17 |
|
Jabor posted:Generic collections are totally fine. Same thing goes for pointers and references in C++. Let's say we could express a raw pointer for type T as std::raw_ptr<T>. What's the difference between these two lines, and why? C++ code:
|
# ? Sep 16, 2018 15:51 |
|
One makes sense, the other sucks
|
# ? Sep 16, 2018 16:16 |
|
hackbunny posted:One makes sense, the other sucks Exactly. Heck, this is a valid line in C++: C++ code:
|
# ? Sep 16, 2018 16:19 |
|
C++ is a coding horror.
|
# ? Sep 16, 2018 16:19 |
|
ultrafilter posted:C++ is a coding horror. Yeah. And I get to use it every weekday!
|
# ? Sep 16, 2018 16:44 |
|
Absurd Alhazred posted:Exactly. Heck, this is a valid line in C++: That particular bit of syntax is really annoying, especially since: pre:tt.cc:2:18: error: ‘baz’ has not been declared int foo(int bar, baz, f) {return f;} ^~~ C++ code:
Contributing: C++ code:
|
# ? Sep 16, 2018 18:35 |
|
Y'all sound like you want Go's type declarations. map[int]map[string][]float64 is a map of ints to maps of strings to arrays of float64s. Similarly, Go will let you leave off the type declaration if you have multiple declared symbols in a row with the same type. E.g. func foo(a, b int, c string, d, e, f float64)
|
# ? Sep 16, 2018 20:37 |
|
TooMuchAbstraction posted:Y'all sound like you want Go's type declarations. map[int]map[string][]float64 is a map of ints to maps of strings to arrays of float64s. You do have that in templated code. As in, I've written declarations like this: C++ code:
|
# ? Sep 16, 2018 20:55 |
|
All the C++ I see nowadays mostly elides real type names and initializes each variable closest to when it's used with auto. Which is frustrating in one way, but an improvement from the last time I looked and there were still quite a lot of globals and multiple variable declarations per line, like the mentioned code snippet.
|
# ? Sep 17, 2018 14:53 |
|
ultrafilter posted:C++ is a coding horror. I’ve found that declaring multiple variables simultaneously is just asking for trouble in any language. Someone will always find a way to screw things up, and it messes with search patterns when you’re looking for variables of specific types. Also one of the most common usages is when someone’s iterating over multiple dimensions, and half of the time THAT is someone using some awful O(n^4) heuristic. If it takes deep knowledge of the language to figure out if it’s dangerous, why should you ever use it when simply splitting it into 2 lines makes it safe and easy to understand? Especially when the CPU doesn’t care at all since the compiled code is the same.
|
# ? Sep 17, 2018 16:13 |
|
Goreld posted:I’ve found that declaring multiple variables simultaneously is just asking for trouble in any language. On my team at work we actually added a linter rule to fail builds when people did this. Depending on what language you're talking about it prevents all sorts of silly problems at the cost of a bit of vertical space.
|
# ? Sep 17, 2018 20:11 |
|
Goreld posted:I’ve found that declaring multiple variables simultaneously is just asking for trouble in any language. The last time I had to deal with this was when I was trying to do some Roslyn thing and there was a weird abstraction in a syntax tree and I couldn't figure out why it was there until I realized it was to support this. It causes problems even if you avoid it like the plague yourself
|
# ? Sep 17, 2018 20:27 |
|
In .NET land if you use reflection on jagged arrays the dimensions are swapped. So if you declare an int[10][] and then reflect on the type you will get back System.Int32[][10]. I encountered a lot of headache inducing stuff like that while building a multi-language API from C# source.
|
# ? Sep 18, 2018 00:39 |
|
Been catching up on this thread from mid 2017 or so when I last posted. I don't I've ever read as many posts in a single thread as this. Had my own horror to impart We had this import process that creates Customers for a shared tenant ecommerce app, and the tools to do it just didn't scale, like at all. Basically if you had more than 1,000 rows you were rolling the dice if any of them get in, with bizarre errors that bubble up from the lowest point of the MSSQL stack. It took one front end staff close to 4 hours to import 8,000 customers into the system, and most of that was retrying/splitting the import into smaller and smaller files. Turns out, for some reason every Customer entry the application is also creating entries in AspNetUsers, NetUserRoles, etc etc. And doing a bunch of hashes. And doing them in individual order, not in batches. And doing them outside of the transaction scope. We unhooked the proc from AspNet stuff and inserted 200,000 rows in about 90 seconds.
|
# ? Sep 18, 2018 21:47 |
|
https://twitter.com/SwiftOnSecurity/status/1043003592188223489
|
# ? Sep 21, 2018 06:08 |
|
Deleted, what did it say?
|
# ? Sep 21, 2018 06:55 |
|
Carbon dioxide posted:Deleted, what did it say? Tay Tay has failed me again. Two images: one stating that Windows 10 Enterprise users will now have Linux-like support; the other one was one of Linus Trovalds` rants from LKML.
|
# ? Sep 21, 2018 07:01 |
|
Absurd Alhazred posted:Tay Tay has failed me again. What is 'Linux-like support'? Microsoft will have interns idling in an obscure IRC channel to answer support questions hours later? They already have forums full of barely-coherent Q&A posts.
|
# ? Sep 21, 2018 13:48 |
|
Munkeymon posted:What is 'Linux-like support'? Microsoft will have interns idling in an obscure IRC channel to answer support questions hours later? They already have forums full of barely-coherent Q&A posts. That was their speculation on this. Anyway, I wish I'd screencapped it.
|
# ? Sep 21, 2018 14:05 |
|
Munkeymon posted:What is 'Linux-like support'? Support is a bad word on this one - release schedule is probably clearer. quote:For future releases, Microsoft is moving to separate support lifecycles for its twice-yearly releases. The March updates will have an 18-month support cycle for all editions, whereas the September release will get the longer, 30-month support cycle for Enterprise and Education editions. (All Windows 10 Pro installations will be supported for 18 months, and Windows 10 Home has no ability to defer updates.)
|
# ? Sep 21, 2018 17:03 |
|
ulmont posted:Support is a bad word on this one - release schedule is probably clearer. But that isn’t true right? Lts is every other spring. The even years April release. IE 16.04 and 18.04 are lts but 17.04 wasn’t and is already unsupported.
|
# ? Sep 21, 2018 17:11 |
|
Hughlander posted:But that isn’t true right? Lts is every other spring. The even years April release. IE 16.04 and 18.04 are lts but 17.04 wasn’t and is already unsupported. Yes, the article is wrong.
|
# ? Sep 21, 2018 17:39 |
|
could probably format this time better right team?
|
# ? Sep 21, 2018 19:45 |
|
Our terrible internal HR system (SelectHR) has holiday time requests down to the microsecond of precision.
|
# ? Sep 21, 2018 19:55 |
|
|
# ? May 17, 2024 01:53 |
|
Scaramouche posted:Been catching up on this thread from mid 2017 or so when I last posted. I don't I've ever read as many posts in a single thread as this. Had my own horror to impart Found what for some reason was. Someone went through an added these calls to make everything compatible with Entity Framework. When it's not being used.
|
# ? Sep 21, 2018 19:56 |