- 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
“Discourse: It’s better than some random TDWTF-front-page forum code”
Admin
When working in a develop-struction environment, it is very tempting to code in these kind of patches to the database to make sure the code will be compatible. Of course a better approach is to have a specific admin function or page which can intelligently analyse and upgrade the underlying database to support the current code version. I work in vertical integration which basically means shoe horning new features into a warehousing application as requested by clients. The software allows the database to be customised with new tables and new fields in certain core tables. Sometimes different databases have similar customisations implemented in different ways. E.g one uses a checkbox and the other has a drop down control with two options. Lots of fun when it comes to writing reports which need to work with both structures. Hopefully I have never written code that does the same field check for every record in a table as in the article. Interestingly, the application provides a screen editor for altering the control layout on certain screens such as stock and customers. Adding or removing a control updates the field on the underlying table. Saving the screen changes can take 5-15 minutes on a large table. Clearly every record needs to be touched somehow to make the change. But if we use the Sql application provided by the dbms vendor, the same tables can be altered in seconds.
I think the moral of the story is to use a "real world" dataset for testing that way if you make a goof it will at least be obvious.
Admin
How could it possibly be slow? They're using a cache!
Admin
Cite please
Admin
"Having recently upgraded my forum software," Kinta wrote, "I noticed that *"
"Upon further investigation, I found that that the following code was being run once for each and every comment on a page, whenever ever a forum thread was opened.
https://github.com/discourse/discourse/blob/537e6b193d1208ee781599e37138046ddfede8cb/app/assets/javascripts/discourse/dialects/bold_italics_dialect.js
Admin
So now we know. 8675309 is a word made up of letters. And that's why Tommy can't get hold of Jenny, because he needs a number and all he's got is a word.
Admin
When I clicked on the topic link I thought this was going to be about a wooden table. I'm disappointed...
Admin
Even in a development environment, I hope you never go around with database credentials and setting up a connection for each and every method that requires database interactivity. Let alone store separate connection references in each single object. This is first-year-developer garbage code, no matter how you look at it.
Also, software that dynamically modifies its underlying data model? That's a darn good sign that your data model needs revising. It's also a surefire way to create completely unmaintainable software really, really fast, if you are after job security.
Admin
How do you know? It does stupider things than this. And I had to manually type in
what.thedailywtf.com/raw/5173/3
to figure out how to get it to post your quote without breaking the formatting.Admin
Well, ummm, yeah, they are using a cache...
The problem arises because they're not using a cache to verify the cache. They need a cache cache.
...or is the proper term "meta cache"? Hmmmm.....
Admin
I've decided to like your post:
[image]Admin
Admin
My screenshot is from Firefox. Tried Chromium and it's not happening. Can't be arsed to try other browsers or machines.
Admin
I figured as much but I couldn't be arsed to do anything else than take a screenshot of your screenshot showing that it didn't do the thing it does on your end.
Admin
Admin
Who knows if the release team has been applying our rollout scripts? Better safe than sorry!
Admin
Depends. An example is a plug in that might be applied to something where a maintenance failure by an out-of-my-control DBA might mean that the plug in is running against an obsolete database schema. In this case, it makes sense for the plugin when first run to verify the parts of the schema to which it needs access, and depending on circumstances either silently update the schema or to exit with a suitable warning as to why it cannot run. Any code that may go into an SME environment has to assume that the kind of support you get in a large enterprise may not exist. So long as there is a process such that every schema change to deal with an enhancement results in correct update code being put in the plugin validation, the software is far from unmaintainable.
Admin
wooden tyou just know someone would try to make that joke.
Admin