Joomla! 4 Tips and Tricks for Developers

Be informed that this forum is not an official support forum for Joomla! 4.0. Any issues regarding Joomla! 4.0 must be reported at https://issues.joomla.org/.

Joomla 4.0 is still in Beta stage. This forum should be used for sharing information about Joomla! 4.0.

Moderator: ooffick

Forum rules
Post Reply
User avatar
ceford
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 202
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Joomla! 4 Tips and Tricks for Developers

Post by ceford » Wed Apr 21, 2021 12:14 am

Recently I have been rewriting some J3 code for J4. This is a mixture of php and Javascript, including replacement of jQuery with plain javascript. Every problem has involved Google searches, article reading, trial and error, time-wasting and swearing. For example, something as simple as client side validation of two dates to check format, sequence and interval took a couple of days. And downloading a file generated from a database query took me days. All down to my inexperience! Eventually I solved my problems and moved on.

I could not help thinking it would have been nice to have had a series of Tips and Tricks documents. Some place to look up really short solutions to common developer problems. An alternative to the long tutorials. So far I have a list of about 10 topics. I could make a start but my solutions might be sub-optimal (rubbish).

My question: is anyone interested in such a Tips and Tricks list?

User avatar
Maradona
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Fri Aug 30, 2013 2:08 pm

Re: Joomla! 4 Tips and Tricks for Developers

Post by Maradona » Wed Apr 21, 2021 12:31 am

Great idea! That would be awesome :geek: :pop

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 10198
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Joomla! 4 Tips and Tricks for Developers

Post by sozzled » Wed Apr 21, 2021 1:13 am

As someone who has spent forty—approaching fifty—years of my life as a software developer, I think the first "tip" is having some confidence that there's a market for the product one develops. This is true whether one is writing a product that will be used by some one or thousands of people. I don't want to sound like a prophet of doom but I don't have much confidence in J! 4 being used a lot. I could be wrong but that's the feeling I get and I know many people share that feeling.

Even so, I appreciate the tremendous effort that @ceford has put into understanding how J! 4 is supposed to work, documenting how it will be used, and generally for investing his time and not being rewarded for it.

The second most important tip, when one is developing software, is to know your development environment and the limitations of what's feasible. This is true whether we're talking about writing in COBOL or PHP, building software for an IBM 360/65 or in a virtual space like Apache, using Microsoft SQL or MySQL, using vbScript of Javascript (or variants of them). As far as J! 4 development is concerned, we need to understand the limitations of J! 4 as much as we need a version of J! 4 that we can depend upon.

Those two things are the most important "tips" as far as developing software for J! 4 and I don't have the confidence at this time to even begin any software development in this area until the environment has stabilised.

I agree with @ceford that it's quite difficult for us to obtain information. As we read:
ceford wrote:
Wed Apr 21, 2021 12:14 am
Every problem has involved Google searches, article reading, trial and error, time-wasting and swearing.
I get that! 8) Every problem that I encounter with J! 4 involves much searching (using Google, among other things), looking at team reports, looking at GitHub, reading the announcements, asking questions on The Joomla Forum™, trial and [much] error, time-wasting and the occasional inappropriate word muttered quietly under my breath. I sympathise with @ceford.

If nothing else, there is some interest in J! 4: the Joomla! Community Magazine—a regular monthly occurrence—shows us that. The JCM may be a place where these tips and tricks—or at least a list of them—could be published?
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12027
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Joomla! 4 Tips and Tricks for Developers

Post by brian » Wed Apr 21, 2021 3:06 pm

Seems its time for you to retire from spamming this forum with your doom and gloom
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

User avatar
AlexVega
Joomla! Hero
Joomla! Hero
Posts: 2697
Joined: Fri Aug 28, 2015 6:13 am
Location: México

Re: Joomla! 4 Tips and Tricks for Developers

Post by AlexVega » Wed Apr 21, 2021 8:41 pm

ceford wrote:
Wed Apr 21, 2021 12:14 am
My question: is anyone interested in such a Tips and Tricks list?
Count with me.

Do you have planned to contribute this in the documentation or in the magazine?

For example, in the Docs we have some great content like: https://docs.joomla.org/Development_Best_Practices but I think that we also need a digested way to explain this to the new developers, but we don't have a clear structure to go from 0 to pro, maybe we need this first, "a way to make clear the things we already have".

In my case I have translated some documentation and in some occasions the content is super clear, but without consecutive order, or yes, we have consecutive order but too technical, so I do my best here too.

User avatar
ceford
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 202
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Joomla! 4 Tips and Tricks for Developers

Post by ceford » Fri Apr 23, 2021 7:17 am

I have made a start on this and have created pages leading from the Joomla 4 Tutorials Project page:

https://docs.joomla.org/JDOC:Joomla_4_Tutorials_Project

There is an item in the ToDo List: Tips and Tricks for Joomla 4 Developers

https://docs.joomla.org/J4.x:Tips_and_T ... Developers

With one entry at the moment: Check two dates

https://docs.joomla.org/Joomla_4_Tips_a ... _two_dates

It has already had one beneficial effect (on me) in that I felt obliged to replace my sloppy code with more correct practice. Whether it is best practice remains to be seen. If more experienced coders want to step in with code correction or discussion, all the better.

This is the list of items I have it mind to add, all things that slowed me down whilst rewriting my component admin code to eliminate jq:

* Toggle Yes/No button in Admin list data
* Send async request from modal
* Submit form and get back csv file
* Toolbar button specials
* Form validation
* Geocode
* Check upload file size
* Working with wide tables 1: Scroll
* Working with wide tables 2: Scroll + Fixed index column
* Working with wide tables 3: Highlight table row
* Using Popover in Admin list
* Textarea counter

If I don't do it soon I will forget the steps involved!

The Magazine is the last place to put this sort of stuff! Part of the problem with Joomla documenation is that it is scattered and searches turn up too many references to previous versions that may be out of date. The Joomla 4 Tutorials page ought to be strictly Joomla 4 only and hence the best place.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 23072
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Joomla! 4 Tips and Tricks for Developers

Post by pe7er » Fri Apr 23, 2021 7:48 am

ceford wrote:
Fri Apr 23, 2021 7:17 am
I have made a start on this and have created pages leading from the Joomla 4 Tutorials Project page:

https://docs.joomla.org/JDOC:Joomla_4_Tutorials_Project
Thanks for contributing your knowledge and code examples!
Much appreciated!
Kind Regards,
Peter Martin, Global Moderator
https://db8.nl - Joomla specialist, Nijmegen, Nederland
The best website: https://the-best-website.com


Post Reply

Return to “Joomla! 4 Related”