<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Style Guide &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/style-guide/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Sun, 03 May 2020 13:07:24 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[原创] Style Guide中文翻译（Google Protocol Buffers中文教程）</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-style-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-style-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 14 Sep 2010 05:30:16 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Buffer]]></category>
		<category><![CDATA[Google Protocol Buffers]]></category>
		<category><![CDATA[Protocol]]></category>
		<category><![CDATA[Protocol Buffer]]></category>
		<category><![CDATA[Protocol Buffers]]></category>
		<category><![CDATA[Style Guide]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[教程]]></category>
		<category><![CDATA[翻译]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=305</guid>

					<description><![CDATA[<h1>
	<b><span style="font-size:20.5pt;Helvetica&#34;,&#34;sans-serif&#34;;
color:black;">Style Guide </span></b><b><span style="font-size:20.5pt;color:blue;">风格指南</span></b></h1>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;">
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
		<span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span" color="#000000">注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（</font><strong><span style="color:#ff0000;"><font class="Apple-style-span">转载须注明出处</font></span></strong><font class="Apple-style-span" color="#000000">：本文来自learnhard的博客：<a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); " target="_blank" rel="noopener noreferrer"><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://www.codelast.com/</span></a>&#38;&#160;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</font></span></span></div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
<span id="more-305"></span>	</div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&#34;,&#34;sans-serif&#34;;color:black;">This document provides a style guide for&#160;</span><span style="font-size:10.0pt;Courier New&#34;;
color:#007000;">.proto</span><span style="font-size:12.0pt;Helvetica&#34;,&#34;sans-serif&#34;;color:black;">&#160;files. By following these conventions, you&#39;ll make your protocol buffer message definitions and their corresponding classes consistent and easy to read.</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">本文档提供了</span></b><b><span style="font-size:12.0pt;Helvetica&#34;,&#34;sans-serif&#34;;
color:blue;">.proto</span></b></font></div></div>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-style-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<h1>
	<b><span style="font-size:20.5pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">Style Guide </span></b><b><span style="font-size:20.5pt;color:blue;">风格指南</span></b></h1>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"></p>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
		<span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span" color="#000000">注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（</font><strong><span style="color:#ff0000;"><font class="Apple-style-span">转载须注明出处</font></span></strong><font class="Apple-style-span" color="#000000">：本文来自learnhard的博客：<a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); " target="_blank" rel="noopener noreferrer"><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://www.codelast.com/</span></a>&amp;&nbsp;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</font></span></span></div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
<span id="more-305"></span>	</div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">This document provides a style guide for&nbsp;</span><span style="font-size:10.0pt;Courier New&quot;;
color:#007000;">.proto</span><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">&nbsp;files. By following these conventions, you&#39;ll make your protocol buffer message definitions and their corresponding classes consistent and easy to read.</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">本文档提供了</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;">.proto</span></b><b><span style="font-size:12.0pt;
color:blue;">文件的书写风格指南。通过遵守这些约定，你的</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;">protocol buffer</span></b><b><span style="font-size:
12.0pt;color:blue;">消息定义和它们的对应类将会风格一致且易于阅读。</span></b></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		&nbsp;</div>
<div style="border:none;border-top:solid #3366CC 1.0pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<div align="left" style="margin-top:24.0pt;text-align:left;background:#E5ECF9;border:none;padding:0cm;">
			<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:15.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">Message And Field Names </span></b><b><span style="font-size:15.0pt;color:blue;">消息和字段名</span></b></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">Use CamelCase (with an initial capital) for message names &ndash; for example,&nbsp;</span><span style="font-size:10.0pt;Courier New&quot;;
color:#007000;">SongServerRequest</span><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">. Use underscore_separated_names for field names &ndash; for example,&nbsp;</span><span style="font-size:10.0pt;Courier New&quot;;color:#007000;">song_name</span><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">.</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">消息名使用驼峰格式（每个单词首字母大写）来书写&mdash;&mdash;例如</span></b><span style="font-size:10.0pt;Courier New&quot;;
color:#007000;">SongServerRequest</span><b><span style="font-size:12.0pt;color:blue;">。字段名使用小写的下划线分隔式（</span></b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">underscore_separated_names</span><b><span style="font-size:12.0pt;color:blue;">）来书写&mdash;&mdash;例如</span></b><span style="font-size:10.0pt;Courier New&quot;;
color:#007000;">song_name</span><b><span style="font-size:12.0pt;
color:blue;">。</span></b></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		&nbsp;</div>
<div style="border:solid #BBBBBB 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA">
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">message SongServerRequest {</span></font></div>
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">&nbsp;required string song_name = 1;</span></font></div>
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">}</span></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">Using this naming convention for field names gives you accessors like the following:</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">字段名使用这种形式的命名约定的话，生成的访问类中的函数就有如下形式：</span></b></font></div>
<div style="border:solid #BBBBBB 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA">
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:black;">C</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">++:</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;
color:black;"> </span>&nbsp;<span style="font-size:9.0pt;Courier New&quot;;
color:#000088;">const</span><span style="font-size:
9.0pt;Courier New&quot;;color:#000088;">string</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">&amp;</span><span style="font-size:9.0pt;Courier New&quot;;color:black;"> song_name</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">()</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">{</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">...</span><span style="font-size:
9.0pt;Courier New&quot;;color:#666600;">}</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span>&nbsp;<span style="font-size:9.0pt;Courier New&quot;;
color:#000088;">void</span><span style="font-size:9.0pt;Courier New&quot;;
color:black;"> set_song_name</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">(</span><span style="font-size:
9.0pt;Courier New&quot;;color:#000088;">const</span><span style="font-size:9.0pt;Courier New&quot;;color:#000088;">string</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">&amp;</span><span style="font-size:9.0pt;Courier New&quot;;
color:black;"> x</span><span style="font-size:
9.0pt;Courier New&quot;;color:#666600;">)</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">{</span><span style="font-size:
9.0pt;Courier New&quot;;color:#666600;">...</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">}</span></p>
<p>			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span><span style="font-size:9.0pt;Courier New&quot;;color:black;">Java</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">:</span><br />
			<span style="font-size:
9.0pt;Courier New&quot;;color:black;"> </span>&nbsp;<span style="font-size:9.0pt;Courier New&quot;;
color:#000088;">public</span><span style="font-size:9.0pt;Courier New&quot;;
color:black;"> String getSongName</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">()</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">{</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">...</span><span style="font-size:
9.0pt;Courier New&quot;;color:#666600;">}</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span>&nbsp;<span style="font-size:9.0pt;Courier New&quot;;
color:#000088;">public</span><span style="font-size:9.0pt;Courier New&quot;;
color:black;"> Builder setSongName</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">(</span><span style="font-size:
9.0pt;Courier New&quot;;color:black;">String v</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">)</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">{</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">...</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">}</span></font></div>
</p></div>
<div style="border:none;border-top:solid #3366CC 1.0pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<div align="left" style="margin-top:24.0pt;text-align:left;background:#E5ECF9;border:none;padding:0cm;">
			<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:15.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">Enums </span></b><b><span style="font-size:
15.0pt;color:blue;">枚举</span></b></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">Use CamelCase (with an initial capital) for enum type names and CAPITALS_WITH_UNDERSCORES for value names:</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">枚举名使用驼峰格式（每个单词首字母大写）来书写，值名使用大写的下划线分隔式（</span></b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">CAPITALS_WITH_UNDERSCORES</span><b><span style="font-size:12.0pt;color:blue;">）来书写：</span></b></font></div>
<div style="border:solid #BBBBBB 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA">
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#000088;">enum</span><span style="font-size:9.0pt;Courier New&quot;;color:black;"> Foo </span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">{</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span><span style="font-size:9.0pt;Courier New&quot;;color:black;">&nbsp; FIRST_VALUE </span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">=</span><span style="font-size:9.0pt;Courier New&quot;;color:#006666;">1</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">;</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span><span style="font-size:9.0pt;Courier New&quot;;color:black;">&nbsp; SECOND_VALUE </span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">=</span><span style="font-size:
9.0pt;Courier New&quot;;color:#006666;">2</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">;</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;
color:black;"> </span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">}</span></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">Each enum value should end with a semicolon, not a comma.</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">每一个枚举值都应该以分号结尾，而不是逗号。</span></b></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></div>
<div style="border:none;border-top:solid #3366CC 1.0pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<div align="left" style="margin-top:24.0pt;text-align:left;background:#E5ECF9;border:none;padding:0cm;">
			<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:15.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">Services </span></b><b><span style="font-size:15.0pt;color:blue;">服务</span></b></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">If your&nbsp;</span><span style="font-size:10.0pt;Courier New&quot;;color:#007000;">.proto</span><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">&nbsp;defines an RPC service, you should use CamelCase (with an initial capital) for both the service name and any RPC method names:</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">如果你的</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;">.proto</span></b><b><span style="font-size:12.0pt;
color:blue;">文件定义了一个</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;">RPC</span></b><b><span style="font-size:12.0pt;
color:blue;">服务，那么服务名和任何</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;">RPC</span></b><b><span style="font-size:12.0pt;
color:blue;">函数名都应该使用驼峰格式（每个单词首字母大写）来书写：</span></b></font></div>
<div style="border:solid #BBBBBB 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA">
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">service FooService {</span></font></div>
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">&nbsp;rpc GetSomething(FooRequest) returns (FooResponse);</span></font></div>
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">}</span></font></div>
</p></div>
</div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
		<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-style-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
