- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Nothing matters except Roger being away while shit hit the fan. Everyone automatically blames+hates him.
Admin
What class of problem is it good for solving?
Admin
In my experience:
Changing column type / rename table can create new one with correct type - less than a day.
Have the QA team approve to code change for Int32 to Int64 - more than 3 months. (Note that without this, depend on what data component you use for insert record, you may experience error when the data component try to read back inserted data)
Therefore rename the old table can create new 2 new tables - one with the same type one with correct type, and use insert trigger to connect them is the correct solution.
Admin
If the table is being used as a log and the column is autoincrement, the only thing changing it can break is whatever is used to read the logs - and that isn't mission critical, whereas transaction failures are a bad idea. Currently we can't read the logs anyway because they are not being written, so in a properly modular architecture - and what we're reading suggests that we have one here - any log reading bugs can be flattened while the system is running, without ill effects.
Getting a competent person to identify possible side effects of the change - 1 day Getting a worried management to tell QA to extract finger - 20 minutes.
Admin
It's not a WTF at all. You can't prepare for all future error events.
The problem was easily solvable. Why is Danny looking for a new job after this minor incident? He is on some never ending mission to find a "perfect company" where no errors happen?
Admin
I'm slightly surprised that the errors table supported duplicate errors.
Admin
That would be for transaction logging though, not general logging, and you'd want to write exactly one record per transaction. I'd still want to keep general logs separate. For example, they might go in their own database, though if they're not needed to be kept live I'd write to something non-database and then roll that periodically into the analytics DB via some sort of batch processing. The point is that running out of space (or IDs) on the (general) logging system shouldn't cause transactions to fail since general logs shouldn't be business-critical.
But then I've seen live systems fail due to running out of space. It's not pretty…
Admin
This seems like a pretty simple change to make in a future release/patch. It even seems like an honest mistake on Roger's part. If the traffic is 10K/day and he receives even passing assurances that the traffic will remain in that range, even doing a 10X estimate to allow for over success of the business it still gives Roger's design a 58 year runway. I don't know about anyone else, but I generally don't account for the software not needing to be redesigned/patched/iterated upon for longer than the duration of the average person's career.
Admin
Think of all the people in the 60s and 70s who by thinking exactly that created some great job opportunities for COBOL people in the years leading up to 2000. Many a programmer had a nice sabbatical in 2000 because somebody many years before said "Hey, we could save space on tape by making all these years 2 digits. And that will speed up date operations too!".
It wasn't even really a mistake. We all have 100% hindsight, but I doubt anybody scoped out the future scaling to be that high. When PCs went from 32 to 64 bits, nobody called the original decision to go from 16 to 32 a "mistake", because at the time I doubt many people imagined a portable computer would ever need to address as much as 4Gbytes of RAM; and if anyone did, they would assume that paging would apply rather than a uniform address space.Admin
That's better than a lot of these WTF creators (article sources): they don't account for next week.
Admin
Yup one great thing about I.T. is that there's multiple ways to solve the problem and several of them could be considered 'good'. I was thinking of logging batch processes, or whatever it might need. Transaction logging is a very strong feature of RDBMS too though. Yup, at the end of the day, it's whatever's best for the enterprise. It's nice to talk data on this site!
Admin
Did NodeJS stop using JavaScript when I wasn't looking or did someone manage to make a JS implementation that doesn't suck? (Hint: No)
Admin
It helps to use good libraries with Node ;)
Example:
async
. Makes so many things so easy :smile:Admin
What I really hate is the "JavaScript is a perfect introductory language" brainworm.
No, it's belgiuming not. It's a terrible first language. It's best used asynchronously, encourages globals, is dynamically typed, and very easily leads to code smell. If you know what you're doing, JavaScript is OK. But it's not good for introductory learning.
Admin
No kidding -- I'd rather see Python as an intro language myself. It is a language which encourages locality, tends to discourage smelly code in several ways, and is strongly (albeit dynamically) typed -- the sloppy-typing shenanigans pulled by JS cowboys simply get hit by the nope cannon when tried in Python. (It also has fantastic support nowadays for some things that other languages come up short on, like Unicode ;) )
Filed under: please stop conflating dynamic types and sloppy types
Admin
Admin
There are plenty of languages with decent unicode support... it's just that for whatever reason, the popular languages that use dynamic types tend to have poor support for unicode (as opposed to say, .NET languages, where the String type is UTF-16 internally).
Admin
So the length of a string in .NET isn't the number of characters in it? It can't be if there's a character outside the BMP present. Not unless the length of the string isn't the number of
char
units in it, which is even crazier. (Having an encoding scheme in use that is exposed to user code is the root of this problem. It's just the same problem that happens with “char
is an 8-bit byte” except with more bits.)I used to think that there's exactly one sane way to handle Unicode, but now I think that Unicode itself is mad too. It's still the sanest game in town, but that town is Loonytoon McMaddsville.
Admin
Yes it is.
Oh wait. Kind of. I guess not. Oh well.
Admin
Precisely. Fucking Unicode. :moving_goal_post:
Admin
Well I thought it was before I looked it up. So there's that.
Admin
The assumption that a char is an 8-bit character would be wrong in .NET.
It's a UTF-16 code point.
Admin
He didn't make that assumption, who the fuck are you correcting?
Admin
Python 3.3 and newer do even better -- their string type is one index unit to the codepoint externally, but internally is variable-width, depending on how wide the codepoints are (so an ASCII string is still 8 bits/codepoint, while a BMP-only string is 16 bits/codepoint, and you only pay the 32 bits/codepoint penalty if you are using non-BMP characters).
See above -- the Pythonistas came up with a way out of (at least part of) the madness ;)@powerlord -- ever seen what a naive wide-character (16bits/codepont) setup does to non-BMP chars?
Admin
I'll admit that I haven't... but just to be on the clear side, we're all aware here that a
char
in C#/.NET is astruct
and not a raw type, right?Admin
Doesn't matter, surrogate pairs happen anyway
Admin
I'd rather see Python 3.x as an intro language. 2.7 has examples of bad design. Unfortunately, the Higgs Field of programming, the programming inertial field that gives old code its mass, ensures it will be around till the heat death of the Universe or the Big Crunch, whichever comes first.
Admin
Agreed -- 2.7 is a legacy language, more or less...
Admin
It takes a massive sweetener to get people to take a jump to a new major version. Major performance enhancement is about the only thing that will really turn peoples' heads that much. Without that, you get a huge hangover of unconverted.