Recent

Author Topic: TP legacy shiitcode  (Read 10535 times)

Joanna

  • Hero Member
  • *****
  • Posts: 1414
Re: TP legacy shiitcode
« Reply #30 on: May 03, 2024, 08:04:42 pm »
@handoko I don’t know if this is true for other people but it took me quite a long time to get from placing gui controls directly on form to making custom controls created at runtime.

It took a lot practice to understand how things worked enough to be comfortable with them. I was not capable of creating custom controls then an would probably have become very confused if I had tried. It took many iterations of practice to work up to it.

As for the politics discussion. Politicians are performers in a puppet show. Does it make sense to worry about the antics of puppets? It’s the same people controlling all the puppets in the show.

The purpose of the puppets is to manipulate and control people.
« Last Edit: May 03, 2024, 08:09:06 pm by Joanna »

440bx

  • Hero Member
  • *****
  • Posts: 6023
Re: TP legacy shiitcode
« Reply #31 on: May 03, 2024, 08:10:38 pm »
Please, 440bx: that really isn't necessary.
I beg to differ.  It is _very_ necessary.  Tolerance for that kind of behavior promotes its furtherance.  It must be condemned early, continuously and decisively.  Make it crystal clear, it is _unacceptable_ in all circumstances.

FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 18695
  • To Europe: simply sell USA bonds: dollar collapses
Re: TP legacy shiitcode
« Reply #32 on: May 03, 2024, 08:32:13 pm »
I tend to agree, but you could have made a stronger case.
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

alpine

  • Hero Member
  • *****
  • Posts: 1412
Re: TP legacy shiitcode
« Reply #33 on: May 03, 2024, 09:41:07 pm »
In an attempt to return the discussion to the original topic, I want to backup Thaddy for the bad habit of components overusing.

Long ago there was a joke how programmers approach to a specific problem, I can't remember all of it, but:
  • The Java programmer writes a class hierarchy 15-levels deep
  • The Delphi programmer directly goes to the Delphi forum and searches for a component which solves the problem
  • etc.

Nowadays, the ChatGPT is on the way to replace them all.
 
IMHO the Visual/RAD/Component programming is just great for making simple instances of UI, any attempt to make something more sophisticated as Database form (inherently complex, Btw) leads to a big mess of intertwined event handlers, indirect recursions, and quite obfuscated source code. The way the GUI's work, makes the common (programmer) logic hard to apply, multi-threading becomes even harder, not to mention the headache when you want to reuse an otherwise working component in a non-gui app eg. windows service.

There is no reason for most of the components to be like this, in fact they are components just to be displayed on the palette.

"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

MarkMLl

  • Hero Member
  • *****
  • Posts: 8525
Re: TP legacy shiitcode
« Reply #34 on: May 04, 2024, 11:18:33 am »
In an attempt to return the discussion to the original topic, I want to backup Thaddy for the bad habit of components overusing.

I agree, but "the other guy started it" :-)

Overuse of "drag and drop" components goes back to the late 80s or early 90s when VB was introduced, since the application language (i.e. Visual Basic itself) lacked the facilities to do system-level programming. As such, it made sense to wrap anything written in C++ using a convenient abstraction which allowed its startup properties to be set easily and the application level.

I am not entirely convinced that having both high- and low-level programming abstractions in the same language is a good thing. At the very least, there should be some provision for segregating them into different units, and possibly- at least at the enterprise level- there should be some provision for lower-level code to be signed off by an experienced developer.

For example, there are cases where pointers- and even pointer arithmetic- are unavoidable, e.g. when interfacing to a C etc. library. But Delphi/FPC really doesn't need them exposed at the application level, and hiding them from inexperienced users would eliminate frequently-encountered rookie mistakes.

I do not agree with Joanna's blanket assertion that components are better instantiated onto the form under runtime control. But I think her case would be stronger if it were limited to non-GUI components, provided that properties were in all cases handled intelligently by the IDE.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

lainz

  • Hero Member
  • *****
  • Posts: 4740
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: TP legacy shiitcode
« Reply #35 on: May 04, 2024, 07:50:30 pm »
I use components and is not an overuse. Is like a easy to work solution. Without instancing, free and assigning events with code. Also the data can be added.

