TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Name before type: why ‘age int’ is better than ‘int age’

3 pointsby benhoytalmost 2 years ago

4 comments

rowanG077almost 2 years ago
Honestly I really don&#x27;t get people who are obsessed with this. Static vs dynamic? That matters A LOT! Error handling style? Very important. Expression based vs statement based? Now you are talking.<p>but whether a type is before or after the name of a variable? Come one man.,,
评论 #37035232 未加载
评论 #37027464 未加载
dchestalmost 2 years ago
Another example.<p>Jumpy Dart:<p><pre><code> (String, int) userInfo(Map&lt;String, dynamic&gt; json) int userAge(String name) </code></pre> Regular Swift:<p><pre><code> func userInfo(_ json: Dictionary&lt;String, Any&gt;) -&gt; (String, Int) func userAge(_ name: String) -&gt; Int</code></pre>
Someonealmost 2 years ago
FTA: “In C, the following declares x to be a pointer, but (surprisingly at first!) y to be a normal integer:<p><pre><code> int* x, y; </code></pre> Whereas the equivalent in Go does what you’d expect, declaring both to be pointers:<p><pre><code> var x, y *int</code></pre> ”*<p>I don’t see how that’s an argument in favour of <i>`age int`</i> over <i>`int age`</i>. Both C could easily have picked the alternative semantics. Go could have, too:<p><pre><code> var x*, y* int; &#x2F;&#x2F; two pointers var x, y* int; &#x2F;&#x2F; x is an int, y a pointer to int </code></pre> or<p><pre><code> var *x, *y int; &#x2F;&#x2F; two pointers var x, *y int; &#x2F;&#x2F; x is an int, y a pointer to int</code></pre>
Slashbot3almost 2 years ago
type name ....is better, any other arrangement including adding stupid symbols like : ...is just retarded alot of retarded people around these days alot of them took the vax.. because they are retarded.