Code Faster in Delphi - DelphiCon 2020

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody welcome to delphi con 2020. uh the vcl panel is running a little bit long or sorry fire deck panels are a little bit long but we're going to jump right into uh code faster delphi by aleister mchristy he has a video he's going to run and then we'll do some q a at the end as a reminder all of our sessions are going to be available um after the conference finishes as recording so we'll get both the content and also the q a session at the end let's start the video g'day i'm alistair christie and welcome to my delphicon presentation entitled codefaster in delphi this also happens to be the title of my new book which is all about being more productive in the delphi ide i'm going to share some of my productivity insights with you over the next half hour but of course i can only cover a tiny fraction for the rest you'll need to buy a copy of my book go to learndelphi dot tv code faster i'm going to start with some keyboard shortcuts in the delphi code editor in my book i have a section that spans 10 pages of keyboard shortcuts so we're only going to have time to look at a fraction knowing the shortcuts and the ide can save you an enormous amount of typing and pointless waving around of the mouse i always get a bit of buzz when i learn a new shortcut so i hope you find the following a hive of excitement let's just open an existing project and i'll just make a quick mention you can use the buttons in the ide such as the toggle form unit to go between the source and the form designer but you should learn the shortcuts so it's f12 so we'll use the f12 key using the keyboard shortcuts will save you a little bit of time each time each time you use it using the mouse is quite slow for interacting with the ide if you can keep your hands on the keyboard you'll save a lot of time so i'd recommend learning as many shortcuts as you can for sort of common ide tasks now if i write a procedure i can implement that with the class completion just ctrl shift c and we'll see that's implemented the procedure and put the cursor where we want to start typing it also works for properties let's let's do read fdx and so we'll have a field and a setter and i'll just press ctrl shift c and that's implemented that and even written the code for us and created and i'll just go ctrl click on that and we see it's put a field in automatically for us in the private section so that's class completion i use it every day another thing along similar lines is the synchronized prototypes if i add a his defunct i'm after and press ctrl alt p so our implementation is now different from our interface but if i press ctrl shift p it synchronizes those and that works from both locations so if you don't believe me and there we have it synchronizing the methods now i use this quite regularly i find it quite helpful there is a refactoring for adjusting parameters but i find this a lot quicker now you've already seen me use the control shift down arrow to navigate between the implementation and interface and control shift down dropship do the same thing so i can use the same same key to go between them that also works in the uses so i can go between the interface and implementation of the users another quick way of finding the the users is we can go in here and there's a bunch of locations in our source code and i find that's pretty much all i use this for is to go find the implementation and interface of the users another thing if if i like control click on a few things to navigate to them we can then go backwards and forward navigating their code with the alt left and right arrows so these are the history buttons normally there's some history buttons up here but i've i hide them because i i've never used the buttons or use the keys so we can navigate to previous locations in our code by using the alt left arrow and right and on a similar note bookmarks very handy so i can come in here and for instance add a bookmark by pressing ctrl shift one and i can add another one here ctrl shift two and ctrl shift three so i got three bookmarks and i can just press ctrl one two or three to go to those locations in in the source code now if you want uh sort of bookmarks on steroids if you go into the get package manager you can install the bookmarks plugin which adds a bunch of additional features and including just being able to press ctrl b to install a bookmarker i mentioned earlier about disabling the navigation buttons these browser buttons and you can enable and disable any of the groups of buttons that you like and by default they actually are on a separate line but if you shove them all up onto the same line as the menu bar you get a little bit of extra space for the source code which is good and disable that now also you can customize the buttons that are visible for instance i've added this uh toggle language exceptions or notifications and you can go in and if you just go find what button you want let's um let's go find references for instance and throw that somewhere you'll see there's a little it's total between across and a plus so we can add that button to our group here and to remove it we just drag it off so i'd actually encourage you to remove any buttons that you don't actually use very often and of course you want to be using the keyboard shortcuts i still have the um run button here because the camtasia defaults to f9 being start screen recording and so i kind of leave the the run buttons there but otherwise i just use the keyboard shortcuts let's um do a few more keyboard shortcuts and if we have say or sell mine and we want to group these ones together we could put traditionally we could do bracket there and then navigate to here and do the bracket or if i just select the code i want to have the brackets around i can just press the left open bracket and it will automatically put the right open bracket around the um where we want it the other other shortcut i'll mention is ctrl w so that progressively selects wider and wider scope and i could you know then use our smart surround like so although i still require a little bit of editing now the smart surround works with the curly bracket as well so i could set that as a comment although it does do funny things with the formatting but that's okay i i would use the control slash typically to comment out a block of code and of course it works with brackets too if i highlight something at random we can add square brackets around it if i select this block of code and release the mouse i can adjust the end of the selection with the holding down the shift and pressing down arrow or left and right and not heading but if i actually wanted the begin at the top as well i'd have to sort of reselect and then sort of reaching for the mouse and it's all quite slow but if i press ctrl q b that moves the cursor to the beginning of the block and i can then change the selection of the code and likewise i can go control q k to go to the end of the block block selection and so on carry on with the selection theme holding on the shift key while we navigate allows us to select a chunk of code but if i also hold down the alt key so alt shift and navigate we can select a block of code for instance i can delete that i find this useful quite often i'll have a number of lines of code that are a single character out of sort of incorrect indentation and sometimes the the block selection gets toggled on you can actually change the toggle by going control okay and it gives us back to regular selection but as i'm saying with the indentation if i do you know tab and shift tab that'll move two characters and likewise the uh the traditional control shift u and i for the old indent keys they're not going to get us into the right sort of location you can you can indent right to the end and then back again like so oops like that but another way of doing it is if i just hold down the alt key with the mouse i can select a single column of characters and uh and then re-indent them correctly like so that's probably enough editor shortcuts if we navigate to the top of the file i know that a lot of people including myself like to have each of the uses on its own line now we could manually do this but there's a much better way of doing it if we go into tools options down to the language formatter and go into delphi let's go line breaks and find the line breaks and the uses and it's currently set as is so we'll say line breaks and uses yes and save that and i'm just going to press ctrl d on the keyboard and this is the code formatter and that will automatically format all our code and the entire unit we can actually just have it i can just select a block and format that block so if you're manually formatting your code the using the ctrl d shortcut can be uh far quicker i don't use it as much as i should partly because sometimes i have there might be some formatting where things are lined up for readability rather than in a standard way so let's move on to some form designer shortcuts and tips so i'm just going to create a new vcl application and say no to that in my book i have a whole chapter on tips and shortcuts for the delphi form designer i'm going to share some of them with you now my favorite is one that hardly anyone seems to know and it's how you can shift a control such as a panel when it's filled with other controls and you can actually click on it so you can actually um able you're able to select it and move it with the mouse it's something that's much easier to demonstrate than describe so watch out for it let's add some controls to our form in the tool palette so if i want to add an edit i could double click on it or i could click and drag and drop it if i wanted to control its size as well i can actually just select the control and drag it onto the form now if i wanted to add say five buttons if i shift click on the button we'll see that's got this blue line around it i can just keep going until i press escape or select a different control oops no i have to select a different control but typically i'll often use the control p shortcut and just type in the control i want and we just keep typing typing controls like so there is in the properties and in in my book i go into a bit more detail about some of these properties but if i turn on the persist search filter and type in button the text stays and i can just add a whole bunch like so and let's toggle that back a really common task is to clear the text in a edit box and we can do that just by going down and deleting the property alternatively i can right click and just go clear text so you'll see we've got clear text right justify and so on and that those um various things they also appear down in the bottom of the object inspector but i have that disabled on my machine if i right click on the button we can go into the quick edit and this is now available in fire monkey as well which is quite nice and we can adjust the name and caption and also say the alignment i can set that align to the top and bigger and let's go quick edit align left okay so now we've got all these buttons in our panel and let's say i now want to move the panel i can't actually select the panel or click on it i can i can select it in the structure view but i can't can't move it very very readily i can use the shortcut keys so i can hold down oops and i can use the shift arrows to resize and control to move around but that's pretty slow what i can do is click and hold on the button and then press escape and that will select the panel and then i can move it to where i want it let's say i want to line all these buttons up i could either select them all in the structure view or i could drag to select and unselect the edits now if we want to line up with say button four if i click on button four you'll see it's got the black dots around it rather than the gray ones um likewise if i flick around and we can select position and then align and then we can align the left sides and we could also space them equally vertically and we also had a label there which you didn't want i'll just make a quick mention of the vcl guidelines we can see when i'm moving controls around the blue lines highlight um whether we're aligned with the top edges or bottom edges and the pink line indicates whether we are lined up with the text now you can also if i hit the control selected i can hold down the control key or the shift key and that'll bring up the the guidelines as well so and we can adjust things with the keys as well if i had wanted say this button one to be part of on this panel i could press ctrl x and then ctrl v to put it on there or we can use the structure view and i can drag and drop it between the various containers so it's now on on the form but i can drag and drop it onto the panel as well sometimes you might put the wrong control on a form but only realize later or you want to change the type of control and for instance this t button let's say we actually wanted a speed button on the form so this is a button 10 so just copy that to clipboard and normally i press alt f12 to view the source but that seems to have become broken in delphi 10.4 but we can right click and go view as text and find our button 10 and make it a speed button and then alt f12 should go back and even says it should but let's do it manually now speed buttons don't have a tab order property because they can't get focus so it's going to give us an error and we just go ignore and we see that now our button is now a speed button however in the source code our button one down here still says t button so i can just like compile it or save it and it will prompt us to make the change and now our button is a speed button similarly i can take a button and copy it to the clipboard and paste it into notepad and i can also make the speed button and copy that back to the clipboard and let's go back and remove that tab order and then we have three speed buttons one last tip for the form designer if i highlight these buttons and we can come in here into the search box for the object inspector and type in caption i'll press enter and we can update the caption and if we have multiple things in the object inspector i can just press enter and then use the up and down arrow to select the one i want in this next section i want to take a look at improving some legacy code by taking advantage of additions to the rtl and some new language features i have here a very simple application that lists files in the c temp folder so we're just using find first and find next to iterate through all the file names and we're just grabbing files but not directories so if we go ahead and run that we see that it does indeed do what we expect and i've got lots of lots of old files which are possibly decades old in my temp folder but this is kind of old school and we'll probably we could probably improve it somewhat and to do that i'll start by adding system.io utils to our users and we can use t directory.getfiles and specify the temp folder and we could specify the star dot star in the search pattern but it does start at start by default so that's fine and we'll get their file names variable i just need to remove the system from that and then we can iterate over those file names and that more or less does the same thing and it's about the same number of lines but oh don't eat at the beginning there but i think this is a little bit easier to read and understand and we'll just verify that it does indeed do the same thing although it's grabbing the directory so let's go and verify that does what we want excellent so we've now pretty much got the same behavior as before now we can further simplify and shorten this code by taking advantage of inline variables go var like so and then we no longer need that and i'll just check that compiles and then it does and we can run that and confirm that it still does exactly as before but so that's that's reduced the number of lines of code but each line is now a little bit confusing by having these um types in here which we can now actually admit because of another feature that's been added to delphi recently or delphi 10.3 and that's type inferencing so we've now removed the types and it's automatically determined by the compiler because we're returning a value from a function and so the compiler can can tell that that should be a t array of strings and likewise this should be a string and we can validate that still works and works exactly as before now personally i think this is more concise and easier to read than the previous code it also has the advantage of the fact that this file name variable uh is only accessible in this for loop so if i try to go something like this we'll see that this is not in the scope of the procedure only the for loop so it can help with making variables only available where you actually need to use them so that's all i wanted to cover in this example let's move on next we build a simple application for a fictitious project and look into the power that regular expressions can bring to your applications let's just pretend that you've been tasked with getting the urls for all the images in this web page or jpegs and you could go through and right click on each image and go copy link address and then paste that into notepad or something similar but as we are programmers we know there are faster ways of doing such things so let's have a look at the source for the page and find all the jpegs and we can see that there are 112 of them and basically we want to extract these urls and we can see that they you know begin with https and end with jpg so let's build an application to do just this we need some way of downloading the web page now you could use either the ndid http component but i always have fun with getting ssl working with that correctly or we could use the net http client and request and we just link those together so let's throw a button on the form so from the client we can just call get and then we need to specify a url and let's go back to our web page grab that url and it returns a response and we can grab the content as string and throw it in to the web text now we'll also just update our gui and we'll throw a list box in there and make that nice and thick we're now going to want to parse this variable it's a string and we want to extract all the urls from it now that's string parsing that's the domain of regular expressions so we'll add the system.regular expressions to our uses and we want to determine all the matches in our webpage and then we need to specify a regular expression and we pretty much know it's going to begin with https on slash and it's going to end in jpg now dot is a special character so need to escape it and then we need some magic content in the middle here and i am just going to copy and paste it in because i'm lazy so basically this is this is the um the internals of the url so i think the domain name and any folders so from there we want to iterate through all our matches and we want to add the items to our list box we'll add matched up value and of course we don't need the beginning because we've got one line of code in there and just to make sure things are going right we'll do a show message and will display the count the total number of things we found now if i have written that correctly let's run that and there's all our urls and it says we've got 112. um and quickly scroll through those and if we go back to our web page we see that we did indeed indeed have 112. now let's pause for a minute and think about what we've written which is only a total of six lines of code and we've downloaded a web page and in three lines of code extracted every jpeg url within it just think how much code you would have had to have written and you used basic string commands such as pause copy and delete it would be a lot knowledge of the rtl and in this case regular expressions can save you a significant amount of time as demonstrated thanks for watching it to the end of my presentation i hope you had lots of i didn't know i definitely did that type moments if so you'll probably both enjoy and benefit from my book code faster in delphi i'm alistair christie and i hope to catch you in a future video okay can you hear me hey okay sorry i was muted thanks aleister for the great video showing us lots of good shortcuts and ways to maximize the power of the ide uh we have a bunch of questions in the questions section that we'll walk through and i'll sort of try to group them up a little bit okay so starting off people were really impressed with your presentation what tools do you use to create the videos and how do you put like keyboard shortcuts on okay so i use a product called camtasia which is um from techsmith and it does the screen screen recordings and part of the screen recordings it records mouse position and what keys you're typing and there's a little thing that you can go and add all the um keyboard shortcuts that you've that you've used so it's just part of the uh the camtasia application nice and then of course the green screen behind you really helps i think yes yeah um that's a great webcam and that's kind of pinned up to the to the wall layer um so you want you showed us how to format the uh users section set type of formatting just apply to uses or can you apply that no no it's the entire source code so um you can just highlight a section of code like a single method um that you want to reformat and press ctrl d and it will reformat that or you can do the entire file in fact i think it's an option in the projects menu to do the your entire project and you can you would have seen them going into the tools options um languages formatter delphi i think it's the uh location of it you can specify a huge number of um parameters to adjust how you want the source code formatted um i've worked on projects that have had very strange formatting such as using using three spaces rather than two spaces and stuff like that which is i found after using two spaces for years and years um having to press the spacebar three times was um uh it drove me insane but i was i don't know if you could hear me now it looks like okay yes i was actually talking to somebody that had exactly that three spaces to two spaces and like what in the world and they said that there was a debate between two spaces and four spaces which those are two logical choices to me and they said let's split the difference and make it three i'm like no that's worse yes compromise is often often you get um something that no one wants is and i i think it's insane that you should i think people should stick with um the standard formatting that you know like the vcl is based on just for the fact that most people use it and if you're hiring another developer um you're not going to drive them insane or away for that matter there's nothing that says you should keep doing it something some way if it's not the right way but just to change for changes sake is usually not the writing yeah i think for the project i was working on with the three spaces that they had they kind of wanted to stick with it because um you know there's hundreds of thousands of lines of code and they didn't want to go reformatting at all and messing up their version control sort of um having this big change so it prove makes it harder to track the uh you know using blame and stuff like that to see see who made changes great in a similar note somebody asked if you can use the automatic format on save is there a way to hook it up to the save button or make sure that the program will reformat every time consistently um i think so i don't think you can do it on save but i think there is a um a command line version i i'm not sure about that but um if so you could run that as a um in the pre-processing video version control check-in to enforce uh the code formatting you know that's the same thing i thought i was having and i can't remember if there is a command line version or not or if it's a third-party tool that the command-line version of the formatter but there are there is one out there normal people said they just went out and bought your book or they are it's on their christmas list so i recommend it yeah it's hard to make um much money from writing delphi books the the um like i could probably project better if i wrote something in you know java or something like that with a much much wider audience um well the problem with java is there is a bazillion so many other books yeah it has to be a good book yeah so bruce says there is a command line version of the formatter pretty sure there was um yeah is does your book have a minimum delphi version that is recommended and by the way sorry i came in late the last session ran way over yeah yeah i was i was watching it and i had to had to jump out to make sure i was actually trying to looking at the questions and they did the questions didn't seem to appear until the um video ended so i'm not quite sure what happened there otherwise it would have been typing away oh it may have been that so you you by default you're a panelist instead of an organizer and we have to promote you and so that might have been what happened but that's fine um anyway uh minimum version of delphi that for your uh yeah i'd so a lot of this shortcuts will run in very old versions of delphi so even if you're running w7 and stuff like that but a lot of the a lot of the um newer stuff such as multi-paste and what have you you're probably needing probably xc8 or something like that later um so the the book is geared towards um newer versions of delphi uh but there's a lot still quite a lot of content in there that's relevant that goes way back and some of the um it's i've got you know using um some third-party plugins and things like that such as cnpac and um g experts and what have you in there they they work in lots of different versions of delphi so so there was actually the next question i was going to ask you is see and pick g experts and if there are other ide add-ins that you recommend or what is your opinion on those two and others you recommend so usually it gets pretty confusing if you have more than one installed because um they tend to you know stamp over each other's keyboard shortcuts and some of the default delty ones as well um historically i've quite liked using um cnwizards or cn pack i found that quite good um and i did i did purchase a version of model maker codex for and used it with i think it's using it with delphi seven and um i got quite reasonable at using that and that that that's a very powerful tool which is now free yeah that's a good one too i i had always the same boat i was using that i paid for it and then i later i like didn't pay for the new version and i was like i kept thinking i should buy it i should buy it and now it's free and i'm like oh my goodness that's such a useful one indeed and so i see a uh favorite keyboard um i'd i'd recommend a mechanical keyboard for for typing the sort of traditional membrane keyboards you get you know 10 keyboards uh not not really geared towards typing even some of the um uh higher end keyboards from uh logitech and microsoft that that aren't mechanical uh i'd i'd recommend going yeah spending extra and getting a mechanical even by even buying a second-hand one on ebay or something like that you could probably get one feeling cheap there are some chinese ones you can get as well that are quite good yeah yeah i actually just had to upgrade to a split um mechanical keyboard and the one i got was a little expensive but it still really really really nice keyboard it was only it was 140 which seemed like a lot for a keyboard but because it is mechanical um which i had and you're spending all day in front of it right so um these things are worth spending money on to um just make make your life more pleasant i i very much prefer typing on a mechanical keyboard um yeah and yeah i mean there's such a variety of that you you go there's online debates about which which key switches are the best to use cherry mx brown or silver or who knows you know and the different um clickiness you know the sound and travel and and all sorts of things that uh people get obsessive over but i just pick you know find yourself a reasonably priced mechanical keyboard and go for that i think the mx brown other um a good compromise between if you're doing any gaming or uh typing yeah my last keyboard was the mix brown but my new one it was a dos keyboard dash keyboard ds but my new one is the kinesis freestyle pro and it has cherry mx red silent and it is quieter than the browns were which the reason i got the browns because they're supposed to be quiet so i actually really like that and i had to have a split keyboard and this there was a lot more expensive options but this one i think was a really good compromise as far as being it's a great keyboard beside the fact that split keyboard so uh if you are looking for a good ergonomic keyboard um does control d only affect only the user section uh it'll either affect um the entire file or just the code you've got selected okay and so there's a few questions here about print versus ebook version of your book and if you can order both with a discount somehow um there's so with the the e-book you can just pick you know uh you can just reduce the price by five dollars if you if you want a discount um so on on lean pub or you can pay more there's been a few people who've paid more i'm not quite sure why but i appreciate the the the extra money um uh and yeah so there's no no discount for both unfortunately because they have the prints with amazon so that the different different companies oh okay so if somebody maybe they buy the uh print book and then post a picture online can you give them a maybe send them a coupon i said give them an email also if and if you can't afford the book um send me an email and we'll see if we work something out and if you do have the physical book take a picture and post it on social media because honestly especially in a community like delphi where you know a lot of us know each other that if you can share recommendations and reviews i'm always trying to encourage my mvps to write more reviews of books they use because it is really useful to help people to know what books to check out so if you have these books post on social media and say oh my goodness i don't know how i lived before getting aleister's book and uh yeah most of the different books i mean i i generally try and buy uh all the lovely books and and and eventually get round to reading them um and the the general quality of them is fantastic the um and the content is great so yeah that's particularly worth yeah i'm in the same boat i tried to buy all of them and i it used to be really stingy about the books i bought and i was working with this guy and he's like he was a i'm of the opinion that if you buy a book and if you use one thing out of it you've paid for the book you know it's one of those things you don't have to read the whole book if you pick it up and read a paragraph for a few pages and it's useful to you then you just paid paid for the book indeed i mean reading a book is expensive if you if you look at you know if you're working um you know getting paid by the hour and you you spend you know 10 hours reading a book or something that could be a thousand dollars worth of income you've lost lost out on or something like that so um there's there's a definitely a compromise to be made um in that aspect so um but you know i enjoy reading the devil books so i do them in my spare time anyway so yeah it you know it could be a good uh taking a break it's one of those things that when you're you're like ah this isn't working go read your book for a bit then come back even if what you're reading isn't going to be applicable specifically it can still help you change your brain yeah indeed um so you mentioned you prefer cmpac the what about g expert should is it okay i've yeah no they're both excellent um it's it's basically i i think i installed cn i think i might have used g g experts quite a long time ago um and i i've used it occasionally um cleaner which i i quite like using occasionally which is why i have that one installed um sort of by default and yeah there's this this this i mean i i mentioned a few aspects of each of these um uh ide plugins but you know each each plugin in themselves would warrant a book um in in the the the various things you can uh can do with them so yeah but i i think just just pick one i mean they're both excellent um oh and then swap between them or or whatever i'll try installing both of them but uh that usually usually ends in a little bit of confusion yeah the i so i've talked to i i try to be minimally aware of everything but i also talk a lot to mvps about what they recommend and what they're using and a lot of mvps use both c and pack or mvps are in both camps some of them love cm pack some love g experts there are benefits of both as alistair said you can make them work together but it is effort um and but definitely if you're not using either of them you're really missing out uh so definitely recommend it there um comment here go ahead carry on i was going to say asking if you're going to have a international plans pdf international pdf plans for international options for the pdf it doesn't say translated so for brazil i'm not sure if it not able to be purchased in brazil for some reason or i should be able to i've put no restrictions on on you know the regions on either either amazon or lean pub but i don't think lean pump if there's an option um but if there's an issue you send me an email um or if you're wanting to translate um into another translate the book into another language we can probably uh discuss discuss that yeah that's a good point uh translations the the good a lot of things were there we should talk some of the mvps we got a ton of mpps in brazil i'm sure they'd love to help you translate um any tips for copying forms as templates for a new form um you can use form inheritance of course um i i've used that quite a lot to quite good effect but it can be a little bit um confusing to maintain depending on how many how big your inheritance hierarchy is from from a you know you might have your base form which has some default property set on it then you might have a one for wizards and then a wizard for importing csv files or something like that and yeah that it can get a little bit confusing but um they can also save you a lot of uh a lot of time it's it's actually not something i've mentioned in the book it's i should probably add that to the bonus content so you have the code better in delphi coming up maybe that could be something in there huh possibly um i'm not sure i've been yeah quite keen to get get into finishing that off i've got about 100 pages written and but that's i haven't done anything on that in months so i have to get back into that i also want to do a video course for the code faster in delphi and throw that on back at your academy and uh you to me probably that would be awesome um so danny nguyen one of our mvps commented he loves you but really likes your book it's great and words in his mouth but yeah everybody that i've talked to that read it really really got a lot out of it and i commented actually just in the last session at towards the end i commented about that i'd learned a lot in that session and how even if you feel like you've been doing this for years like i do um there's still so much to learn and things kerry commented that he was looking back through his book preparing a session and it's like oh my goodness i saw that yeah i didn't know that and that is so true there's just so much you just really can't keep it all in your head and i know you've had this experience as well that you googled how to do something and you find out you know something you know there's i made a video on it like i don't remember remember doing it so i end up referring back to my own material which is quite bizarre um color scheme um i it varies i um so i've been using using the light theme because it records better um in in camtasia um but uh i in many ways the dark themes having a darker theme is nicer easier on the eyes uh particularly if you're kind of a you know working late into the night kind of person which which i'm not but um and uh avoiding avoiding blues um because they they're harder to focus on and um there's something about having that you know the blue light this supposedly um triggers your brain to think it's daytime so it makes it harder for you to go to sleep after you've been working um sorry i just was uh adam's gonna jump over and start the next webinar so um okay as far as fonts goes i found a website called i'm just trying to look up here are they called nerd fonts that i recommend checking out that has a ton of fonts on it and there's another one that was there's a few websites that just specialize in ide fonts code fonts that these are great to look at and they like give you the ability to try it in different with different uh different uh coding for colors code schemes and stuff like that so anyway yeah this has um rodriguez it's got an ide um color you know delphi theme um oh what's it called it basically allows you to pick your idea colors from a predefined list um and that's that's quite good to play around with if you're wanting to experiment um and in terms of the font i use i generally use consoles because it's you know on every machine and i don't i don't particularly like the courier new font for coding if you channel that we had a conversation i want to ask the other day in one of the vp groups at suggested oh why doesn't the id change your way from um this font to this font and it was amazing how people like no no no i like it just the way it is people were like no things change it is not the answer is definitely a preference yeah you start start talking about um configuring development environments and you snap with a religious war that's people people have very strong opinions about um you know fonts and colors and layouts and all that kind of thing um any ideas how we can motivate the new generation of developers to use our wonderful delphi you know honestly do it and i will answer this because it's something i think is important as well but just find opportunities to talk to people about it and share your experience even even if you don't feel like everything to share start a blog it's amazing how useful that can be um twitter and facebook and all that kind of thing i mean you don't have you don't have to start your own blog you just do some posts on social media um it's you know you probably already have a facebook account so yeah although i will i will recommend having a blog is way more useful than just being on social media especially facebook um because with a blog you are better able to own your content right it becomes attached to this and whereas facebook people have to be logged into facebook same thing with linkedin if they're not logged into linkedin linkedin will be like nope you can't read that so and also you know um linkedin and facebook they don't index and google very well and often uh it's if you're just have a blog to record um how to do things for you just for yourself effectively and just make it public um that could be quite handy because you know you often have you might come back years later uh having to make some sort of change and having a blog post reminding you how to do it this can be quite helpful yep um so yeah just i'm actually talking with um i volunteered to speak with a group it's online but it's a local group that's taking doing a class in software development um next week after next so you know talk in your look look out in your community see who you can find there's always places you can find people that are would love to hear from somebody with some experience and uh you know tell them hey this is delphi this is why it's awesome and actually adam's not here so adam is uh i think he's not here he's gone yeah he's left he's starting the next session but he uh he's a younger guy and he took computer science in school and then went to the air force and now he's doing an internship transitioning back from the air force and in school he's like hey i want to make a windows application like oh no it's okay you'll do that later and he's like was frustrated because he's like i want to do something that's useful besides all these console applications and so i'm like well here let me show you how to use delphi c plus plus builder and he was like oh my goodness this is amazing and he's deploying apps to his android phone on his windows device and just all over the place and he's like i spent four years in school they never got to this so you know there is a lot of a lot of demand people want to know how to do this and they're just being told it's hard but it's not yeah delphi the the um the effort to get like the basic application running is really small um and you know just about you can plug in your android phone and say deploy to end deploy to android and go for it it's it's really really good in that respect um and yeah i i'm quite quite a fan of delphi's um how quickly you can get an application written i mean you know you saw in that video that um just the you know downloading all the um jpeg strings in a web page was was quite trivial you know it doesn't require any lines of code um so long as you know you know familiar with you know in this case regular expressions and the rtl um it becomes a trivial exercise so the comment here that about learning the alt left and alt-right not political but just the keyboard shortcuts um was very useful because he uh his the back and forward button disappeared from id and one not again back and that's just you should be able to al right click on the toolbar and select browser i think is what it is yeah the browser yeah yeah and that should bring him back or maybe it's possible it's off the screen someplace i don't know but that would be the probably definitely um you know every time you you reach for the mouse to go for some menu item or something like that take note of the um the keyboard shortcut and then use that instead yes and then eventually we'll just be using the keyboard shortcuts because reaching for the mouse is such a product to particular um and i i i know i do it too often um where i could you know just just often you know clicking okay on a dialogue box or something like that but i can just press press enter or spacebar or something but yeah do you are you aware of any um print on demand places where someone might be able to get your book printed locally without having to uh pay for customs and freight i know that so i think fedex and ups is probably international but i don't know it's going to depend on country to country probably yeah you might just be to go i mean if you're happy with like um spiral binding or something like that you could probably just go to a um any print shop i would imagine and yeah i i have you know no problem with you doing that as long as you're just doing it for you know one copy for yourself from the the um electronic version i i think you know i i i love having books but they're not very environmental uh this um you know effectively chopping down trees to make them and then you're shipping them halfway around the world um using you know fuel and resources and stuff like that so um i think print on in terms of books print on demands are an improvement but it's you know i think things are not quite there for reading ebooks as easily as a physical book or feeling as comfortable with a you know i i you know i have a kindle and an ipad and stuff like that but i still i still much prefer reading from physical book although i did most of my reading from you know electronically these days yeah um i would love to use regex more but the problem i always found with using regex is very quick and sometimes trying to work out how to write an expression correctly can take longer than very cryptic yeah that is so true there are a few good resources that i have bookmarked that i use and i can't remember what they are handed and i can't bring it it's regex101.com or something like that and a few others um that you can you know test test out your uh regular expressions on and often i mean the regular expression i used um i basically just googled it and i found one that was similar that i had to modify slightly um to get it to what i want i'm certainly not an expert with regular expressions um i definitely would like to become more expert with them because they're incredibly powerful if you're doing any kind of string manipulation they uh um yeah much much easier than writing raw raw delphi code and um probably a lot faster as well they're optimized yeah i would i would suggest you know you find a good few resources you like to use and then practice and you'll get better at it but then also and i've made the same mistake where i spent way too long on trying and it's like i think i should just done this a long way so you got to kind of just pay attention how much time you're going and say okay i'm just going to get this done because shipping is a future yeah i mean in the long run you know you're going to be slower learning learning how to use regular expressions initially but once you've um you've got a few under your belt um the they can become easier to understand yeah yeah do you happen to know if there's a way to have double click and drag selection in the ide work like other places of windows for example uh if you double click a word and keep the mouse button pressed you can drag to select text one word at a time i'm not we're not aware of that shortcut in terms of yeah um yeah i suppose you could and create an issue on call of duty and backu.com and uh see if you can get that uh implemented but um no i'm not not aware of of that but it's an interesting interesting thing i i'd use um uh hold down the control key so control shift and the arrow keys to select by word so i select a whole word at a time yep again use the arrow keys use the keyboard um okay uh let's see regex buddy is written in delphi yes the redrix buddies um it's written by uh he's written um oh is it hanging yeah hang on have to google it yeah i can't remember his name but he's got also got a book um on using regular expressions rick ridgex regular expression cookbook i think it's called yeah he has a website too that's really good i think it's regular dash expression um but i can't remember so uh bruce that was exactly my thought um regarding regex when you have a problem and go to use regex then now you have two problems [Laughter] um and that's it's reg x is one of those things that you have to be careful because you don't want it to become another problem to maintain because it is complicated and this kind of goes back to the reason i love no fi is because the code is so easy to read and that's one problem with reg is it's not necessarily easy to read and not necessarily easy to maintain and change so that that can be tricky yeah i mean it is a whole little whole other language to learn so um yep let's yeah i ran into somebody that was using some programming language i can't i think it was called apl or something that was like just this cryptic symbols thing and i'm like this is a good language to use he's like oh yeah i love it like yeah yeah i suppose um in terms of like mathematical stuff uh some symbolic type stuff is quite quite good but um if you're into just kind of love programming there's a webinar or a talk called the art of code that was given at ndc earlier this year right before lockdown i highly recommend it he gets into a lot of esoteric programming languages and even made his own called rock star the idea of being anybody can call him learn star and become a rock star developer so i highly recommend that talk uh if i find here i'll put it in here i think that's it for the questions um do you see any questions that i haven't answered um yeah nothing that i can immediately immediately answer but okay um all right fantastic well thank you alistair i i do recommend alex's book by the way it's good stuff um i i like it but i don't know sometimes i feel like i'm biased but i don't know why i think that but everybody else i've talked to has read it it loves it as well and just finds it incredibly useful so yeah there's quite a few reviews on it now which is quite nice good if you get a code um you know is it uh learningdef.tv faster um there's some links to reviews in there if you're uh just you know wanting a second opinion on it fantastic and you know in a book like we said honestly a book is one of those things that you know it's not that expensive really and you're going to get something out of it that's going to pay for it so quickly like i said i get i feel like there's things i know that i see aleister do videos about i'm like you could i didn't know that it's almost embarrassing i must admit uh oh i'm not i'm certainly um not not you know i can be guilty of that as well in terms of um as you know with the component component was wizard which i completely forgot about in one of the one of those videos but oh here's one more question i missed uh from does control cf0 work in the latest version of delphi oh i don't know i generally don't get up that far in terms of the the bookmarks um i think so but there is a there is the bookmarks at parnassus add-in that changes bookmarks behavior that's highly recommended if you're not using that um there's a couple of those pronounced book plugins and get it that are free now that are highly recommended no control shift zero does not work okay so but it do you have the paranasis uh bookmarks and navigator installed um i don't have it installed currently i i um yeah both of those uh excellent add-ins to the ide and i mentioned them in the book um at the moment i've just got a clean installer definitely 10.4 um i try not to have too much you know when making videos which is kind of what i've mostly been doing lately yeah i'm the same way too much installed which is kind of annoying because i i miss out on you know there's some shortcuts and things that i i do automatically that um are just not there because i didn't have them installed yeah okay well thank you so much uh alistair and thanks for brails for joining us and uh we have the migration upgrade migration webinar going on now oh kristen just posted it the link to the art of code dalen beatty yes beatty great stuff uh fantastic uh yan govetts yo vets in your covets i probably pronounced his name where's the guy that wrote red red checks buddy yes yes that's right okay all right is that it comment on keyboard shortcuts they are dependent on your uh nation or i guess your your local internationalization settings based on us keyboard and norway with multinational keyboards all such keys are almost always some other key so that would be frustrating that would be frustrating i i've been at events where someone's had a laptop that had an international keyboard and they're like here can you show me how to do this and i'm like i'm like whoa hold on i don't know how to use this keyboard it's confusing me yeah yeah indeed i've had that with um we have just a a simple example that um we have uh woofers which are uh willing willing workers on organic farms live in our lifestyle block and they come and stay with us occasionally not currently because we're in the middle of a pandemic yes um and yeah they'll you know they pass me their phone to type in the wi-fi password and it's like um it's it's really hard not not to do the the qwerty kind of layout like i almost reach even though it's a touch screen you know i'm actually looking at the keys um i'm still my my finger still wants to go to the uh the qwerty layout rather than the whatever the french or german layouts are there is so the quick comment here about the tools api being more documented we're actually working on a project to do exactly that and to build some libraries to get people started with that so stay tuned yeah i think it's actually publicly accessible now you have a small section in my book and there's a couple of links that have there are a couple of um articles that have quite in-depth um discussion of the open tools api uh which would be worth worth reading let's see if i can find so while you're looking at mark said that uh he likes both print and digital sometimes he likes to have it on the second screen other times he just likes to feel a physical book i agree and then he comments uh p.s i'm old so i will tell you mark my kids do not like ebooks i bought them all ebook readers a few years ago because i wanted to encourage them to read and they just nope it's got to be a physical book and now they've all got smartphones and tablets but nope their reading is all physical books okay um i'll try to find and find that it was the find the open tools api um question i'm just near the bottom i think um it was right at the top of the hour right one o'clock my time so oh i'll just paste it into the general chat yep that works um oh it didn't work so there's two two articles there so he's commented they say notice the project on the github that mvp's working on the so you can uh do pull requests in by invite only for contributing but you can always do a pull request on github um and then someone can review it and potentially add it um and potentially we can add you as well if you want to be alessandro so um send me an email or talk to someone that's in part of the project and uh as well as possibility so it was mostly just yeah we weren't trying to exclude people we just didn't want to include everybody with right accents but uh certainly if you do a pull request or if you have a lot you want to contribute we can talk to you okay um all right let's go ahead and wrap up before we get more questions thank you so much aleister and for all you do and uh for the book and thank you everybody for joining us and we are all looking forward to your code better book yes indeed me too catch you all later yep bye you
Info
Channel: Embarcadero Technologies
Views: 7,122
Rating: 4.9781423 out of 5
Keywords: Code Faster in Delphi, mobile development, embarcadero technologies, application development, Delphi, C++Builder, C++, Databases, InterBase, SQL, Pascal, Object Pascal, Delphi (Programming Language), Windows Programming, iOS Programming, Android Programming, Linux Programming, DelphiCon 2020, delphicon programmer, embarcadero, programming, delphi programming tutorial, delphi programming, rad studio, delphi tutorial, delphi programming tutorials, how to program delphi, how to delphi
Id: bniIeFPk-zU
Channel Id: undefined
Length: 69min 12sec (4152 seconds)
Published: Thu Jan 28 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.