For example why instancing Json Storage if the editor provides an easy way to handle all the keys and events like on restore and on save?

It saves time and prevents memory leaks.

Another use is the dialogs for file open and file save.. Folder open as well.

It's my opinion and I will not change it. Feel free to quote me if you want :P

VisualLab

  • Hero Member
  • *****
  • Posts: 707
Re: TP legacy shiitcode
« Reply #36 on: May 04, 2024, 08:44:09 pm »
The problem is that the leaders of countries (large organizations) are usually dishonest people (e.g. Trump, Obama, von Leyen) and sometimes even scoundrels (Lenin). The source of their political success seems to be a combination of these nasty traits.
As a Political Scientist (M.sc, two other minor degrees, B.sc's, in different fields) I beg to differ with your opinion of Lenin. The problem for politicians is that they need to make choices between what is in their opinion achievable and what is desirable.
That doesn't mean he still comes fifth in my order, because disowning a lot of average people and the murder of Trotsky happened under his watch.

But Trotsky was not an innocent victim of Lenin (like many ordinary people. His death was the result of internal power struggles (this always happens in a group of thugs). A similar event occurred in Germany: Hitler vs. Röhm.

So my proposed order is from high to low and just for the America's and Europe: Hitler, Stalin, Putin, Trump, Lenin, Bush jr, Obama, von der Leyen. I left out many other possibilities from this set, including a Dutch politician who did not understand the Indonesian people and is actually a never prosecuted war criminal. Schermerhorn. He would have scored above Lenin maybe slightly lower.

The difference between Lenin, Stalin, Hitler (1st group) and Trump, Obama, von Leyen (2nd group) is quite simple. The former created rogue regimes and committed monstrous crimes (crimes beyond scale). The latter operated within the existing legal systems (de facto: democratic). They committed (depending on the specific person): financial fraud, nepotism, bribery, embezzlement of public money and the like.

As for Putin (an obvious criminal) - maybe he would like to be like Stalin. So far he has not succeeded. And I hope he doesn't achieve it.

Thing is that Lenin handled out of a firm belief in the ideology of Karl Marx and not in his own interest. By contrast to Benjamin Netanyahu or Trump, who handle just in their own interest to avoid jail. Based on that evidence I am quite comfortable ranking Lenin way lower than you do.

Perhaps he was guided by such faith at the beginning of his activity. His biography shows that he later tried to be more pragmatic (e.g. NEP). Which in no way justifies his crimes. What does Netanyahu have to do with it?



Some things in life are genuinely amazing, like a comparison where an individual as vile and despicable as Hitler can be shown to have positive characteristics.

It depends on what someone considers a positive trait. For some it may be positive and for others it may be completely negative. Perhaps he was less degenerate in his childhood and youth.

There exists an orange ball of incompetence, insecurity, intellectual mediocrity dipped in cholesterol that is hands down as vile and despicable as Hitler but, can do him one better because Hitler, unlike the orange messiah, wasn't a bone-spurred coward.

Hitler never founded a "university" to con his fellow citizens out of their money.  If it wasn't defunct, the orange university could, for an additional $560.00 throw in a Bible and a gold pair of sneakers with an advanced degree in infinite stupidity... what a deal !!.

How can you equate a shoddy fraud (Trump) with a criminal (Hitler)? It's just paranoia.

But, got to really be impressed by the attempt to draw a parallel between that repugnant orange biped and other individuals who, while not perfect, have never exhibited the appalling lack of moral and ethics of the individual they are being, conveniently and self-servingly, compared to.

All three people (Trump, Obama, von Leyen) demonstrated typical traits of high-profile politicians: fraud, manipulation, nepotism, embezzlement of public money and silencing these matters when journalists tried to publicize them. Only Trump was hauled into court. The other two people have a "political umbrella". Obama is "resting" after the "hardships" of his rule. And the last one was to be rewarded with a new, lucrative position in NATO.

Conclusion: there are problems a lot worse than sh*tty code that doesn't compile.

Yes, I agree on this one point.
« Last Edit: May 04, 2024, 08:51:01 pm by VisualLab »

VisualLab

  • Hero Member
  • *****
  • Posts: 707
Re: TP legacy shiitcode
« Reply #37 on: May 04, 2024, 09:20:32 pm »
IMHO the Visual/RAD/Component programming is just great for making simple instances of UI, any attempt to make something more sophisticated as Database form (inherently complex, Btw) leads to a big mess of intertwined event handlers, indirect recursions, and quite obfuscated source code. The way the GUI's work, makes the common (programmer) logic hard to apply, multi-threading becomes even harder, not to mention the headache when you want to reuse an otherwise working component in a non-gui app eg. windows service.

I do not agree with Joanna's blanket assertion that components are better instantiated onto the form under runtime control. But I think her case would be stronger if it were limited to non-GUI components, provided that properties were in all cases handled intelligently by the IDE.

I use components and is not an overuse. Is like a easy to work solution. Without instancing, free and assigning events with code. Also the data can be added.

For example why instancing Json Storage if the editor provides an easy way to handle all the keys and events like on restore and on save?

It saves time and prevents memory leaks.

Another use is the dialogs for file open and file save.. Folder open as well.

I guess you all are right. It probably depends on the specific situation.

The graphical application design mode (form, data module, components and object inspector) is very convenient. Probably because you can "feel the object in your hand" (component), treat it as an object that can be conveniently and quickly inspected, and that can be easily manipulated, because the object inspector allows it. This is probably the "magic" of the form designer.

In the case of large applications, using a significant number of non-visual components (derived from TComponent, but below TControl) requires a lot of time, patience and attention when designing and then when implementing event handlers. When you need to connect hundreds of smaller components across multiple windows (forms) and program their events, it starts to become time-consuming, cumbersome and complicated. And then you can go back to the classic implementation of classes.

I don't think there is one right way to create software. RAD really speeds up GUI creation. It can also be helpful when developing the rest of the application, but this is not so obvious. Some general guidelines may be helpful. But your own experience is also very important, and what kind of program someone creates, what form it should take (GUI, OS service, console). Simply put, everyone has to develop their own methods and habits and choose the tools for work.

Joanna

  • Hero Member
  • *****
  • Posts: 1414
Re: TP legacy shiitcode
« Reply #38 on: May 04, 2024, 11:02:02 pm »
RAD is good for creating simple things. Just because I don’t use it much anymore doesn’t mean it shouldn’t be used. I think mark misunderstood me. Before I switched to custom componets I was using RAD in frames for reusable code.

As for the political discussion above I believe that there is an alternative explanation about Hitler. He was not an amazing evil man, he was just a tool of Anglo American industrialists who was brought into power in a country that was really messed up after ww1.
The nasty deeds of the Nazis were inspired by eugenics programs which  were already happening in the US. The germans didn’t invent these ideas.

WW1 was instigated by the British to stop the Prussians from becoming too powerful. They did a blockade of Prussia to force it into the war. The US did extensive propaganda of babies on bayonets to get the gullible public to support the war and a “temporary” income tax.
Isn’t it funny how stories about “babies being hurt” are used to get wars started which cause the deaths of many thousands of babies that would have otherwise lived. It seems to work every time.

Also what about Hitlers ally japan? Japan was a peaceful Isolationist nation minding its own business until the Anglo American interests put an end to that and forced their way in there using the pretext that “Shipwrecked sailors from whaling ships were being mistreated “ what gave them the right to steal whales from the ocean next to japan to begin with? Greed knows no bounds.. nothing will ever change.

After that , Japan was used as a tool to fight russia and continues to be used as a tool to this day. Japan was forced into war using a naval blockade just like Prussia.
« Last Edit: May 04, 2024, 11:17:18 pm by Joanna »

440bx

  • Hero Member
  • *****
  • Posts: 6023
Re: TP legacy shiitcode
« Reply #39 on: May 04, 2024, 11:12:06 pm »
Apologies to forum readers for the off-topic post but, some things cannot go unchallenged.

It depends on what someone considers a positive trait. For some it may be positive and for others it may be completely negative.
The majority of people I know and many who I don't know consider _not_ being a coward a positive trait. They also consider being dishonest, deceitful, incompetent, a cheater, and a liar highly undesirable character traits which are not only present in that vile individual you are protecting but he has taken to levels rarely seen in history.

How can you equate a shoddy fraud (Trump) with a criminal (Hitler)? It's just paranoia.
I'm really pleased you asked that question... that vile human being you are making excuses for is responsible for, among other despicable actions, separating kids from their parents.   To this day, there are some kids who are yet to be re-united with their parents.  The only reason that vile and despicable blob of malevolent incompetence isn't a mass murderer is because there were a few people around him who prevented him from "expressing himself".  Of course, it's likely you don't "remember" the orange bone-spurs hero "suggesting" that protesters in Lafayette square be shot... "Can't you just shoot them? Just shoot them in the legs or something?"... of course, it was all for a "good cause", namely holding the Bible upside down.   Without decent people around keeping that vile blob of orange malevolence in check, the result is Jan 6 and, good people died while your hero did _absolutely_ nothing to protect the human beings in the Capitol.   That vile orange ball of malevolent mediocrity is a Hitler wannabe and, the worst part is, he might get there with a little help from his "friends" who pretend he is a "comparatively" decent person who, of course, should never be compared to Hitler.

OTH, you might have a point that comparing that orange ball of mediocrity and incompetence to Hitler is inappropriate.  Hitler, as vile and despicable as he was did quite a job re-invigorating the German economy.  The vile orange ball of mediocrity grew the national debt from about 84% of GDP to about 130% of GDP in 4 years.    In 4 years he grew the debt by close to 50% of what the country had accumulated in its entire history.  I have to admit... quite a feat of mediocrity and incompetence.  Hitler did many times better than that and, that is _not_ a claim I make, it's a historical fact.  Economically, the comparison is an insult to Hitler, morally and ethically it's on par but, at least Hitler wasn't a coward.

All three people (Trump, Obama, von Leyen) demonstrated typical traits of high-profile politicians: fraud, manipulation, nepotism, embezzlement of public money and silencing these matters when journalists tried to publicize them. Only Trump was hauled into court. The other two people have a "political umbrella". Obama is "resting" after the "hardships" of his rule. And the last one was to be rewarded with a new, lucrative position in NATO.
Poor orange victim... and of course, his follower's favorite passtime... don't look at trump... he is a victim, he is being abused... look at Obama... look at von Leyen... look at Mother Theresa... look at Ukraine.   Look anywhere but to our beloved orange messiah of perfection and Bible-holding goodness.

FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12595
  • FPC developer.
Re: TP legacy shiitcode
« Reply #40 on: May 04, 2024, 11:16:30 pm »
So..... Enough politics for today. Back to regular programming please !!!!

Joanna

  • Hero Member
  • *****
  • Posts: 1414
Re: TP legacy shiitcode
« Reply #41 on: May 07, 2024, 01:48:49 am »
@440bx chat is a much better place for spontaneous off topic discussions.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: TP legacy shiitcode
« Reply #42 on: May 07, 2024, 09:24:28 am »
Since a friendly nudge of a moderator does not seem to be able to do the job, @moderator(s): please lock the thread.
Today is tomorrow's yesterday.

ginoo

  • Full Member
  • ***
  • Posts: 148
Re: TP legacy shiitcode
« Reply #43 on: May 07, 2024, 09:30:45 am »
If it's because of what I wrote, sorry I don't write anymore.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: TP legacy shiitcode
« Reply #44 on: May 07, 2024, 09:36:00 am »
If it's because of what I wrote, sorry I don't write anymore.
It is nothing personal. Politics have no merit in a online forum about programming. moderator(s) keep being ignored so there comes a time to just shut it and therefor I asked for it to be done (which I could have done in other ways as well but this way it is more visible and hopefully gets the message across).

I myself have a strong opinion on the matters being discussed but I manage to refrain myself from falling into these click-bait discussions that have a great potential to end up in flames.
Today is tomorrow's yesterday.

 

TinyPortal © 2005-2018