Web Hosting and Programming Styles | Programmatic (2024)

On this episode, Michael discusses the following topics.

Swift

struct ContentView: View { // Declare the array with elements to display in the List let names = ["John", "Jane", "Alice", "Bob"] var body: some View { // Use the List view to create rows for each element in the array List(names, id: .self) { name in Text(name) } .navigationTitle("Names") } }}

Python

hash Declare the list with elements to display names = ["John", "Jane", "Alice", "Bob"] Hash Iterate through the list and print each name for name in names: print(name)

Discord Bot

import discord from discord.ext import commands client = discord.Client(intents=discord.Intents.default()) @client.event async def on_voice_state_update(member, before, after): if before.channel is None and after.channel is not None: channel = client.get_channel(123456789) hash Replace with the ID of the text channel where you want to post the message message = f'{member.mention} has joined {after.channel.name}' await channel.send(message) hash Replace 'YOUR_BOT_TOKEN' with your actual bot token client.run('YOUR_BOT_TOKEN')

Topics

  • Pick a good Web hosting provider with good tech support. Use Michael's DreamHost Referral.
  • We also discuss the different styles of programing from Object Oriented programming to event driven programming, and declarative programming.

Michael DoiseProgrammatic

Edit TranscriptRemove HighlightingAdd Audio FileExport...?

[0:00]Music.

[0:19]And hello everybody, welcome back to Programatic.My name is Michael Doeys and it's good to be back with you all this wonderful week.We recorded a day late because there was just a lot to get done to publish the last episode.We had a lot of code that we had in the results.So something that we thought about was if you couldbasically take your code that you have for a solutionand throw it through chat GPT and tell it to remove,the extra text or the punctuation, could it do that?And it does not seem to do it.

[1:02]It wants to keep it all as code and try to remove,it's trying to be smarter than we areand remove the punctuation from the actual string.So like if there's a print statement,it would go in and remove the parentheses or punctuationand put them as words in the strings.Now, one thing that I did get it to do,is I said replace all semicolons in this codewith the word semicolon, and it did that.So that was helpful for JavaScript.Unfortunately, that's the only languagewe do our examples in that are using semicolons.So yeah, that didn't help.When I tried to do parentheses, I was like,nope, not gonna do it, won't do it.So that was not very effective there.So unfortunately, I still have to do those by hand.So it takes a good little while to do that.

[1:51]It takes an editing project that really shouldn't take very long,quite a bit longer to convert all of that to text,then throw it through 11 labs,and then have that converted to audio,and then put that into the tracks.But I think it really sounds great,And I haven't gotten any feedback so far,so I'm curious what people think of how we're doingour code snippets in the episodes.And in fact, I will have.Snippet in here today.And I will talk about that after we do our solutions. Our last challenge was to use an array,to build an app or a,console application that could have a list of names or items and.

[2:43]Basicallytheresults that will be in the full version, sorry YouTube folks, that will be in the full version of the podcast will be ofSwiftUI and,of otherpossible UI frameworks showing a list.I think I'm going to mainly focus on SwiftUI,so we may not have a JavaScript.Or if we do have a JavaScript in Python version,it might be console applications because it's easy togenerate a SwiftUI list because it's so short.But making a whole Python UI that has a listwould be a little more difficult in a JavaScript application.So we're gonna probably just have one programming solutionfor this lesson or this challenge result this time.So maybe two showing a Swift or Python array.

[3:40]So we'll see, we'll see what we get.So the other snippet, so well, let me back up.So here's gonna be the results of that challenge.We have the Swift.Struct content view colon view left curly bracket.Slash slash declare the array with elementsto display in the list.Let names equals left square bracket John comma Janecomma Alice comma Bob right square bracket.Var body colon some view left curly bracket.Slash slash use the list view to create rowsfor each element in the array.List left parenthesis names.Comma ID colon backslash dot self right parenthesis.Left curly bracket name in text left parenthesis name right parenthesisright curly bracket dot navigation title left parenthesis names rightparenthesisright curly bracket right curly bracket,and now we have our python resulthash declare the list with elements to display names equals left square bracketJohn comma Jane comma Alice comma Bob right square bracketHash iterate through the list and print each name.For name and names colon, indent level one.Print left parenthesis, name right parenthesis.

[4:56]So we'll have one of each and we may have to make some editsand things like that based on what we have.So I want to thank 11 Labs for providing that again.And also I want to talk about one of my projectsthat I just worked on, which I'm going to use 11 Labsand have it read the project because it's very short.

[5:19]And what that is is a Python script that is a Discord bot.And you'll be able to find this in GitHub.I have to make a few edits to make that ready to go.But you'll find it in GitHub on my repos that will send an alertto a channel when somebody joins voice.So I'm going to have the Python voice that we use from 11 labs.Go ahead and read that source snippet right here.Import Discord.From discord.ext import commands.Client equals discord.client left parenthesis.Intents equals discord.intents.default left parenthesis,right parenthesis, right parenthesis.At sign, client.event.Async def on underscore voice,underscore state, underscore update,left parenthesis member comma,before comma, after right parenthesis colon.Indent level one.If before dot channel is none,and after dot channel is not,none colon indent level two,channel equals client.get underscore channelleft parenthesis,123456789 right parenthesis.

[6:25]Hash replace with the ID of the text channelwhere you want to post the message.Indent level two, message equals F single,quote, left curly bracket member,dot mention, right curly bracket has joinedleft curly bracket after dot channel,dot name, right curly bracket, single quote.Indent level two, await channel dot sendleft parenthesis message, right parenthesis.Hash replace, your underscore BOOT underscore tokenwith your actual bot token.Client.run left parenthesis, single quote,your underscore bot underscore token,single quote, right parenthesis.

[7:01]All right, so that's really exciting stuff.And it's working now.And this brings up one of the first topicI'm gonna go through today.And that's how to pick a good web host.I think I've, people that know me have knownthat I've gone through the list of web hosts.I've gone from Bluehost to NameHero to, let's see,so many others.I've even built my own through Linode using cPaneland DigitalOcean using cPanel and all kinds of others.And I've never really been happy with any of themthat use cPanel.I've tried DreamHost and I used a small VPS there,but it didn't have enough RAM,so I thought it wasn't working.So, how do you pick the right web host for your website?Whether you're programming your website as a Node.js application,or it's a WordPress site, Drupal site, any of these things,it's important to know how to pick a good web host.

[8:05]So, there's a few factors here.It depends on, one, how your website's going to scale.Is it going to be a small website that you and just a few people are going to use?Or will it be a bigger website that everybody will be like e-commerce website, all those kind of things, right?I use cPanel because that's what I always knew to be the best, right?It's what has always worked for me and I don't know of any other,I never knew of any other panel that would really provide what I needed to do.And so that's why I've always used it.I've never used Plesk, I've never used all of those things,but I know for some people it works really, really well.So those things are, you know,some things that people use that I've never messed with.I went back to DreamHost because I know a lot of peopleuse it and it's fantastic.I've set up a faster VPS and everything worksso much better, no RAM issues, no CPU problems.It just works well.And then I got to playing with some of the enhancedvirtual private server, VPS features.

[9:20]And I determined that one of the neat things about it is you do have shell access. I loggedin through SSH and it's fantastic. You can install applications. I put the Discord boton a folder outside of the iAccessibility.net folder and I ran a I set it up and saved itthere and then I set up what you can set up cron jobs inside the DreamHost panel.It is so fantastically easy.And I was able to set this discord bot up and it runs on server start.I just told my server to restart and Hey, the discord bots running.It's just that easy. You know, the, the bot doesn't do anything.It doesn't take up much memory.

[10:08]So it's very nice. You know,the customization that you have on a place like DreamHost.And one of the aspects of cPanel that is a pain,if you want to use Node.js or Python with Django,which is one of their web services, Flask is another,if you want to use those on cPanel or others,you have to set up what's called Passenger.And that's not the easiest thing to do.You have to know where to do it.And in DreamHost, it's just a checkboxthat you go and find.So, you know, if you want a VPS with DreamHost,it's gonna give you the most supportfor what you're trying to do.They do have shared hosting as well,and that's for like smaller websites,but you can scale your sites with the VPSor have multiple websites and manage them from one place,and that's fantastic.

[11:00]They also set up multiple,like each individual account has its own userand it's not cPanel, so it's not as easyfor that account to get hacked as it is on cPanel.So another thing is cPanel is now enforcing a user limit.So I don't know that I could recommend that based on,you know, if you want 30 websites,you know, you could do that on cPanelwith like certain number of users, but it's more difficult.With DreamHost, it's just that easy.So I highly recommend checking out DreamHost.There's other resources out there.So just pick the one that works best for you.And one thing that is important when picking a web hostis technical support.If something goes wrong, because inevitably,it's not a matter of if something goes wrong,but when something goes wrong, can you fix it?Do you know how to fix it?And will the people that are at technical supportbe there to support you or do they not know their job?When I was working with my last hosting provider,they did not know how to do,I tried to do something, it broke email, they didn't know how to fix it.Because they didn't understand what they needed to do.So.

[12:15]I have to recommend that you go with a place,and DreamHost has been a good place for me,for technical support.If I have a question or an issue,they're on chat always ready to help.They've always understood my questions.Keep those things in mind when you'relooking for a place to put your website,especially if you're putting a WordPress website up,it's important to really,Find a place that's gonna be a good home and that's secure. That is my spiel about,finding a good web host because I feel like that's important, you know, you could be building a project and.

[12:56]You're looking for a place to put the website for the project like you're building an app and you need a,Place to host that app a website. That's a good place to do it. I,Will put myreferral link in the show notes, so be on the lookout for that.All right, so on to the topic that I told you guys that we'd be talking about in the last episode.It's really interesting because we've talked about different programming languages interpretedand compiled, and so, you know, a lot of podcasts you could just dip your toes in no matter whatwhat episode, but I highly recommend that you listento all of our episodes.And I know that's like a lot of time,but I hope these are fun and engaging.So I would recommend that you listen to our last oneabout interpreted and compiled languages,because this kind of goes from that.And this is about programming styles, right?What are the different styles of programming out thereand which one will work for what you're trying to do?And if you're in iOS land, we have two big frameworks.We have UIKit on the Mac, we have AppKit,and now we have SwiftUI,which kind of combines both of those into one.

[14:20]Well, it combines UIKit, AppKit, and WatchKit,and all those things into one programming paradigm.And SwiftUI is using something that a lot of peopleare not familiar with,and that's called declarative programming.And so what is declarative programming?What is and what are the other ones out there?You know, a lot of people are very used,much used to object-oriented programming.And, you know, when you build iOS apps,you're using object-oriented programmingand event-driven programming.So I'm using a bunch of terms, declarative,object-oriented, event-driven.There's functional programming, all these other styles.Today, we're gonna focus mainly on the onesthat relate to building apps with UIKit and SwiftUI.

[15:22]And that's three main types.And that's declarative programming for SwiftUI,event-driven programming and object-oriented programmingfor UIKit.

[15:37]I stick with these because these are my wheelhouse.This is the areas of development that I've worked with the most.But I'd be curious to hear other people's talk.What do you use with C-sharp and,different UI elements inprogramming for building Windows applications?I know React and things like that use declarative as well.How is that different?I think we need to have a whole episode at some pointon the JavaScript libraries out there,Svelte, React, React Native, what is all that?And we'll do that, but I think we're kind of doingmore fundamentals and things like that here for now.So SwiftUI is declarative and then we have UIKit,which uses the other methods.

[16:29]Object-oriented programming is where you have objects that have properties and methods or functions basically.So, my name is Michael. I'm an instance of a human, which is an object, also known as a class.And I have properties like skin color,I would say hair color, but I don't have any hair,so that doesn't really work.I have skin color, eye color.There's things that define me.I have hands with five fingers,and I have functions or methods like walk,talk, eat, sleep.Those are all methods.And when we.

[17:19]Look at all of our classes, you know, we have tables,like, and I'm not talking about like a table on the web,I'm talking about a table that we sit at and eat.A table has its own properties, it has legs, number of legs,right, and then we have instances of the table, right.So you, going back to humans,you're an instance of the human class,but you have, you're an instance of that,but you have your own methods and values.So when we build an application in UIKit,we create a new instance of a view controller, for example.So like if I want to show a screen with certain items on it,I create an instance of the view controller class andoverride different functions and methods that ithas and set my own properties on that instance.So it's an instance of the view controller,but it's not the original class, if that makes sense.So that's object-oriented programmingon a very, very high level.

[18:24]When we talk about declarative programming, though,it's a little different.Declarative programming, and I'm very new to this,so if one of you guys that are experts hear thisand you're like, no, no, Michael, that's totally wrong,please call me out and say, yeah, no, man, that's wrong.Declarative programming, as I see it,is programming where you're writing out your user interface.

[18:53]By declaring all possible states.So, for example, as an example,I could write a text, which is a label,with some static text, it will never change.

[19:08]But I could create a text label with a variable that is a state variable.So the variable will look at what's in it,and then the text field will change based on the contents of that.So if I have a image and I change the image after tapping a button,I'm not making a new image or I'm not changingthe property on the image that I've already created.It basically redraws the image very quicklywith the new thing, with the new image inside.So it's looking at all possible statesand conditions at create timeinstead of you telling it at certain times to do things.The term for this is also the, for UIKit,when this happens, it's called event-driven programming.And that means that buttons and other UI elementsin our application change based on events.If I click the button, it will do this, right?So that's the big difference between declarativeand event-driven and object-oriented.With declarative, I'm saying, here is this text fieldor this button, and here's what it will do.

[20:34]This is this button, text field or label or button,and this is what it will do, no matter what.And so we're declaring how this stuff workswhen we declare the item at create time.So if I have a, if I'm loading data from the web,then I'm already going to say,if there's no data, show this, if there's data, do this.And so it already knows how it should displayno matter the conditions.So that's why it's declarative.we're declaring how this thing should be.Now, I think a lot of people are very used to object-oriented and event-driven programming.And it's very difficult to change how you look at these things.So I really am a big fan of learning all of these.But I would pick one and start with it and then learn the otherbefore you really go into another thing.

[21:39]If that makes sense.So if you're picking declarative, go with that.If you're picking functional programming, go with that.If you're picking event-drivenand object-oriented programming, go with thatand learn those things before you learn something else.So that's my big talk on that.And it's very interesting.So, you know, a lot of languagessupport multiple programming styles.Swift can support declarative through structs,and it can support functionalthrough closures and other things,but it also supports...

Web Hosting and Programming Styles | Programmatic (2024)

References

Top Articles
Lana Rhoades Gave Birth to a Baby Boy at the Beginning of 2022, but Who Is the Father?
4 Best LSAT Prep Courses in NYC [We Reviewed 24 Total] - Testing.org
Rentals for rent in Maastricht
Meet Scores Online 2022
Jikatabi Thothub
Indiana girl set for final surgery 5 years after suffering burns in kitchen accident
Parx Raceway Results
Hill & Moin Top Workers Compensation Lawyer
Scoped Courses - Bruiser Industries
nycsubway.org: The Independent Fleet (1932-1939)
Leccion 4 Lesson Test
Unlockme Cintas
Dolllface Mfc
Ge Tracker Awakener Orb
Justine Waddell talks about a season of screenings MELODIA!
My Fico Forums
Power Outage Hales Corners
Bakkt Theater Purse Policy
Carle Mycarle
Staar English 2 2022 Answer Key
Winta Zesu Net Worth
Spring Tx Radar
Vision Government Solutions Stamford Ct
Lucky Dragon Net
Insidekp.kp.org Myhr Portal
Is Costco Gas Good? Quality, Cost & Benefits | Ridester
Navy Qrs Supervisor Answers
La Times Jumble Answer Today
Произношение и транскрипция английских слов онлайн.
Peplowski v. 99 Cents only Stores LLC, 2:21-cv-01990-ART-EJY
Game8 Genshin Impact
Myrtle Beach, South Carolina: Abwechslungsreicher Freizeitspaß unter der Südstaaten-Sonne
SimpliSafe Home Security Review: Still a Top DIY Choice
Iggy Azalea Talks Dancing Off Into the Sunset on Her Own Terms With ‘The End of an Era’
Things To Do in Sanford, Florida - Historic Downtown Sanford
Ftbt Ugly God Lyrics
Taylor Swift: The Eras Tour Showtimes Near Marcus Pickerington Cinema
Ourfig
The Untold Truth Of 'Counting Cars' Star - Danny Koker
Did You Hear About Worksheet Answers Page 211
Acceltrax Sycamore Services
Dermatologist Esthetician Jobs
The Little Mermaid (2023) | Rotten Tomatoes
Craigslist Lasalle County Il
Trực tiếp bóng đá Hà Nội vs Bình Định VLeague 2024 hôm nay
8569 Marshall St, Merrillville, IN 46410 - MLS 809825 - Coldwell Banker
Kohl's Hixson Tennessee
Halloween 1978 Showtimes Near Movie Tavern Little Rock
Sir Anthony Quayle, 76; Actor Won Distinction in Theater, Film, TV
Kentucky TikTok: 12 content Bluegrass State creators to know
Platform Overview - Aria Systems
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 6357

Rating: 4.4 / 5 (75 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.