|
this just look like a bunch of class in the same file. there is hardly enough to call that anything...
for example
public class List<T> {}
public abstract Visual {}
public class UIElement : Visual {}
public class String {}
public class FrameworkElement : UIElement
{
public List<string> strings = new ();
}
Unless you mean to suggest? perhaps split that in a few files?
that not spaghetti, but that would be a little more organisation!
spaghetti code is about code lacking.... hierarchical stucture, well defined responsibility, that sort of thing.
Not so much about whether the code is one humongous file or many small ones.
modified 9-Dec-21 1:59am.
|
|
|
|
|
This makes sense. I am starting to understand the code.
|
|
|
|
|
It would depend on what the classes contained: it's quite possible for that to be a good design - and the Concrete2 class could be just trying to get round a bug in teh VS designer that has been unfixed since the first release of .NET: you can't use the designer on a Control derived from an abstract class without a dummy concrete class between them:
public abstract class MyBase: UserControl { ... }
public class _MyBase: MyBase {}
public class MyControl : _MyBase { ... } The designer can open MyBase and MyControl , but can't open _MyBase
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks for your reply. I am starting to understand the code, and it seems to be too intelligent a design for a lay person like me.
|
|
|
|
|
If you have to ask, then the answer is probably YES.
|
|
|
|
|
Looks like the natural progression of a first time C# project.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
No. Spaghetti tastes good.
Nothing succeeds like a budgie without teeth.
|
|
|
|
|
I don't know what this is, but it's not spaghetti code.
Spaghetti code is when you break the sequential flow of your code by jumping to somewhere else, without the possibility to come back.
One would think it is not used anymore these days, but that is not really true. Every time you write a return in the middle of a method you actually break the sequential flow, which is technically speaking spaghetti code. Granted this has not the disastrous consequences as the old goto, but still...
|
|
|
|
|
|
People go to C# to escape scary old C++ and this is where they end up.
|
|
|
|
|
Without a good view of the whole dish along with remarks and dev notes, I'd call it ziti. Might be baked or half-baked. Depending on the entire code base, it might even be baked raviolis.
I can't call it spaghetti just on a declaration snippet, but I'm not a purist when I'm looking at existing code. In practical terms, it really depends on why you are there also. If you have an issue, trace it through. If it's just theoretical or just jumps out at you, it may fall under the 'if it ain't broke' theory, again depending on what your specific task is and allotted time.
Now, What's for dinner?
|
|
|
|
|
MikeCO10 wrote: What's for dinner? Fish.
Software Zen: delete this;
|
|
|
|
|
Not spaghetti code, but it is an antipattern.
Remove it, and if nothing breaks, leave it gone.
Otherwise, if you figure out what it's for, add comments. As it sits now it's expensive trash.
|
|
|
|
|
oh my. These look like prime candidates for deletion. if the rest of the code depends on it, you might be dealing with a prime application for abortion. 
|
|
|
|
|
short: yes
Long: abstraction for the sake of patterns is a waste when it's not needed. I knew someone who abstracted everything and basically made a soup of interfaces for a very simple implementation, the abstraction was not used in a beneficial way, and caused way more headaches just trying to troubleshoot.
the KISS ideology is good, but I like the "Keep it as simple as possible"; if you know multiple things will inherit or implement code, build for that. if not, keep the code as direct and simple as possible, you can always refactor later.
|
|
|
|
|
Seasons 1 to 5 of The Expanse binge-watched, books 1 through 9 re-read.
I'm ready for Season 6.
I think ... pity it's one-per-week though.
Anyone else ready?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Quote: Anyone else ready?
Yup! Ready and waiting!
Get me coffee and no one gets hurt!
|
|
|
|
|
Read somewhere recently that this would be the last series they make, so it looks as if we won't see all of the books covered which is rather a shame. This has been rather an enjoyable outing.
|
|
|
|
|
Bingewatched my first series, called "Katla", and two more episodes to go.
SSssshh..
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
The Icelandic one? Watched that a few weeks ago.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yup. Very enjoyable
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Nope.
>64
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
|
|
|
|
|
You Are Not Prepared - YouTube[^]
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I'm too cheap for Amazon Prime. I'll wait for all the series to come out, get prime and binge for a 2 month period, then cancel prime. No need to feed my consumerism by getting extra fast shipping. Plus book 9 is a Christmas present for my wife, so I won't be able to read it till she is done with the book on Dec 26th around midnight
Hogan
|
|
|
|
|
I'm in!
Like you I've binged seasons 1-5 and reread all 9 books. Though one episode a week is going to test my mettle. I'm sure I'll binge the all of season 6 again once the last episode has dropped.
|
|
|
|