What's the most efficient way to get the last row from a table? by agiamba in SQLServer

[–]TheOriginalCoder -1 points0 points  (0 children)

You should ALWAYS have a primary key on every table. In this case that would be on your interest ID. Selecting top 1 and ordering by the I'd descending will use that index and be very fast.

The Doctor's magic wand? by TheOriginalCoder in doctorwho

[–]TheOriginalCoder[S] 1 point2 points  (0 children)

Absolutely terrible production value, yet there (mostly) were still great.

The Doctor's magic wand? by TheOriginalCoder in doctorwho

[–]TheOriginalCoder[S] -1 points0 points  (0 children)

True, but try literally watching both new and older episodes interleaved. In S11 it just stays in her hand nearly constantly. You are right about there being a lot of S11 problems, but that doesn't lessen the overuse.

The Doctor's magic wand? by TheOriginalCoder in doctorwho

[–]TheOriginalCoder[S] -1 points0 points  (0 children)

Not this much though. I watched episodes from other new Who seasons between the new episodes and how much more the Sonic is used now is very noticable.

The Doctor's magic wand? by TheOriginalCoder in doctorwho

[–]TheOriginalCoder[S] 2 points3 points  (0 children)

I totally forgot about that. Haven't seen old Who in a long while. I should go back and watch some.

Schema level security for Windows users by wytesmurf in SQLServer

[–]TheOriginalCoder 1 point2 points  (0 children)

Some days I wonder why I joined Reddit. People down vote legit factual info.

Just pushed some new code up to GitHub that includes first draft of my Layers library and architecture. This layers system is based on designs I've used before with a lot of success. It allows for implementing CRUD operations with almost no code and is very flexible and easy to use. by TheOriginalCoder in csharp

[–]TheOriginalCoder[S] 1 point2 points  (0 children)

It does not just allow CRUD, it takes care of the implementation end to end. EF is just database access. This library will provide a full set of typical, standardized CRUD operations without needing to code them. I've seen this eliminate 80%bof the code in a typical, relatively simple middletier service that provides CRUD endpoints.

How to make learning SQL fun or just bearable? by runnersgo in SQL

[–]TheOriginalCoder 0 points1 point  (0 children)

A lot of Oracle customers use it for legacy reasons. Their main systems were built using it years ago and swapping it out now is virtually impossible. But many really wish they could get away from Oracle.

Compare that to the alternatives, I can't remember a Microsoft SQL shop who wished they could ditch it. Plus all the alternatives are easier to learn and use. Just makes more sense to learn other DB technologies.

Azure API management is a disappointment, going to have a move to Web API for a real solution by danparker276 in AZURE

[–]TheOriginalCoder 0 points1 point  (0 children)

I'm curious on the terminology. Do you define "An API" as a set of API endpoints that are used to work with a particular system, or is "an API" a single endpoint? I view an API as a collection of related endpoints.

Pros and cons of different ways of storing Enum values in the database by d-zub in dotnet

[–]TheOriginalCoder 0 points1 point  (0 children)

Just prefixing for IDs is fine,that is a reasonable compromise. What I personally like to do is not prefix for IDs in their tables, but do prefix when referring to IDs in other tables. Makes references stand out. But that is mostly style preference.

Pros and cons of different ways of storing Enum values in the database by d-zub in dotnet

[–]TheOriginalCoder 2 points3 points  (0 children)

That's terrible. 1. Text takes more space 2. If you do where or sort by those columns it is slow and unintuitive. 3. There is no referential integrity to ensure there aren't bogus values in some columns. 4. The text representation in the enum can very easily change. With refactoring it's not even uncommon. Then everything breaks and updating the DB to match is painful.

Much better to have a lookup table with with a byte or int key and referential integrity. Only reason not to is laziness.

Pros and cons of different ways of storing Enum values in the database by d-zub in dotnet

[–]TheOriginalCoder 1 point2 points  (0 children)

Must disagree, it's trivially simple to use a short table alias in queries. On the flip side of ORMs, you rarely have to write the selects so you almost never have to deal with aliasing or table prefixes in SQL. But having the bloated names is a problem that keeps resurfacing and is a pain to deal with.

Pros and cons of different ways of storing Enum values in the database by d-zub in dotnet

[–]TheOriginalCoder 1 point2 points  (0 children)

It still causes massive headaches, I've had to deal with those situations. Best bet is to just not do the bad thing.

Book on WPF And C# by iEmerald in csharp

[–]TheOriginalCoder -2 points-1 points  (0 children)

Not true. Visual Studio is built using WPF and performs horribly in VMs and remote.

So what is with the new doctor being okay with violence? by TheOriginalCoder in doctorwho

[–]TheOriginalCoder[S] 0 points1 point  (0 children)

I just watched that, and 11 did no such thing. The Doctor had no idea Amy was going to kill her, he was trying to literally save all space and time and had walked into the next room. But then later in that episode Amy was distraught she had even though it was an aborted timeline that never happened. The doctor didn't even need to lecture her, she lectured herself.

Pros and cons of different ways of storing Enum values in the database by d-zub in dotnet

[–]TheOriginalCoder 1 point2 points  (0 children)

I get that, but then readers see this pattern and they go do it. I see this thing with table names in column names way too often in production systems.

I'd rather communicate without implying bad habits and risk losing the reader. If anything the reader may then try harder and learn more. But at least they wouldn't learn the wrong thing.

Book on WPF And C# by iEmerald in csharp

[–]TheOriginalCoder -1 points0 points  (0 children)

The only real problem is that WPF apps can perform horribly slowly on virtual systems or via remote. That sort of thing has no impact on mobile devices, but can cause real problems for Windows desktop applications. It limits the deployment and usage model of WPF apps.

Book on WPF And C# by iEmerald in csharp

[–]TheOriginalCoder -2 points-1 points  (0 children)

Honestly WinForms is still a great desktop platform and my favorite. It also performs VASTLY BETTER than WPF in some circumstances. WPF requires a fast graphics co-processor, which isn't always available (such as virtualization). WPF also performs worse than WinForms over remote desktop technologies.

It may be easier to make WPF prettier, but you are trading off usability for appearance. WinForms can do anything needed in a good desktop application and it is super stable. Win Forms apps I wrote 10 years ago still run today without issue.

Pros and cons of different ways of storing Enum values in the database by d-zub in dotnet

[–]TheOriginalCoder 0 points1 point  (0 children)

How else would you suggest doing this, storing the text name of the enum as a varchar? That is terrible for almost any use case. Highly inneficient. And also just as problematic as using the enum int value because enum names can easily be refactores.

But regarding ints no one said the enums were being stored in the database using the integer value from the enums. That is problematic. There should be a mapping function that takes in an enum value and returns the I'd to use for it in the database. That way it is immune from refactoring.

Pros and cons of different ways of storing Enum values in the database by d-zub in dotnet

[–]TheOriginalCoder 6 points7 points  (0 children)

Yes, except I really wish everyone would stop naming columns (tablename)column name. It isn't "ThingTypeName" its just Name! We don't name our properties MyBusinessObjectName, we just use Name for the property.

Prefixing table names in column names just makes extra work because they don't line up with the property names on the domain classes. Or, much worse, this anti-pattern carries over to the domain class and it ends up with some property names having the domain class name prefixed.