Comments (11)
Generally speaking, I'm 👍 for ID
and Href
. Yes, Href
technically stands for two words. However, ID
technically stands for one word, yet is treated like an acronym. We have some freedom in mangling names ;)
from vecty.
Sounds like we all agree to go with ID
and Href
, I've created #32 to switch to ID
. PTAL.
from vecty.
How does the recent Element
-> Elem
and Property
-> Prop
change tie in here?
I might be missing contedxt, but Href
, Id
are much more readable to me (being familiar with HTML lingo) than HypertextReference
and Identity
... Unless they're supposed to represent something else?
from vecty.
For example, we rename the <h1>
tag to become elem.Header1
here: https://github.com/gopherjs/vecty/blob/master/elem/generate.go#L34
I agree that Href
and Id
are more readable.. and that makes me uncertain of the naming scheme/remapping used by the elem
event
and style
packages.
from vecty.
Rob Pike: Length is not a virtue in a name; clarity of expression is.
For example Header1
instead of H1
conveys a lot more information. But what the heck does a HypertextReference
do? ;-) I think href
is so common, everyone knows it.
However, it might be good to stay consistent, at least inside of each package. I opted for longer element names because the acronyms of HTML tags are really bad and some of them already have longer class names in the DOM API. Properties and styles however already have proper names in the DOM API, so I think we should keep them.
from vecty.
Go's vet tool will complain about Id
and suggest ID
, at least in vars like elementID
.
from vecty.
@neelance thanks for clearing this up :) I think what you said makes sense, and from creating this issue that is exactly what I wanted to find out: what exactly is the name remapping pattern? I think you answered that clearly and I'm happy with it 👍
@neelance @bep maybe we should Id -> ID
and Href
-> HRef
?
from vecty.
I watch this repo with interest as this is something I need and want, so I have no strong meaning about this. But getting the names right before people start using it saves a lot of trouble in the long run. I did a major naming cleanup of the API of Hugo a couple of months ago ... A lot of work with all the themes etc ...
from vecty.
Id -> ID
Definitely. Consider honnef.co/go/js/dom
a good example (/cc @dominikh). It has GetElementByID
not getElementById
.
About Href
, I'm unsure that HRef
is better. I consider "href" to be one weird word. Also see https://godoc.org/honnef.co/go/js/dom#HTMLLinkElement.Href.
from vecty.
About Href, I'm unsure that HRef is better. I consider "href" to be one weird word. Also see https://godoc.org/honnef.co/go/js/dom#HTMLLinkElement.Href.
FWIW I agree with your stance and think that Href
reads better than HRef
. But, we're being inconsistent, because href
does stand for Hypertext Reference
(two words), so... maybe we can blame HTML naming horror 😱
from vecty.
I also consider Href
as a weird word, same as @shurcooL.
from vecty.
Related Issues (20)
- [Question]: How to contribute? HOT 11
- Add a basic example on usage HOT 5
- allow global panic handler HOT 2
- removeChild crashes if parent node is nil HOT 1
- [feature request] static HTML/CSS components HOT 6
- Examples go.mod file conflict HOT 1
- Add snake videogame example. HOT 4
- question: What is this prop vs. state idea HOT 3
- Instrumenting panic messages HOT 8
- question: initializing rendered HTML nodes via javascript HOT 4
- Porting gopherjs js calls to use with vecty HOT 2
- Document the availability of vecty project template generator HOT 1
- Return type of If function
- prop.Value("") does not produce the correct html on first render
- Vecty needs an official website HOT 10
- The slack invite link in readme is broken
- vecty docs HOT 1
- How to update a rendered element? HOT 10
- Failed Running The Example HOT 8
- Todo MVC example has misleading usage of p.Items HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vecty.