The name of the list is meaningless as there can be lists by the same name all over a site. You would need the Url to the list in order to be able to resolve it to a Guid. However, the mechanics of this vary wildly depending on what you mean by "programmatically". In PowerShell it would be something like this and the server object model would be similar.
$site = [Microsoft.SharePoint.SPSite]($UrlTolist)
$web = $site.OpenWeb()
$list = $web.GetList($UrlToList)
Getting the ID via Web Services or the client object model would be completely different.