9,407 reputation
12141
bio website
location
age
visits member for 3 years, 8 months
seen 29 secs ago

May
22
comment When do 'static functions' come into use?
@Ela782 Yeah, it could make a fine question. Two quick points: In C++ specifically, static members are useful for template meta programming since you can pass a type as template parameter but not a namespace. In general, static functions can be used to indicate that the function really closely belongs to some class, as opposed to just belonging in a namespace (think stuff::Thing::Load(...) vs stuff::LoadThing()).
May
22
comment When do 'static functions' come into use?
@Ela782 If the language has free functions, yes.
May
22
comment Why not embed styles/scripts in HTML instead of linking?
@gman When the SPA retrieves static resources lazily (e.g. to keep the initial page load bearable for large applications), you're back to square one. If the SPA embeds all CSS and JS eagerly, you can indeed inline it, but have to set the cache policy of the main site appropriately. When you link to CSS/JS, you can let the browser cache those files basically forever and just change the file name when something changes. You can't cache the main page as aggressively (to avoid people seeing outdated versions), regardless of whether you inline CSS/JS or not.
May
21
comment How faster could a dedicated chip do sequential squaring modulo operations to break a time crypto capsule?
The algorithm is literally just squaring and reduction modulo some large n. That only requires the values of n, t (peanuts, a few thousand bits each). Perhaps the multiplication and modulo algorithms used require some tables, but if so you could probably hard-code them into the FPGA program.
May
20
comment Modifying an open-source license with optional requests
I see absolutely zero reason to put this in the license. In fact, it seems completely out of place there. Note that putting it in the license would in many cases not guarantee propagation: Unless the license is copyleft, any fork could alter the license to omit this clause.
May
20
comment How can I group commits in a version control system such as git
A user interface could probably group commits for display and navigation. But it doesn't seem universally useful enough to hard-wire in the (very general and workflow-agnostic) core.
May
19
comment What is the responsibility or benefit of a Tokenizer?
@Doval Scannerless parsing is a thing. Such a parser does not necessarily have explicit tokens; there may be implicit knowledge like "I'm currently parsing a string literal" in what grammar rules are currently being applied, but otherwise it goes string -> parse tree.
May
19
comment Should I feel “uncomfortable” using auto in C++?
/strongly/statically/g, the former means absolutely nothing.
May
19
comment What is the responsibility or benefit of a Tokenizer?
@MattFenwick I'm doing no such thing. I'm pointing out that tokens are treated as important (in the same general category as parse trees, IRs and final code generated) by a whole lot of literature, including literature that has no business talking about optimizations. Even the most generous reading of your answer is in disagreement with this fact, so possible conclusions are: People write far too much about what is just an implementation detail and a optimization, or your characterization as just that doesn't do tokens justice. That argument does not hinge on you to believe or imply either.
May
18
comment Is adding support for another operation system a minor version or a patch?
I'd say adding support for a whole new platform is adding a feature.
May
16
comment What is the responsibility or benefit of a Tokenizer?
@supercat Can you point to an existing implementation of this? I suspect that the synchronization overhead eats any advantage, in particular since in most compilers, tokenization is far from a bottleneck. Conventional serial optimizations are probably more fruitful.
May
16
comment What is the responsibility or benefit of a Tokenizer?
If it was simply a performance optimization among many, it would not be such a major part of parsing. It's often presented as a core part of the design of a language implementation, one fully-fledged stage in the compilation pipeline along with parsing, semantic analysis, code generation and the like. This even extends to pure exposition that doesn't try to equip the reader to write their own, only tell them how compilers work. Unless most people who write about the topic have very poor judgement on what's essential and what's not, this hints at tokens being more than just an optimization.
May
16
awarded  Enlightened
May
16
awarded  Nice Answer
May
16
comment Benefits of Java in education?
@Doval Put down the torch, asbestos suits are pretty uncomfortable. (Read: Evangelism is off topic here and may cause flame wars.)
May
16
answered What is the responsibility or benefit of a Tokenizer?
May
15
comment Why do arrays in Java not override equals()?
Note that for use in a HashSet they'd have to override hashCode accordingly too. And when the hash code of an object changes over its lifetime, you run into trouble (one set-specific example: you might wind up with duplicate entries).
May
15
comment Benefits of caching the count of items in a data structure versus on-demand calculation?
Option #1 also has the potential for bugs, in the traversal code (which will likely be a separate from the traversals necessary to manipulate the data structure.
May
13
comment Why does Java support brackets behind variables and even behind method signatures?
@Izkata That idea is called "declaration mirrors usage" and it's the reasoning behind C's declaration syntax. But decades of experience have shown it to not work nearly as well in practice. It doesn't scale well to more complex types, it clashes with the (quite reasonable and common) mental model that a declaration is just type name, name, ...; and when you have prefix "type operators" like * in C, you need operator precedence for them which increases ambiguity (int *is[] vs int (*ps)[]).
May
12
comment Why does Java support brackets behind variables and even behind method signatures?
If this is the worst idea in language design you have seen in decades, you either have a serious problem with hyperbole or you've not spent a lot of time on language design.