Dipping Toes Into Programming
-
I was playing around with the concept of using PHP and forms to do things with PowerShell (given a Windows Server is running a web server with PHP such as XAMPP).
Lots of potential there.
I can get form data processed by powershell and outputted to a web page.
I didn't do much last night, but I was able to output PING results to the web page, and when I was finished for the night, I put in code so when I refreshed the web page, it shut down my computer.
I'm thinking I could potentially create an internal web app to control anything via PowerShell by use of forms... such as adding a user to AD to running reports. (of course secured and login required)
-
@tim_g said in Dipping Toes Into Programming:
I was playing around with the concept of using PHP and forms to do things with PowerShell (given a Windows Server is running a web server with PHP such as XAMPP).
Lots of potential there.
I can get form data processed by powershell and outputted to a web page.
I didn't do much last night, but I was able to output PING results to the web page, and when I was finished for the night, I put in code so when I refreshed the web page, it shut down my computer.
I'm thinking I could potentially create an internal web app to control anything via PowerShell by use of forms... such as adding a user to AD to running reports. (of course secured and login required)
So basically recreating Honolulu?
-
@scottalanmiller said in Dipping Toes Into Programming:
@tim_g said in Dipping Toes Into Programming:
I was playing around with the concept of using PHP and forms to do things with PowerShell (given a Windows Server is running a web server with PHP such as XAMPP).
Lots of potential there.
I can get form data processed by powershell and outputted to a web page.
I didn't do much last night, but I was able to output PING results to the web page, and when I was finished for the night, I put in code so when I refreshed the web page, it shut down my computer.
I'm thinking I could potentially create an internal web app to control anything via PowerShell by use of forms... such as adding a user to AD to running reports. (of course secured and login required)
So basically recreating Honolulu?
If that's how it work, I haven't looked... then yes.
Except this would be a learning tool for me as I'm going through my PHP book, where I implement things as I learn them.
That's what I'm doing now with this other PHP web application. -
@tim_g said in Dipping Toes Into Programming:
@scottalanmiller said in Dipping Toes Into Programming:
@tim_g said in Dipping Toes Into Programming:
I was playing around with the concept of using PHP and forms to do things with PowerShell (given a Windows Server is running a web server with PHP such as XAMPP).
Lots of potential there.
I can get form data processed by powershell and outputted to a web page.
I didn't do much last night, but I was able to output PING results to the web page, and when I was finished for the night, I put in code so when I refreshed the web page, it shut down my computer.
I'm thinking I could potentially create an internal web app to control anything via PowerShell by use of forms... such as adding a user to AD to running reports. (of course secured and login required)
So basically recreating Honolulu?
If that's how it work, I haven't looked... then yes.
Except this would be a learning tool for me as I'm going through my PHP book, where I implement things as I learn them.
That's what I'm doing now with this other PHP web application.Applying what you're learning to something you already know - it's a good learning strategy
-
I am not sure I would recommend PHP as a first language; perhaps PHP 7 leveraging Laravel or something structured. Mainstream PHP programmers used to have many bad habits. PHP 7 has good object support and I do not dislike it that much.
Python is very good for a first language.
I am more of a backend programmer and for that I like Go; it is a small language with very good concurrency.
For front end I like https://vuejs.org/ more than ReactBy the way, the python paradox is a good read: http://www.paulgraham.com/pypar.html
-
@dave_c said in Dipping Toes Into Programming:
Mainstream PHP programmers used to have many bad habits.
That won't affect the learner, though. Learn from a good source, and PHP won't be in the way at all. PHP itself doesn't encourage bad habits, that was just a culture of people using it as non-programmers.
-
@scottalanmiller
Oh, yes: Learn from a good source.
PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened" -
@dave_c said in Dipping Toes Into Programming:
@scottalanmiller
Oh, yes: Learn from a good source.
PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened"PHP is reminds me a lot of Powershell scripting. I'm running into so many similarities.
-
I do plan on learning Python as well, but PHP is easier for me to learn programming.
-
@tim_g said in Dipping Toes Into Programming:
@dave_c said in Dipping Toes Into Programming:
@scottalanmiller
Oh, yes: Learn from a good source.
PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened"PHP is reminds me a lot of Powershell scripting. I'm running into so many similarities.
No kidding. It has been a while since I've done anything in PHP and I had an idea to tinker with tonight... I keep shooting myself in the foot trying to use PowerShell syntax for stuff.
-
@tim_g said in Dipping Toes Into Programming:
@dave_c said in Dipping Toes Into Programming:
@scottalanmiller
Oh, yes: Learn from a good source.
PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened"PHP is reminds me a lot of Powershell scripting. I'm running into so many similarities.
Oh gosh I hope not.
-
@dafyre said in Dipping Toes Into Programming:
I keep shooting myself in the foot trying to use PowerShell syntax for stuff.
I feel like that problem just gets worse before it gets better (does it ever get better?)
-
@scottalanmiller said in Dipping Toes Into Programming:
@tim_g said in Dipping Toes Into Programming:
@dave_c said in Dipping Toes Into Programming:
@scottalanmiller
Oh, yes: Learn from a good source.
PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened"PHP is reminds me a lot of Powershell scripting. I'm running into so many similarities.
Oh gosh I hope not.
I'm not talking about the cmdlets and stuff. I mean the scripting parts... programming logic, loops, arrays and such... those areas.
-
You're probably just seeing the underlying paradigm of procedural programming.
-
@scottalanmiller said in Dipping Toes Into Programming:
You're probably just seeing the underlying paradigm of procedural programming.
Yeah hats probably the case.
-
-
@scottalanmiller said in Dipping Toes Into Programming:
https://medium.freecodecamp.org/every-time-you-build-a-to-do-list-app-a-puppy-dies-505b54637a5d
My first project that I'm almost finished with is a nutrition calculator for my protein bar recipe.
That basically covers the first two chapters and a little into 3.
Though, there's about 65 form fields to handle, so it's quite big without me knowing how to handle all those fields, especially due to them initially being generated automatically by like 4 lines of PHP.
I'll link it after it's finished, it's quite nice for it's purpose.
-
Cool
-
@scottalanmiller said in Dipping Toes Into Programming:
Cool
I'm pretty close to being done with my first project to drive home chapters 1 and 2 of the book (plus what I learned on SoloLearn).
Edit: It takes advantage of HTML5 and PHP7+ only features
Here's the results so far:
First Screenshot:
This is the default page, and all of this is automatically generated and filled in with just a few lines of PHP, and allows you to adjust as needed before submitting how much one bar weighs.
Second Screenshot:
This shows the results of everything from the first screenshot.
I know I need to work on formatting and prettyness a bit, but my main goal was first functionality.
I also have error handling, and defaulting to ZERO:
As well as injection prevention, null setting before any handling, and strict checking:
A snippet of just the
$grams
variable (but applies to everything):
(that's an old comment to myself that I haven't removed yet) -
For the rest of the chapters, I'll be doing other projects (two of which I started already and got as far as I could with the knowledge of chapters 1 and 2 (some of 3)) and will do those as I go through the book... also, I will make this Protein Bar Nutrition Calculator way more efficient on the back end as I learn more.