{"action":"created","issue":{"url":"https://api.github.com/repos/PoshCode/PowerShellPracticeAndStyle/issues/30","repository_url":"https://api.github.com/repos/PoshCode/PowerShellPracticeAndStyle","labels_url":"https://api.github.com/repos/PoshCode/PowerShellPracticeAndStyle/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/PoshCode/PowerShellPracticeAndStyle/issues/30/comments","events_url":"https://api.github.com/repos/PoshCode/PowerShellPracticeAndStyle/issues/30/events","html_url":"https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/30","id":82695984,"number":30,"title":"Maximum line length indicator","user":{"login":"dlwyatt","id":5107604,"avatar_url":"https://avatars.githubusercontent.com/u/5107604?v=3","gravatar_id":"","url":"https://api.github.com/users/dlwyatt","html_url":"https://github.com/dlwyatt","followers_url":"https://api.github.com/users/dlwyatt/followers","following_url":"https://api.github.com/users/dlwyatt/following{/other_user}","gists_url":"https://api.github.com/users/dlwyatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dlwyatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlwyatt/subscriptions","organizations_url":"https://api.github.com/users/dlwyatt/orgs","repos_url":"https://api.github.com/users/dlwyatt/repos","events_url":"https://api.github.com/users/dlwyatt/events{/privacy}","received_events_url":"https://api.github.com/users/dlwyatt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PoshCode/PowerShellPracticeAndStyle/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/PoshCode/PowerShellPracticeAndStyle/labels/Style%20Guide","name":"Style Guide","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-30T04:30:15Z","updated_at":"2016-04-04T12:37:29Z","closed_at":null,"body":"Does anyone know of an add-on for the ISE that will display an indicator of some sort on a specified column?  Without that, I don't think it's a good idea to include a maximum line length item in the style guide.  While other editors such as Sublime Text offer this, the ISE is pretty much the de facto script editor for the majority of the PowerShell community.\r\n\r\nSure, you can look for the tiny \"Line #, Col #\" text in the status bar, but it's annoying to have to constantly shift your eyes down there to know whether you've crossed the boundary."},"comment":{"url":"https://api.github.com/repos/PoshCode/PowerShellPracticeAndStyle/issues/comments/205279557","html_url":"https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/30#issuecomment-205279557","issue_url":"https://api.github.com/repos/PoshCode/PowerShellPracticeAndStyle/issues/30","id":205279557,"user":{"login":"KirkMunro","id":3515485,"avatar_url":"https://avatars.githubusercontent.com/u/3515485?v=3","gravatar_id":"","url":"https://api.github.com/users/KirkMunro","html_url":"https://github.com/KirkMunro","followers_url":"https://api.github.com/users/KirkMunro/followers","following_url":"https://api.github.com/users/KirkMunro/following{/other_user}","gists_url":"https://api.github.com/users/KirkMunro/gists{/gist_id}","starred_url":"https://api.github.com/users/KirkMunro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KirkMunro/subscriptions","organizations_url":"https://api.github.com/users/KirkMunro/orgs","repos_url":"https://api.github.com/users/KirkMunro/repos","events_url":"https://api.github.com/users/KirkMunro/events{/privacy}","received_events_url":"https://api.github.com/users/KirkMunro/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T12:37:29Z","updated_at":"2016-04-04T12:37:29Z","body":"IMHO, recommending 80 as the max line width is like recommending 1024x768 as the recommended desktop resolution.  Widescreen monitors/screens = better support for longer lines, even with larger fonts.  Plus, PowerShell is a verbose language where descriptive variable names and command names is encouraged.\r\n\r\nSome modules have very large command sets, and very long names to clearly identify command intent within those command sets.  Take AzureRM, for example -- it's not the poster boy we want for PowerShell right now, but looking at all commands on my system and identifying the top 10 in terms of command length, and every command in that top 10 comes from some Azure module (AzureRM.NotificationHubs, AzureRM.Sql, Azure, AzureRM.OperationalInsights, AzureRM.SiteRecovery.  The longest command name, Remove-AzureRmNotificationHubsNamespaceAuthorizationRules, is 57 characters long.  Place that inside of a function that properly indents and wraps inside of a begin, process, or end block with a try/catch {$PSCmdlet.ThrowTerminatingError($_)} and right off the bat you're at 69 characters, and that's without using any parameters or assigning results to a variable or placing the call in a condition or loop statement.  In other .NET languages like C# you might have something along the lines of AzureRm.NotificationHubs.NamespaceAuthorizationRules.Remove(...) that could be split across multiple lines at the dot reference operator, but unfortunately not in PowerShell.  This is an extreme example, but it is a good one because it highlights that a short recommended line length is appropriate in a language with more tokenizable command names, but in a language with very long command names where verbosity is encouraged, 80 characters is simply too short.\r\n\r\nAll that said, I wouldn't personally back a recommendation for anything less than 110 characters as the recommended line length, and my preference would be for 120 characters (which is a value that I think makes much more sense given the default buffer width in the PowerShell console is 120 characters)"}}