Many times, when you purchase a course on that platform, (specially software related ones), you could find they are quite old and outdated to the point you could spend more time fixing deprecated methods, fixing errors… than actually doing the course. Must say that fixing errors is sometimes a good way to learn, but usually we expect that the authors update them more often.
Unfortunately that is not always the case, and worse, those authors sometimes update the title of the course to reflect the current year or one framework’s / programming language´s latest version in an attempt to hide the outdated concepts and get more sales.
Now it seems it is not possible to see when a course was created, just the last update.
But there is a way to find when it was actually created using the Udemy API. We can use our preferred api platform to perform the request. I use Postman.
We need just to change COURSE_ID with the actual id of the course. How can we find it?
Go to the course´s main page, right click and select View page source (you can open it with CTRL + U ). Once you are there, use CTRL + F and look for the attribute called data-clp-course-id, where you will find the course id.
Once you change COURSE_ID with the id you are have been provided, perform the request and if everything goes fine you will get a response with a field called “created”, where you can see the course creation date.
Also never use spaces, can lead to errors when validating
-I am very concerned about security. As I had to store user´s session I have investigated a lot regarding cookies and other options to store and remember user sessions.
-I have also realized that, although learning to validate a form with raw PHP is essential, if you want to save time, sometimes you must use some of those libraries, specially if you have a project with a given deadline. It has disvantages like relying on an external library to do things that could entirely be done by yourself, but nowadays is necessary.
ln this case, I researched and used valitron to validate the form.
-Maybe the most important among all the things listed in this post that I noticed, is the importance of trying to write clear, proper comments. Benefits:
A good and clear structure, will be useful not only for future programmers but for yourself in the future. How many times happened that you check a code some years or even months later, and you don´t know why or how you did something? Good comments will avoid it. Make comments as if you don´t know how to code. Don´t take things for granted. Some programmers think commenting code is a sign of unclean code which doesn´t speaks by itself. As I pointed out, I personally find you could have problems to understand your own code in the future and, also, I find it disrespectful for new developers which could join the project later, if you work on a team. A team is supposed to be working for a common goal, and we must make things easy to each other. For me the willing to help, and the wish to learn are even more important than coding skills to achieve success on a company.
Another implicit advantage will be you will save a lot of time later, because you won´t have to clean so much For sure you can do a bulk deleting action with some IDEs like VS Code, if you have to delete all the commented “var_dump()” or “die()” you left everywhere; but it vcould lead to errors if you delete something should not be deleted with that bulk deletion.So, I have read some good articles and spent a lot of time improving comments. I know it is far from being perfect but I hope it is clear enough (I wait for your advices anyway).
Also I tried to present a professional and clear readme.md file on the project. Proper work with markdown (md) files (remember you can see it on my GitHub repository), can help you look like a real developer which cares about project´s usage.https://www.markdownguide.org/basic-syntax/.Maybe for next project I will try the flavored Github markdown too.
-Also regarding security and usage, I find important that recruiters or potential employers are allowed to actively test my work; that means they can create users, upload images…
In order they can test my projects on a more secure way, I started to use MySQL scheduled tasks and/ or CRON jobs.
That allow me to reset the app´s database on a regular basis (daily, monthly…), so we are sure it doesn´t matter what the user do; the app will be restored with the demo data I want it to include and show.
Usually it is done with MySQL scheduled jobs, but sometimes it is not possible, like it actuallyu happened to me on this project. Reason is, my hosting provider uses a shared web server, and for security reasons, scheduled tasks are only allowed for a super user, and a super user would compromise the safety of other databases hosted by other users on that hosting.
To solve that, they allow to execute those scheduled jobs through CRON JOBS , which are linux commands which will work on a server going under that Operative System (for example, with Apache). This way you can create scheduled jobs without having too many, risky privileges.
– I have noticed (or better said, remembered) the importance of always having PAPER AND PEN with you.
Someone told me about that at the beginning of my career, but many times we don’t realize due to pressure, and sometimes we don´t see we can save a lot of time if we stop coding and start to analyse a problem with a paper and a pen.
For example, on this project I had a problem to show the errors array provided by valitron library. I thought it would return an array with each error being an index of that array; but after struggling with some problems to properly show those errors, when I made a print of the array with print_r(), I saw it was something different
So, with the little help of a paper and a pen to see it more structured, I saw the errors array it was actually an array of arrays, being each error an array itself, so I had to iterate like the old, basic matrix (with two foreach loops).
-Another thing I find a good practice is that a method should do only what it says it does.
If your method is called “insertUser()” your method should only insert that user. Connection to Database should be for example another method which would implement the connection logic, and would be called inside “insertUser()”
-More about security basics: Using PHP PDO statements will improve our code´s security and can avoid SQL injections.
You have a good free tool to obfuscate yourt code here:
So I can say, developing this project has been extremely productive to me, because I have remembered and learned many useful things which will help me to be a better developer.
Also I am learning swedish and learning to play guitar as well as giving sports and mindfulness the importance in life it should have for every of us. Even as developers such things can be more helpful than we could think to be more productive. That´s why I mention it: I learned the importance of taking care about your body and mind. I will finish with a good reading about it:
Before I had to be full.time dedicated to take care about my mother, I had some projects to include on my portfolio.
One of them was a REST API made with PHP and SLIM2. I used this API as a mock backend for many applications, like my car selling fake app. Here you can see the back-end and fron-end code (made with Angular 6) of that app
Also you can see the project working here ( you will find a 403 Forbidden response, but ask me and I will give you an access to check). The reason that is is closed is that you can “play” with it: change or upload pictures… and I don´t want that to be done by anyone on the internet, of course 🙂
When I wanted to code it again, to refresh my knowledge, I noticed there were a lot of differences between SLIM 2 and the actual SLIM 4. Also, as the old version was made following a course, I wanted to make again from scratch, then I can feel the API is “more mine”.
As documentation is maybe not as clear for a noob asd it should be, I will start a series of articles to describe how I made the API and what worked for me.
But the first thing will be to sync GIT with my GITHUB and my IDE (Visual Studio Code), to commit the changes easily. That will be the next article. Of course you don´t need to do that but I think is a good moment to explain the very basics I know about it.