Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » I'm actually going to finish something.

This thread is locked; no one can reply to it. rss feed Print
I'm actually going to finish something.
LennyLen
Member #5,313
December 2004
avatar

For the first time in a good decade or so, it looks like I'll actually complete a coding project that I've started. Getting paid for it has certainly helped motivate me, and the new anxiety meds I'm on are actually helping with my concentration issues.

It's not quite 100% complete yet, as there's still a couple of reports to finish, but since the client hasn't told me exactly what info they want reported, I can't write them yet, but all the code to do it is already in place.

It wasn't a huge project, but it's the first time I've tried writing a proper Windows application and it was less hassle than I expected, and I learnt a lot in the process.

I was going to write a tool to migrate data from the spreadsheet they were using, but it's so disorganized (wrong data in columns, variation in formatting, etc) that it's next to impossible, so they're going to hire a kid do enter the data manually.

The (more or less) finished product:

{"name":"611250","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/f\/cf966ae8f0c51860dc98e35be5be0a6a.png","w":767,"h":587,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/f\/cf966ae8f0c51860dc98e35be5be0a6a"}611250

{"name":"611251","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/e\/7e9f634e55ada30c710a38ae2db429a7.png","w":767,"h":588,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/e\/7e9f634e55ada30c710a38ae2db429a7"}611251

{"name":"611252","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/e\/3ebf29749d1ae9a3140a35a563edee33.png","w":767,"h":588,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/e\/3ebf29749d1ae9a3140a35a563edee33"}611252

Peter Hull
Member #1,136
March 2001

Well done! :D
Hopefully those aren't real patient details in your screenshots.
Pete

LennyLen
Member #5,313
December 2004
avatar

Hopefully those aren't real patient details in your screenshots.

All fake. I made up a sample database so I could test everything.

P.S. Can you tell I'm a programmer and not a designer? ;)

Neil Roy
Member #2,229
April 2002
avatar

Looks good!

---
“I love you too.” - last words of Wanda Roy

LennyLen
Member #5,313
December 2004
avatar

Neil Roy said:

Looks good!

Thanks.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Good job Lenny. That looks like quite a bit of work. I had a so-called Software Engineering class that used C# to build a tutoring scheduler program. Thing is we were just thrown a book on C# and told to code the program. Half the semester was spent on bogus UML modeling before we could even start. We had to learn C# totally on our own. I only really did the database stuff. My partners did all the UI Windows Forms stuff, so I still don't really know it.

Chris Katko
Member #1,881
January 2002
avatar

Quote:

I'm actually going to finish something.

FINALLY! I'm sick of filling in for your girlfriend.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

LennyLen
Member #5,313
December 2004
avatar

I'm sick of filling in for your girlfriend.

Ha ha. :p

Don't you mean "filling in for you with your girlfriend" though, streetwise you're saying that you're the receiver. ;)

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

LennyLen
Member #5,313
December 2004
avatar

That looks like quite a bit of work.

It was less than I was expecting in a way. One of the requirements from the client was that for the data to be stored in an Access database (they want to use it for mail merging as it's what they're familiar with) and I thought that getting data to and from Access might be problematic, but it's actually very easy. I didn't do it the best way (I'll be starting a new thread regarding that), but it still wasn't hard.

The trickiest part was keeping track of all the controls and events and making sure I didn't miss anything anywhere, oh and the UI design. I'm used to writing console applications.

If you ever need a pinch hitter, give me a call.

Ha.

I had to look up pinch hitter. We don't play baseball over here.

bamccaig
Member #7,536
July 2006
avatar

Nice work, Lenny. :) It's really quite easy to put together a simple forms application like that in .NET. I'm assuming it's .NET. The equivalent C++ would probably be horrendous. :D

When I first got my job (almost 12 years ago now?) I worked on an Access database that had forms built-in. Everything was coded using VBA, which was a neutered version of Visual Basic. Everything you thought you could do wasn't supported by the API... It was horrible. So thank your stars you're using whatever you're using. :D

Once I discovered the power of Unix-like command in college I became much more comfortable using them. I've spent the better part of a decade just creating simple Web forms for people to store data. There's very little actual logic involved aside from managing relationships between the data. This drives me crazy because given the chance I'm almost certain I could automate the forms using reflection in .NET (inspecting the structure of data types at run-time and generating forms to match).

I personally find that GUIs are a huge waste of resources, and Web forms aren't much better. The amount of work that goes into say adding a field or moving a field around is astronomical.

I want to experiment with using a simple text-editor for editing forms. The program would load the data, and based on the structure of the data output a form in plain text into a temporary file, and then load the file with a text editor. When the user exits the text editor the program would load in the text, parse the data inside of it based on the structure of the file that was generated (with special rules to understand multiline fields, etc., which the user would have to maintain while editing) and then save the result back.

Imagine if a record of data was loaded up into Vim in a multiline format. You could jump around to the interest fields, make edits, copy data to other files, etc. If you want to make a change you just edit the text in the appropriate place and save the file. Exit and boom, you're done. Want a new field? Just add it to the database or query or whatever. The program will see the new field and generate a new spot in the text file when viewing or editing the data. >:( >:( >:( No need for expensive GUIs at all.

GUIs work very well for graphical data (obviously). Unfortunately, the only good part is the graphics. The UI part of a GUI is usually shit. Every program should have an extensible command line to make the most efficient use of the machine<->human interface possible.

/rant

Good work, though, Lenny. It's still a lot of fun hacking on a GUI (unless somebody else wrote it or you haven't touched it in 6 months). :)

Samuel Henderson
Member #3,757
August 2003
avatar

Very cool. I assume this is a C# WinForms project? I make tons of these kinds of things ... but I'm being paid pretty well to do so. Also, mine work with SQL Server (or Sybase). Working with Access sounds awful, but that's based on bad experiences I've had with Access more than a decade ago.

Congratulations on finishing the project!

=================================================
Paul whoknows: Why is this thread still open?
Onewing: Because it is a pthread: a thread for me to pee on.

LennyLen
Member #5,313
December 2004
avatar

bamccaig said:

Nice work, Lenny. :) It's really quite easy to put together a simple forms application like that in .NET. I'm assuming it's .NET.

Thanks. Yeah, it's .net. I'm loving it. I can tell they've put a lot of thought into the framework. I keep writing helper functions only to find afterwards that there's already a function that does what I want.

Quote:

I personally find that GUIs are a huge waste of resources, and Web forms aren't much better. The amount of work that goes into say adding a field or moving a field around is astronomical.

Keeping track of all the fields and their even handlers was the biggest challenge. I started with a single interface, and then towards the end I switched it to a tabbed interface, which caused all my event handlers to stop working, and I had to manually tell VS which ones to use.

Very cool. Very cool. I assume this is a C# WinForms project?

Thanks. It is a C# WinForms project - my first one that isn't just a handful of lines of code.

Quote:

Working with Access sounds awful, but that's based on bad experiences I've had with Access more than a decade ago.

As far as I can tell, there's practically no difference between the two now, except that you use OleDbConnections and OleDbDataAdapters instead of SqlDbConnections and SqlDataAdapters. You use the same SQL queries for both and then treat the data the same once you've read it from the data source.

Update: For those who are into pointless metrics, it's 1,959 lines of code. ;)

bamccaig
Member #7,536
July 2006
avatar

LennyLen said:

I can tell they've put a lot of thought into the framework.

Not enough unfortunately. There are a lot of sore spots. Microsoft seemingly let several department contribute to it without communicating so there's a lot of redundancy and there are poor implementations using namespaces and names that should have been top-shelf instead. As a result, the ideal code to use is in a suboptimal namespace that you're less likely to discover. It's a long way from perfect, and once it's published because it's Microsoft it's set in stone and can never be fixed.

That said, compared to the relatively little competition they've done a decent job with most of it, and continue to improve upon it. It is certainly worth noticing and certainly worth working with. Some things it does really well. I do wish that they'd learn a bit more from the free software work, but I think that to some extent "waste" is part of the business equation so it might not be entirely by mistake that it's not ideal in a lot of cases.

LennyLen said:

I started with a single interface, and then towards the end I switched it to a tabbed interface, which caused all my event handlers to stop working, and I had to manually tell VS which ones to use.

Visual Studio is quite good at some things, but still in 2018 quite poor at others. It's rather sad, but I think it's somewhat by design. They want it to be good enough that you benefit from using it and therefore paying for it, but never so good that you never have to pay for it again. Welcome to the proprietary software business model.

LennyLen said:

As far as I can tell, there's practically no difference between the two now, except that you use OleDbConnections and OleDbDataAdapters instead of SqlDbConnections and SqlDataAdapters. You use the same SQL queries for both and then treat the data the same once you've read it from the data source.

Ideally you should be able to use the same code to communicate with any backend. That's a mistake on Microsoft's part. That said, communicating with Access is usually pretty particular. If the customer wants that I doubt they're very likely to every move up the scale unless their business grows and the money is there to rewrite everything anyway. It's still a shame though. It should all be abstracted to the point where you can move seemlessly between SQLite, Access, SQL Server, Oracle, MySQL, PosgreSQL, etc. The application doesn't need to know what it's talking to directly. It just needs glue between to communicate, and SQL that is standardized where possible so it works on everything [that's sane]. That said, I would bet that Access lacks a lot of even standard SQL functionality precisely for vendor lock-in and again forcing you to pay for new versions. The proprietary world is really terrible.

LennyLen
Member #5,313
December 2004
avatar

bamccaig said:

If the customer wants that I doubt they're very likely to every move up the scale unless their business grows and the money is there to rewrite everything anyway.

They're a charity with only a few hundred members, so that's pretty unlikely. Even if every person in NZ with Tourette's was a member, there'd only be a few thousand people. I wasn't even expecting to get paid to do this, it was just an added bonus on top of the opportunity to have a project to work on and learn with.

Go to: