Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"

Milotic posted:

There's stuff that could be improved, definitely, and how Microsoft implemented AJAX for ASP.NET can be an abomination unto God sometimes

This is a problem for many frameworks that heavily abstract the web development cycle and came before AJAX became commonplace, because asynchronous partial page loads are a completely different model of development than the old-style "re-render the entire page every time".

I work on a web application written using Apple WebObjects that we've been slowly AJAXifying over the past couple years, so I feel that pain every day. The hackery required to get AJAX working in it was bad enough, but at least it was already done as part of the Project Wonder project, which provides a ton of extensions to WebObjects. I had to write a whole slew of components to generate Dojo widgets by hand from scratch, though :gonk:

Adbot
ADBOT LOVES YOU

Milotic
Mar 4, 2009

9CL apologist
Slippery Tilde
There's been a tendency in my organisation to come up with some real design horrors, where many applications with quite complex behaviour and the need for real time status information have been done as asp.net pages, usually using some Ajax framework rather than WinForms. These are all internal applications. The frustrating thing is that the company just doesn't seem to want to move to flash, silverlight or some other RIA framework. No, we have to have multiple users viewing a page with quite a few nested tables, which refreshes every 5s. And we're making hundreds of calls to SharePoint web services (including security ones, which seem to be the slowest) and AD each time we do this. And we wonder why performance is bad.

Is there some sort of screen history navigation design pattern people use for web pages? Some of our systems chain sub-menu pages, and it's always a complete bitch getting them to return the user to appropriate page in the appropriate state when they click Cancel.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Milotic posted:

There's been a tendency in my organisation to come up with some real design horrors, where many applications with quite complex behaviour and the need for real time status information have been done as asp.net pages, usually using some Ajax framework rather than WinForms. These are all internal applications. The frustrating thing is that the company just doesn't seem to want to move to flash, silverlight or some other RIA framework. No, we have to have multiple users viewing a page with quite a few nested tables, which refreshes every 5s. And we're making hundreds of calls to SharePoint web services (including security ones, which seem to be the slowest) and AD each time we do this. And we wonder why performance is bad.

Is there some sort of screen history navigation design pattern people use for web pages? Some of our systems chain sub-menu pages, and it's always a complete bitch getting them to return the user to appropriate page in the appropriate state when they click Cancel.

I don't really understand why poo poo like that has to be browser-based. It seems to me that projects like that tend to become IE-only anyway so you might as well just say gently caress it and make a proper GUI front end in the visual studio designer.

Nomnom Cookie
Aug 30, 2009



Milotic posted:

Huh? Web development with ASP.NET is fine. There's stuff that could be improved, definitely, and how Microsoft implemented AJAX for ASP.NET can be an abomination unto God sometimes, and the page event life cycle is a bit lovely in places, but really, I've seen worse technologies and frameworks.

It's not so much that I have any issues with ASP.NET as it is that the entire class of problems ASP.NET is designed to solve is utterly uninteresting to me. Playing mix-and-match with tags and C# to shove data around in slightly different ways just isn't what I want to do with my life.

Although I do think ASP.NET is entirely the wrong direction for Web development to take and hope it's an evolutionary dead-end, it is at least a decent implementation. You're right; my prospects could be worse.

spiritual bypass
Feb 19, 2008

Grimey Drawer

Munkeymon posted:

I don't really understand why poo poo like that has to be browser-based. It seems to me that projects like that tend to become IE-only anyway so you might as well just say gently caress it and make a proper GUI front end in the visual studio designer.

People do it because it's really fast and really easy. To me it makes sense, even for a small office.

Where I work my apps get used by people with iPhones, Blackberries, Apples, Windows, and Linux. I only need to write one decent version of a web app and it works well on every platform. I've tried a little bit of GTK, Swing, and C#; but, I still find web applications easier to craft. It seems ironic really, since I usually use 4 different languages to get the job done.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

rt4 posted:

People do it because it's really fast and really easy. To me it makes sense, even for a small office.

Where I work my apps get used by people with iPhones, Blackberries, Apples, Windows, and Linux. I only need to write one decent version of a web app and it works well on every platform. I've tried a little bit of GTK, Swing, and C#; but, I still find web applications easier to craft. It seems ironic really, since I usually use 4 different languages to get the job done.

The best tool for the job isn't necessarily just one language.

MrSaxamaphone
Nov 1, 2004

You know you wanna tap that...
We had a guy write some production code that did something along the lines of:

Query Database
Run through sequentially
Find element that matches X, change, query database and startover.

It was unreal. Unfortunately it was written in our proprietary language so posting it here wouldn't make any sense. :downs: Yes, proprietary language. Ugh. Hope I get to do some of the WPF stuff we're looking at.

POKEMAN SAM
Jul 8, 2004

MrSaxamaphone posted:

Hope I get to do some of the WPF stuff we're looking at.

WPF is a coding horror.

Ogive
Dec 22, 2002

by Lowtax

MrSaxamaphone posted:

We had a guy write some production code that did something along the lines of:

Query Database
Run through sequentially
Find element that matches X, change, query database and startover.

In a previous life, I worked on a DB engine. A customer submitted an app and wanted some help with performance. Turned out they were manually doing a binary search through a SQL table to find what they were looking for.

The solution was to tell them to use an index and a single SELECT statement with exactly what they wanted.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.

ShoulderDaemon posted:

If both field1 and field2 are uniformly distributed over the range of an int, and they are uncorrelated to eachother, then field1 ^ field2 would be an acceptable quick-and-dirty hash function. Using field1 | field2 even in that optimal case will be strongly biased towards returning 1s in the hash, giving a very poor hash function. If field1 and field2 are not uniformly distributed, or are correlated to eachother, then either approach will probably give a poor hash.
Thanks for your help.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



rt4 posted:

People do it because it's really fast and really easy. To me it makes sense, even for a small office.

Where I work my apps get used by people with iPhones, Blackberries, Apples, Windows, and Linux. I only need to write one decent version of a web app and it works well on every platform. I've tried a little bit of GTK, Swing, and C#; but, I still find web applications easier to craft. It seems ironic really, since I usually use 4 different languages to get the job done.

That's great for a decently well-written application, but what I had in mind was an IE-only clusterfuck that would have started life as an IE-only mess and simply graduated to clusterfuck later in life. Preferring a slow, crippled web interface over even a medium-effort native interface in that case makes me :psyduck: but I'm sure I'm just biased since I don't believe browser-based interfaces will ever be a reasonable replacement for what we can do with native code except in simple cases. They're easier to get working, of course, but then people want you to mash native interface concepts and abilities into the web interface and you have to break out the kludgeon and go to work.

jandrese
Apr 3, 2007

by Tiny Fistpump
Making a standards based app that plays nice with all of the modern browsers is great, until your boss comes in and reminds you that 20 some percent of the visitors to the site are still using IE6, and they're stuck behind a modem somewhere and are never going to upgrade it (running windowsupdate on their machines would take all month, especially since they have dozens of different bots vying for all of their bandwidth).

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

Milotic posted:

Huh? Web development with ASP.NET is fine. There's stuff that could be improved, definitely, and how Microsoft implemented AJAX for ASP.NET can be an abomination unto God sometimes, and the page event life cycle is a bit lovely in places, but really, I've seen worse technologies and frameworks.

We need a distinction between "web devs" and application devs that are writing for the web. It used to a be a "web developer" was someone who hacked DHTML and CSS to get cool rollovers but now so much real functionality is moving to web interfaces and you have these enterprise-level web development platforms that the distinction between "real dev" and "web dev" is basically non-existent (except for the abomination of writing a decent UI in HTML/CSS).

My workplace employs an engineering organization made of CS degrees all with backgrounds in C++/C#/Java/etc and we all develop complex web apps in either Java or ASP.NET. The work we do isn't qualitatively different from desktop apps. But we also have "web devs" in the marketing department who's job is to create light-weight HTML pages that might pull some data down via AJAX but by-and-large aren't backed by a server-side application codebase.

So, am I a web dev if I spend all day in ASP.NET? What's that make the HTML guy in the other department? Are the people creating Google Maps in the same class of people that customized their Livejournal template? Obviously not but the term "web dev" still seems to sit awkwardly between those extremes.

I see the distinction "web dev" and "web app dev" but that doesn't seem any less awkward.

Nomnom Cookie posted:

It's not so much that I have any issues with ASP.NET as it is that the entire class of problems ASP.NET is designed to solve is utterly uninteresting to me. Playing mix-and-match with tags and C# to shove data around in slightly different ways just isn't what I want to do with my life.

Although I do think ASP.NET is entirely the wrong direction for Web development to take and hope it's an evolutionary dead-end, it is at least a decent implementation. You're right; my prospects could be worse.

ASP.NET the platform is pretty solid in my opinion. WebForms is just the application framework built on top of it. And at this point we've essentially abandoned it for ASP.NET MVC which fits much much better in the web world. It's a testament to the flexibility of ASP.NET that you can essentially rip out WebForms and replace it with something else and it still works.

Dr Monkeysee fucked around with this message at 19:11 on Mar 5, 2010

ErIog
Jul 11, 2001

:nsacloud:
I usually break it down as the difference between web design and web programming. I find it useful to break it down like this because web programmers are usually poo poo at getting anything to look good. Web design people usually tend not to be able to program worth poo poo.

spiritual bypass
Feb 19, 2008

Grimey Drawer

Monkeyseesaw posted:

What's that make the HTML guy in the other department?

The ones I've encountered tend to have backgrounds designing logos and making the graphics that go on the web pages, and their mockups. So, I usually just call them artists.

Then they get shoehorned into writing stuff they don't understand to try to save money.
Then it goes way too far and they start making databases and PHP programs based on some tutorial they read.

:ughh:

Lorem ipsum
Sep 25, 2007
IF I REPORT SOMETHING, BAN ME.
I found this on a pastebin
code:
#include <iostream>

int iii=1;
int R=78;
int L=46;
int Button1=0;
int Button2=0;

using namespace std;

int main()
{
    ChocolatePie:
              cout <<"AAC. This is initial release." << endl;
              cout << "If you'd like to get started, please type 0. If you don't want to, please type 1." << endl;
              int x;
              cin >> x;
              if (x==0)
              {
                 goto Beginning;
              }
                 else
                 {
                     goto ChocolatePie;
                 }
    Beginning:
              if (iii==1)
              {
                         iii=iii+1;
                        cout << "Enter your first button: ";
                        cin >> Button1;
                        if (Button1==5)
                           {
                            goto Beginning;
                            }                   
                          }
                        
              else if (iii==2)
              {
                   iii=iii+1;
                   cout << "Enter your second button: ";
                   cin >> Button2;
                   if (Button2==5)
                   {
                                  goto Beginning;
                                  }
                   }
              return 0;
              }
                        
                        
              

No compiling issues, but after I enter my first button the program shuts down...
http://pastebin.com/EUdmS7R4

I will just let this one speak for itself.

jandrese
Apr 3, 2007

by Tiny Fistpump
People still learn on BASIC first? Also, I'm not going to rag on Baby's First C++ Program. Everybody had to start somewhere.

Rahu
Feb 14, 2009


let me just check my figures real quick here
Grimey Drawer

Lorem ipsum posted:


I will just let this one speak for itself.
Loving the pro indentation toawrds the end

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Ugg boots posted:

WPF is a coding horror.

