Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problematic Curvy API
#3
Thank you for your detailed answer.

First of all, I should clarify that my intention was not to sound harsh or rude. I'm sorry if it sounded like that. I super respect you because you are the developer of a very complex tool which means more than enough to prove you are a very experienced C# programmer.

I like discussing things in numbered points. Thank you for that too.

1. Hmm. I understand, those methods are from a library which is "3rd party" to you. That's a complicated situation (for my case). Thou, I don't see any folder named "ToolBuddy" when I import Curvy (excluding the Example folder) so I'm little bit confused. DevTools and LibTessDotNet are in Plugins folder next to Curvy but I don't see Vector Graphics anywhere. I don't know why you mentioned Vector Graphics and ToolBuddy folders.

1.b. Those 3rd party extension methods are in FluffyUnderware.* namespace which is your own namespace. How come 3rd party things are declared in your own namespace? I am very confused again.

2. I am sorry for saying "You don't even use these methods". My Resharper tool didn't scan my 3rdParty folder so it couldn't find the usages. Now, I see the usage of AddRange in DTSelection.AddGameObjects. Thank you.

About the usage of a custom extension method: As a fellow C# programmer, I'd like to suggest you to use a similar (and better) extension method from official .NET libraries "Concat". Of-course it's your decision but you can change that line like this without depending on custom extension methods.

                Selection.objects = gl.Concat(cur).ToArray();

3. I didn't mean to sound so harsh. I didn't use the word prohibition or anything like that. I am sorry If I sounded harsh. I just mentioned resizing arrays as "not being a best practice". Of-course we can resize arrays when needed (Which is very rare) and of-course List is using arrays internally (In an performance optimized way, as you know). If you consider the code I suggested in #2, it does the same thing without resizing an existing array. Your version creates 2 arrays but the suggestion creates 1 array. Of-course this is a super tiny improvement which may not justify the discussion time/effort but the suggested one saves you from using a custom dependency, If you would like to consider.

4. Again, I'm sorry if I sounded harsh but I never said "public extension methods should not be used". I said, leaking an extension method into customer code is a problem (Now I know this problem is caused by the 3rd party; not you). Also, when writing this post, I just noticed that I suffered from another Tooling malfunction. Visual Studio added "FluffyUnderware.DevTools.Extensions" namespace to my usings section without telling me because earlier I used another extension method from that namespace by mistake without noticing this leak problem. The extension I used earlier was "IndexOf" method in the same namespace. VS did me a sneaky trick by adding a 3rd party namespace into my code.

5. The developer of this 3rd party "DevTools" made another questionable thing by implementing "IndexOf" as a custom extension method. .NET already provides this method in Array class. Re-inventing an existing .NET method as a custom extension method and providing it as a public solution is not a best practice either. Thou, again, I don't know why this 3rd party stuff is in your own namespace.

Anyways, as a result of our discussion, I saw that I can get rid of the leak problem by removing your namespace containing 3rd party extensions from my usings section and switching to the use of .NET's original Array.IndexOf method.

If you would like to disscuss these numbered points further, I'd be happy to discuss because I enjoy every bit of C# discussion.

One last time, I am very sorry if I sounded harsh or rude. That wasn't my intention.
Reply


Messages In This Thread
Problematic Curvy API - by XtroTheArctic - 09-18-2023, 12:07 AM
RE: Problematic Curvy API - by _Aka_ - 09-18-2023, 10:19 AM
RE: Problematic Curvy API - by XtroTheArctic - 09-19-2023, 05:43 PM
RE: Problematic Curvy API - by _Aka_ - 09-20-2023, 09:29 AM
RE: Problematic Curvy API - by SAMYTHEBIGJUICY - 10-14-2023, 12:39 AM
RE: Problematic Curvy API - by SomeGuyEight - 10-14-2023, 04:48 PM
RE: Problematic Curvy API - by XtroTheArctic - 09-20-2023, 03:25 PM
RE: Problematic Curvy API - by _Aka_ - 09-21-2023, 08:40 AM
RE: Problematic Curvy API - by _Aka_ - 10-16-2023, 08:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 11 04-03-2024, 03:16 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
Exclamation Extending Curvy Generator for Advanced Lofting - Feasibility Check amutp 2 5 03-27-2024, 07:25 AM
Last Post: amutp

Forum Jump: