Jump to content

David Schwartz

Members
  • Content Count

    1190
  • Joined

  • Last visited

  • Days Won

    24

Everything posted by David Schwartz

  1. I had a unit somewhere that let me stream basic Delphi object instances to and from an INI file, but now I can't seem to find it. Google is turning up stuff from 2009. The newer RTTI stuff is a lot simpler. Can anybody point me to something that uses the latest RTTI stuff?
  2. David Schwartz

    Can an app beat a spreadsheet?

    Exactly!
  3. As I said, I've got code that uses the old RTTI methods introduced in D2010. I'm looking for something that uses the newer RTTI methods. Not an entirely different approach. They're simple classes with no embedded objects, but there are some enums.
  4. They're fairly simple data objects derived from TObject, not from TComponent. I could derive from TComponent instead, but it buys me lots of overhead with little if any value.
  5. I don't need to. As I said, "... stream basic Delphi object instances ..." I can already handle stringlists easily, and arrays of basic types should be easy to handle anyway, although I don't have any at this point. I will have collections of objects, but I'll deal with them one-by-one.
  6. David Schwartz

    Can an app beat a spreadsheet?

    MS Money competed with Quicken and QuickBooks; surprisingly, this is one area where MS was unable to conquer a market. I used QB for years. It was helpful come tax time for dealing with historical data, but it didn't really help me manage my cashflow at all.
  7. David Schwartz

    Can an app beat a spreadsheet?

    I agree. In this case, I started out using Excel for lack of anything better. I wasn't sure what I was after exactly, just a way to forecast upcoming payments against my income. It looks like I started in mid-2014. It has evolved somewhat. It doesn't do any real analysis, it's more like a consolidated report of all my income and recurring (or expected) expenses. Kind of like a dashboard. I hardly even pay attention to the income side now; it's the expenses I'm most concerned with paying on-time. I tried a couple of services that display all of your different account activities in one place, but I found that to be pretty much useless. Everything I've seen presents historical data. They're like watching things in your rear-view mirror. That does not help avoid bouncing checks or making late payments that result in late fees, in the future. Given delays that are inherint in various payment channels, by the time you notice something show up, it's too late to do anything about it. That's the biggest complaint I hear from people. Maybe folks in other countries relate to their finances differently, but we here in America aren't very good with basic math like that. As far as passing out the spreadsheet for people to play with and give feedback ... I think it would be far easier to support an app. So maybe that answers my question. 🙂 With an app, I imagine that people will have ideas that relate more to their financies rather than how to improve how the spreadsheet works.
  8. David Schwartz

    Can an app beat a spreadsheet?

    Yeah, well ... it's basic personal finance -- tracking periodic / recurring income and expenses in a meaningful way. I could probably do what I need with a TListView since the calcs are mostly additions and subtractions of two cells, or sums of several cells. As I said, it would be nice to be able to highlight certain cells based on simple formulas. In spreadsheets, that would be done with Conditional Macros, which are not universally supported. In Delphi it's quite simple.
  9. I've been building this "workbench" app of sorts (for lack of a better term for it) that has some contextual stuff at the top, a block at the left that shows files, and a big chunk of overlaid stuff that's in a tabbed notebook with a few levels of sub-notebooks below some of the main tabs. It's designed to simplify a very haphazard and unorganized process where you need to switch between a half-dozen different apps to do things. (I know lots of people detest such designs, but let's not go down that path, ok?) The tabsheets have controls on them, and behind each list/tree control are 5-10 methods, some of which are event handlers for the control. Delphi's IDE doesn't really help with organizing them, and in fact sorts everything alphabetically when it has the chance. I've looked at lots of code over the years, and I've seen most of the same 3 patterns: (1) all the methods are ordered alphabetically by name; (2) they're ordered by function; (3) they're ordered in a way that clusters the methods around a common control (so all the methods for a given treeview are all nearby each other). Today I decided to add a grouping mechanism for something using a TTreeView on a new tab. This has buttons to Add main items (Level=0); Add and remove sub-items (Level=1); Edit text associated with the sub-items; Save/Load to/from storage (INI files); Save/Load to/from the TreeView; and some other minor stuff. (As an aside, I need to save additional data in each of the top-level items, and discovered the use of OnCreateNodeClass in TTreeView (or at least RzTreeView). They're sort of like class helpers, but they let you add data to the storage items.) Anyway, I'm trying to figure out if there's any sane way to collect these related methods together and manage them as a group? I know about Delphi's form templates, but most of the things on this form only have one instance. It's not like there are several of the same things, as there aren't. I wish I could pull this related code into a separate unit, but the damn event handlers make that problematic since they pretty much need to be in the same unit as the form class, unless you set them all up as proxies. Splittiing things into an MVC or MVVM design breaks things along what occur to me as odd lines. I'm curious what approaches others may have taken to address this in larger form units.
  10. David Schwartz

    ways to organize related code in a form?

    Let me clarify this... I don't want to work in the same conditions I've been working in for the past 25 years where I'm mostly maintaining legacy apps. I do want to keep working, but at a level better suited for my natural skills. I'm very creative by nature. My mind easily handles "big picture" concepts and I'm not good at reading code to reverse-engineer it just to fix some weird bug someone made 15-20 years ago. It bores the hell out of me. BTW, I've heard this is common for people with Asperger's. I've heard managers say, "Everybody [ie., all programmers] love working on new code! Of course! But most of what we have is not that. So just do what's here to do and don't complain!" That has not been my experience, but I'm not really in a position to argue it. What I can say is this: First, some people are far better at reading code and absorbing it into their head like a sponge. I've known several who, after a few minutes flipping page to page, they challenge you to ask them anything and they can find it in a minute or so. I'm no good at that until I reach the point where I've spent so much time pouring over the code that I know it as if I wrote it myself. And if I don't keep swimming around in it, those details fade pretty quickly. Second, I have met very few people who have the mental ability to deal with high-level abstractions on any kind of scale. I've come to believe that software architecture is more dependent on innate mental abilities than anything you can learn. This is something I've always been great at, but not something most employers have ever cared about. They want low-level coders who can find needles in haystacks by reading through reams of code that's been running for 10-20 years. I don't say any of this as a judgment -- some people are naturals at writing fiction stories, and others can barely write an entry in a diary. Some people are great at math and working with numbers in their head, and others struggle to add 2+2. It's just how their mind works. If you need someone who's great in math, you don't just assume everybody is equally skilled in math just because they made it through college. Why do people think all programmers have the same level of skills, from lowest-level to highest? It's silly to me, and very counter-productive in reality. One thing I struggle with is generics, recursive algorithms, and pretty much anything that has a layer of "meta-coding" to it. I don't know why, it's just the only place I've ever had trouble grasping computational concepts. Everybody has some innate skills where they're really great, and others that constantly challenge them. That's not to say that with enough practice and work you cannot overcome some of those barriers, but they just show up along the way and many folks simply avoid them. It reminds me of the 80's when C++ and OOP were just getting going. A rule of thumb was that experienced C programmers would take 6-9 months before their thinking shifted and "OOP thinking" became a natural thing. It took me about 7 months, and that shift happened in an instant one day. Poof! Suddenly I looked at programming differently. It was a very noticeable and mind-altering event. Anyway, this is stuff I've been aware of for years, and have fought against my whole career. But I'm feeling reenergized now that there may actually be a specific thing that can be pointed to that people who literally cannot get inside my head to observe how I think can use to realize that maybe these things that have been assumed to be "universal skills" really are not. This situation presents some interesting opportunities.
  11. David Schwartz

    RichEdit Popup question

    I've always used TRichView when I've needed RichEdit stuff, but where I'm at now doesn't have it, so I'm using TRzRichEdit, which is derived from the standard TRichEdit control. So I apologize in advance if this seems like a basic topic. I have some RichEdits and added a Popup to them. I multiplex the popup across the RichEdits and set a Tag to figure out which one is being used. I know both TMemos and TRichEdits have basic editing stuff wired-in -- cut, copy, paste, etc. I seem to recall that if you don't provide your own Popup, then you get a default with those menu items in it. Anyway, I did not define these common actions and only had my own menu items in the popup. As a result, you CAN use the hotkeys <ctrl-C>, <ctrl-X>, <ctrl-V> etc, but there are no corresponding menu items in the popup. I just added them to the popup explicitly, but now the hot-keys don't work. I defined the hot-keys in the popup menu items, but that doesn't seem to do anything (unless they're disabling the hot-keys instead).  Isn't there some way to inherit all of this from the default popup menu? Or ... how do you get these default actions added to your own popup menu without redefining them?
  12. David Schwartz

    ways to organize related code in a form?

    I've heard people ask me why I'm "so different" all my life. "Why can't you just go with the flow" or "be more flexible" or ... whatever. I don't know why people think that. But TBH, I'm a lot more tolerant of personal differences today than I was in my youth. If the past 5 years of American politics has done anything, it has shown how lazy so many Americans are and how willing they are to turn their minds over to others. Critical thinking seems to be a lost skill here among about 1/3 of our population. Maybe it has always been missing, but the past 5 years have certainly made it visible. Anyway, this is actually getting me kind of excited in a strange way. I've had lots of bosses and work colleagues who have all formed similar opinions of me throughout my life, which tells me they've all got similar expectations about how people are supposed to be and act "normally". Now I have a reason or excuse to offer that gives them permission to relax their expectations and readjust how they look at me. I do that naturally because I see everybody differently anyway. It took me a while to realize that most people do NOT think that way! The more exciting thing is this: To me, everybody has their own unique strengths and weaknesses. I've certainly got mine. But managers in this field (if not in general) tend to think that "all programmers are equally skilled for all tasks". This is utter bullshit, and I've seen it lead to an unbelievable amount of mistakes and shoddy work. Most people are happy to have a job and won't speak up. I do, but it doesn't really accomplish anything -- this attitude is very hard to crack. But now it looks like I have some leverage to use to make a viable case that I REALLY DON'T "fit the mold" that their expectations are based on. Managers everywhere will stand up and beat their chests shouting about how they're willing to do anything to support their people and help them be as productive as possible. It's all a show. Maybe one or two whom they've known for a while, but not the entire team. Especially the newbies. You've got to learn to "fit in" first. For some of us, that's a non-starter. We know it, but if we mentioned it up-front, we'd never get hired. But you know what? When you mention you have been diagnosed with something, and there's a law that says they actually have to do what they like to shout about in public to accomodate it, their tune changes. (I don't have personal experience with this, but I've had several friends who've told me about their own experiences.) It totally sucks that these folks simply don't do what they like to say they're committed to doing, and it takes the weight of potential legal action to get them to really do that. But ... should I really care? There are programming things I'm really good at, and things I really suck at. They don't want to hear it because their overarching belief system is we're all equally skilled. Except now I will have a standardized diagnosis from some outside authorities who SAY IT AIN'T SO for me. WOO-HOO! It makes me wish I had another 20-30 years to work just to see where this could lead. 🙂
  13. David Schwartz

    RichEdit Popup question

    Ok, assigning the popup menu in the Enter/Exit events made me go DUH! Yeah, it's a lot easier than what I did with tags. But all of the boilerplate code for the menu items and actions is already defined somewhere. I mean ... it's there by default if you don't override the PopupMenu. Isn't there some way to "inherit" it?
  14. David Schwartz

    ways to organize related code in a form?

    for sure! 🙂 Luckily it's a genetic neurological disorder that comes at birth and does not "develop". It actually sort of "mellows out" (in a manner of speaking) over time as one develops compensatory behaviors. It's most noticeable in youth. This whole thing got started last year when I was talking with my sister who has a couple of daughters who the school regards as "special needs". (This is America where anything outside of "normal" is regarded as "broken" or "faulty" in some respect.) One kid was diagnosed with ADD / ADHD and the other was diagnosed with two forms of dyslexia. Both have genius-level IQs so it's clearly not innate abilities. I mentioned that if they knew what these things were back when I was in school, they probably would have diagnosed me with ADD and/or ADHD. My sister replied, "No, they probably would have diagnosed you with Aspurger's, You have classic symptoms." I wasn't sure what to make of that. I've been poking around the edges of it for the past year or so and started looking more closely over the past few months. Frankly, I'm amazed at how dead-on some of the recognized symptoms are at identifying things I've encountered throughout my life that up until now had no explanation. They have always look like random things and no particular pattern. But given this context, I can actually see a very clear and consistent pattern. The main reason I'm even bothering to discuss this here is because I've run into lots of programmers over the years who, in retrospect, probably have undiagnosed Asperger's as well. It's considered a "disability", now defined as an "Autistic Spectrum Disorder". They don't test so-called "high-functioning" people for that, although I don't know what might happen today now that they know all this stuff. But it seems that the same cross-wiring that results in odd behavioral issues also makes those with Aspurger's particularly well-suited for programming and engineering jobs, as well as patent lawyers and certain roles in medical research. I did work with a guy once who has Tourette's. His whole family had it and they were all part of some long-term study. Today he's the director of a bioinformatics lab doing genetic and genomic research.
  15. David Schwartz

    ways to organize related code in a form?

    Maybe this helps: "Because they are not good at looking at things from the listener’s point of view and considering what type of information would help explain a point, their conversations often are disjointed and lack logical or meaningful connections. They tend to ramble on, go off on tangents, or not focus on any particular point. What drives the way they talk is what they are focused on, what they are interested in rather than what holds the attention of whoever they are conversing with. In one-on-one conversations and in groups, they stand out as disorganized, jumbled and confused due to the mismatch between what they want to say and the topic at hand. "A frequent reaction of someone conversing with an adult who has Asperger’s is to experience the person as thinking out loud to themselves, rather than trying to have a mutual conversation. Whatever comes to mind is said out loud." Roberson, Kenneth. Adult Asperger's Syndrome: The Essential Guide This is something I've been learning about myself over the past year. It explains a lot of ways people have regarded me since I was very young. This is just a small part of it. Thanks for noticing.
  16. David Schwartz

    Updated Community Edition

    Well, yes, that's obviously from my own perspective. I've worked on about a dozen different projects over the past 15 years, give or take. They were all written in the D4-D7 days, and none of them used newer features of the language, RTL, or the newer stuff added to the Ent. Ed. b/c they only used the Pro Ed. None of the devs I've worked with over the years showed any interest in Delphi oustide of work, and they were mostly unaware of newer features. They did their work and went home. Most of the excitement I'm seeing online comes from places like Brazil and Belgium. The jobs I hear about are all the same -- maintaining 10-15 yo code bases with minimal new development going on. The last three places have gotten increasingly militant against cleaning up / refactoring old code. The current place has flatly forbidden me from touching anything even though things are broken, customers are complaining, the Exec Team is pissed off, and the Dev mgr is trying to figure out ways to fix stuff other than touching the code. Go figure. It makes no sense to me. It's nice to know there are a few of y'all who are actually creating new stuff and using the latest language features. That's why I like hanging out here. 🙂
  17. David Schwartz

    ways to organize related code in a form?

    Pepto-Bismol might help with that...
  18. David Schwartz

    Updated Community Edition

    The most in-demand jobs today are pretty much tied to languages and platforms that are all free. People who have jobs in the Delphi world use the tools that their employers provide them. All of the jobs I've had used the Professional Edition. Virtually all of them could be back-ported to D7 with very few problems because that's where they came from, and nobody added anything newer to the code except for the occasional properties added to things like stringlists and whatnot. I have made a practice of keeping my own license current for most of the past several years (while I could afford it) but I have not met anybody I've worked with who was a Delphi dev who had their own license. When I'd ask, they'd ask me "Why should I?" At some point the price would come up and they'd say that most jobs are using older versions, or at least evolved from older versions and don't use newer stuff, so having the latest version is really a non-issue except for certain libraries that need it. The place I'm working at now hired me in January as a Delphi expert because the guy who had been maintaining their code for the past decade left the prior October. My second day, I was told, "DO NOT TOUCH ANY OF THE PRODUCTION CODE!" That has been repeated verbally and in writing many time since. The guy before me started looking into moving to D10.3 but never made the shift even though the company maintains their maintenance agreements and gets the updates. We're still on 10.2.3. Another guy was doing some Delphi work, and we were asked by management if there was any good reason to move up to 10.3, and we both said, "Nope" and that was that. I honestly don't know why they hired me. There are plenty of problems with their software, but they refuse to let me touch any of it. I'm pretty confident they could roll it all back to D2010 and it would compile without any problems. (They use a few generics classes here and there.) All this to say, if Embt has a marketing strategy for growing the market for Delphi other than encouraging existing customers to keep their maintenance agreements up-to-date, I don't know what it is. They raise the price of the maintenance 4% annually, keep trying to push people to upgrade for a bunch of features nobody's using, and I've never seen more than a dozen Delphi jobs listed on job boards in years -- and many of them are for the same positions by different agencies. (Most of whom are run by east Indians who almost always end up saying the client is not able to pay more than $20/hr for someone with 10+ years of experience -- telling me they're running a H-1B scam to justify hiring their buddies from back home.)
  19. David Schwartz

    ways to organize related code in a form?

    Yeah, that probably fits. I did not, and ... I work and live alone, so I get to spend plenty of time conversing with Google. This place is sort of like a virtual "water cooler" for me where I can discuss stuff with people that I can't really discuss with anybody else. Yes, sometimes the internal monologue leaks out. I happen to enjoy reading what people have to say when that happens since I don't get to talk with many folks at all about any of this IRL. Sorry, sometimes I do tend to ramble.
  20. David Schwartz

    ways to organize related code in a form?

    Ok, gotcha. The main form has a bunch of context, or current state data displayed. I guess I could pass in what's needed to the form. But some of the tabs also update current state. So I guess I'd need to accommodate that. That's what I was thinking of when I said what I said.
  21. David Schwartz

    ways to organize related code in a form?

    Sorry, not sure what you're referring to here. Regardless, I reserve the right to utter nonsense from time to time. 🙂
  22. David Schwartz

    ways to organize related code in a form?

    Nah, it would take too many of them, and a lot of explaining. This one I'm thinking of is a collection of steps that I found myself doing repeatedly that I figured out how to collect into a single app. It started out as what one might consider enhancements to the File Explorer. We keep flipping between open files and clicking a few things, copying from here and pasting there, opening a file in one app, then finding the file it output and opening it in another app, then previewing its output file(s) and saving them somewhere else. It's a very well-defined process in most respects, and this tool provides access to "next steps" in a couple of mouse clicks without having to sift through open windows stacked on top of each other on the desktop. Later I integrated a bunch of common git functions into it, to help keep our work in sync with git. Git GUIs know about git, but not about our files and how we work with them. This tool makes git follow our overall process without us having to think much about it, which is super helpful because it has been biting us in the ass left and right. We need to be focusing on our tasks at hand, not dealing with the peculiar ways git manages things. Now it's got nearly 10 tabs that help us deal with different tasks. One is a Search panel similar to grep that looks through files in a project with certain extensions. I was using an external search tool for this, but always the same few variations, so I just added a tab with those actions on it. Another is a tab for notes, and it now has 5 sub-tabs that offer different perspectives on how we invariably have to approach our work. This is very unique to our workflow. I put RichEdits on them so we can highlight text, change font characteristics, etc. Everybody has a different way of taking and organizing notes, and most of the time we sound like the parable of the blind men eating an elephant. We're all working on the same processes, but our perspectives are all very different. Sometimes someone else will have run into something you just ran into, and they may have made a note of it themselves, but nobody has access to each other's notes. We talk in our daily meeting, but this is an effort to get some meaningful structure on our work. For example, we just had a big production mess occur where we had some older logo files suddenly show up on a bunch of invoices that got printed and mailed out. People were blaming git and this and that, then someone happened to ask if there were hyphens or underscores in the logo filenames. Another guy said, yes, but there were some that had both abc_123.png as well as abc-123.png. That sounded familiar, and I dug through my notes and found one I made where I discovered that one of the production tools automatically changes underscores to hyphens. And wouldn't you know ... those hyphenated files were the ones that were "old" and were used on these invoices instead of the ones with underscores! For nearly a decade there was ONE GUY who was doing most of this work, and he has all of this knowledge stashed away in his head. He's gone and now there are four of us eating this elephant and arguing over what parts we're dealing with while nobody is seeing the bigger picture. As I mentioned above, one tab was added just for helping with git. It has several sub-tabs for different git processes. Everything is done with mouse-clicks to avoid typos. One implements our entire "check-in process" (promote to master?) step-by-step. As an aside, I ran into a bug with git where it looks like branch names in git are generally not case-sensitive. But in this case, something in how git was responding to a command showed it was treating a branch name WITH CASE-SENSITIVITY. I discovered it because I made one character in a drop-down list lower-case instead of upper-case, and in certain cases the code acted like it was not a known branch name. I'm still unclear if this is due to submitting the commands via Windows API or if it's a bug in certain git calls. Two others apps are much simpler. They're more of a collection of steps that you might see in a typical Unix script, but in this case we have to launch Windows apps and click a few things. Ironically, these are all parts of a completely automated process, but these versions of the tools cannot be automated. (I'm still trying to figure out how to use the production versions, but they seem to be controlled by another process through some connections that we cannot touch outside of the production network.) My overall goal is to reduce as much of our processing to mouse clicks within highly contextualized displays as possible. It's not the "mouse clicks" part that's new, it's how everything is organized. Most of our processes involve between 3 and 8 different windows apps at the same time. Here I'm either bringing the relevant data into the same app, or popping up another app right when it's needed, then you can close it and proceed.
  23. David Schwartz

    ways to organize related code in a form?

    I've considered that, but it seems like it would result in a bunch of circular references between the main form and the embedded forms that need to access state data on the main form, especially things the embedded forms manage.
  24. David Schwartz

    ways to organize related code in a form?

    For the past decade or so, I've worked remotely mostly maintaining some apps written originally in D4-D7 that have hardly changed. The current place I work has an over-engineered platform that might have made sense back in 2003, but today it looks pretty ancient. Another thing they've all had in common is that refactoring has been made verboten. The second day on this present job I was told "do not touch any of the production code except these things that need to be updated for specific customer tickets." I've been reminded many times in both writing (general warnings to all devs) and verbally in meetings. I get hired as a supposed "Delphi expert" and then they put me in a straight-jacket and only take it off long enough to replace a screw or nail or tighten-down a loose bolt here and there. That is to say, I have not had much opportunity to see substantial apps written to more contemporary paradigms. I'm curious if apps people write today still end up being structured like they were back in the D4-7 days. I see that due to interesting innovations in the C#/.NET platform, things there can be structured much differently than Delphi. I don't suspect the Delphi language gods will ever bring it up to contemporary standards, let alone keep up, since they seem to have a pretty stubborn allergy to anything that's different from what was in D7, with a few exceptions introduced with D2010 and XE. Things like triadic expressions have a hyper-localized impact. But there are a few things in C# that could substantially alter how our apps are structured if they were adopted. (I'm not holding my breath.) But the folks who hang out here are a quite innovative lot, and I figure if anybody might have figured out some interesting approaches since 2005, maybe there's something useful to share. (I did some work for Boian Mitov a few years back, and the way he structures his code is pretty eye-opening in many ways. It's nothing like what I've ever seen anywhere I've worked maintaining legacy Windows apps. Granted, it's mostly library code, so it's not going to be confined to the boundaries of a typical Delphi Windows app. But still, using his libs in a regular app does result in code with a distinctively different look and feel from most typical code.)
  25. The WebCore folks used their import tool to translate several non-visual JS libs / APIs into Delphi, and they're included as part of the release. I've been trying to work with the Web Audio API, and not having much luck. Most of the classes are derived from TObject, and a few from TJSObject. None of the ones derived from TObject have a Constructor (.Create) method, while the classes based on TJSObject don't have a .new method. I don't know how the compiler doesn't find a Create method on objects derived from TObject, but it throws these errors saying it's just not there. So there's no obvious way to create instances of anything. I'm guessing this may be related to their import tool rather than this specific library. Has anybody had any luck working with this or any of the JS libs / APIs that are included?
×