I have a hard time with it, too :(

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

rt4 posted:

Then they get shoehorned into writing stuff they don't understand to try to save money.
Then it goes way too far and they start making databases and PHP programs based on some tutorial they read.

:ughh:

Haha yeah we specifically had to set up PHP in the publishing environment so they could do some server-side stuff if it came up.

Tikki
Aug 13, 2007
Life is too short for... No. Life is just too short!

rt4 posted:

The ones I've encountered tend to have backgrounds designing logos and making the graphics that go on the web pages, and their mockups. So, I usually just call them artists.

Then they get shoehorned into writing stuff they don't understand to try to save money.
Then it goes way too far and they start making databases and PHP programs based on some tutorial they read.

:ughh:

It goes the other way too, I'm usually only doing backend coding and JavaScript, but some times they try to coerce me into writing stuff and designing poo poo as well.

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
From some old LaTeX code I wrote:
code:
% it rotates variables by 90 degrees
No, I don't know what that means.

biznatchio
Mar 31, 2001


Buglord

niteice posted:

From some old LaTeX code I wrote:
code:
% it rotates variables by 90 degrees
No, I don't know what that means.

Well obviously w becomes E, U becomes C, and z becomes N. X and O are unchanged.

theg sprank
Feb 3, 2008
pillage your village

biznatchio posted:

Well obviously w becomes E

How do you know it doesn't become \exists?

Athas
Aug 6, 2007

fuck that joker

theg sprank posted:

How do you know it doesn't become \exists?

\exists and \forall are an E and an A mirrored across both axes.

Nevett
Aug 31, 2001

Heres a nice snippet from an old ASP project I've been given to do some work on..

code:
	function LoginAdministrator() {
	Response.Cookies("AdminLoggedIn") = GetAdministratorCookieValue();
	Response.Cookies("AdminLoggedIn").Path = "/";

	}

	function CheckAdministratorLoggedIn() {
	return (Request.Cookies("AdminLoggedIn") == GetAdministratorCookieValue());
	}

	function GetAdministratorCookieValue() {
	return hex_md5("Admin");	// TODO : Make this a more complex string
	}

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

niteice posted:

From some old LaTeX code I wrote:
code:
% it rotates variables by 90 degrees
No, I don't know what that means.
I believe it multiplies by i (\sqrt{-1}).

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Athas posted:

\exists and \forall are an E and an A mirrored across both axes.

He means, if you rotate W in one direction it looks like an E and if you rotate it in the other direction it looks like \exists.

Ginny
Sep 29, 2007
3,2,1 Let's Jam!
God drat. Here I was, on a separation of concerns crusade, when I stumbled upon this little bit of code left to us by a coder who quit eight months ago:

code:
void CSettings::ChangeLastConfigSuccessfull(TBool aNewState) {
	if(aNewState) 
		iLastConfigSuccessfull.Copy(_L("true"));
	else 			 
		iLastConfigSuccessfull.Copy(_L("false"));
}


TBool CSettings::LastConfigSuccessfull()
{
	return (iLastConfigSuccessfull.Compare(_L("true")) == 0);
}
(Symbian, if you were wondering)

ErIog
Jul 11, 2001

:nsacloud:
I have a potential coding horror of my own doing to submit.

I'm working on a project in Python that parses XML files. These XML files always exist in pairs, and one of these files is a lot more complicated than the other. At first, I implemented everything using xml.dom.minidom. It worked swimmingly for the less-complicated file. It worked alright for the more complicated file until I threw more of my test data at it.

I rewrote the parsing for the more complicated file in ElementTree, but I have not rewritten the parsing for the less complicated file. It's still xml.dom.minidom. It works fine. It's just not consistent. It has been documented in the code. They're not intermingling within the same function. The function that parses the more complicated file uses ElementTree. The function that parses the less complicated file uses xml.dom.minidom. There is no other XML parsing going on any other place in the code besides those 2 functions.

I need a verdict. Is this a coding horror?

Scaevolus
Apr 16, 2007

ErIog posted:

I need a verdict. Is this a coding horror?

Yes, because you should be using lxml.

Nomnom Cookie
Aug 30, 2009



ErIog posted:

I need a verdict. Is this a coding horror?

No. But you know it's not as clean as it should be. Also,

Scaevolus posted:

you should be using lxml.

Crazy RRRussian
Mar 5, 2010

by Fistgrrl
From a recent conversation:

IT person: the compiler does all math equations anyway

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

LockeNess Monster posted:

From a recent conversation:

IT person: the compiler does all math equations anyway

Depends. If he's talking about stuff like int i = 2 + MAX_FOO; and MAX_FOO is just defined as 4 or something, then yeah, the compiler does those

at least that's what I'd assume he was saying

floWenoL
Oct 23, 2002

Ryouga Inverse posted:

Depends. If he's talking about stuff like int i = 2 + MAX_FOO; and MAX_FOO is just defined as 4 or something, then yeah, the compiler does those

at least that's what I'd assume he was saying

all math boils down to constant propagation

ZorbaTHut
May 5, 2005

wake me when the world is saved

Otto Skorzeny posted:

http://peter.hates-software.com/2004/08/20/6550cefa.html

GCC's option flags are a horror, although of lesser magnitude than GCC's internals and much of glibc

Slightly late on this point, but the complete inability to disable specific warnings, or turn specific warnings into errors (i.e. with more fidelity than a global -Werror), has led to me writing a small chunk of shell script that wraps GCC, grabs the output, runs a bunch of sed scripts on it to turn some warnings into errors and eliminate other warnings entirely, and returns an appropriate error code.

I'm not sure if this is a coding horror or a coding glory, since it works drat well and makes GCC quite a bit more pleasant to use . . . but it definitely makes me want to cry.

UberJumper
May 20, 2007
woop

ZorbaTHut posted:

Slightly late on this point, but the complete inability to disable specific warnings, or turn specific warnings into errors (i.e. with more fidelity than a global -Werror), has led to me writing a small chunk of shell script that wraps GCC, grabs the output, runs a bunch of sed scripts on it to turn some warnings into errors and eliminate other warnings entirely, and returns an appropriate error code.

I'm not sure if this is a coding horror or a coding glory, since it works drat well and makes GCC quite a bit more pleasant to use . . . but it definitely makes me want to cry.

I am not much of a *nix guy, but is there any decent alternative to gcc?

AzraelNewtype
Nov 9, 2004

「ブレストバーン!!」
Technically you can use the Intel Compiler Collection instead, though a lot of important linux packages don't really compile with it, including the kernel.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

UberJumper posted:

I am not much of a *nix guy, but is there any decent alternative to gcc?

For C or Obj-C, clang. For C++, nothing yet.

Adbot
ADBOT LOVES YOU

HFX
Nov 29, 2004

ZorbaTHut posted:

Slightly late on this point, but the complete inability to disable specific warnings, or turn specific warnings into errors (i.e. with more fidelity than a global -Werror), has led to me writing a small chunk of shell script that wraps GCC, grabs the output, runs a bunch of sed scripts on it to turn some warnings into errors and eliminate other warnings entirely, and returns an appropriate error code.

I'm not sure if this is a coding horror or a coding glory, since it works drat well and makes GCC quite a bit more pleasant to use . . . but it definitely makes me want to cry.

I've just got in a habit of treating all warnings as errors.

Still I'd rather GCC rather then Javascript on the embedded platform I'm working on right now. 200K lines of Javascript and counting. Also, do to specific calls, you can't really test your code inside a normal browser or Javascript debugger.

HFX fucked around with this message at 03:36 on Mar 14, 2010

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply