Teaching C - <AUTHOR> http://blog.regehr.org/archives/1393 <comment><USER2> In my quest to learn C very well over the past few years, I've come to the conclusion that C is best understood if you think about it in terms of the way that an assembly language programmer would think about doing things. An example of this would be if you consider how switch statements work in C. Switch statements in C don't really compare to switch statements that you find in other languages (eg. [https://en.wikipedia.org/wiki/Duff%27s_device](https://en.wikipedia.org/wiki/Duff%27s_device)).

The issue that many students face in learning low level C, is that they don't learn assembly language programming first anymore, and they come from higher level languages and move down. Instead of visualizing a Von Neumann machine, they know only of syntax, and for them the problem of programming comes down to finding the right magic piece of code online to copy and paste. The idea of stack frames, heaps, registers, pointers are completely foreign to them, even though they are fundamentally simple concepts.

<comment><USER3> > I've come to the conclusion that C is best understood if you think about it > in terms of the way that an assembly language programmer would think about > doing things.

I don't agree. That leads people to incorrect conclusions like "int addition wraps around on overflow" (mentioned in the article), "null pointer dereferences are guaranteed to crash the program", "casting from a float pointer to an int pointer and dereferencing it is OK to do low-level tricks", and so forth. C is a language that implements _its own_ semantics, not the semantics of some particular machine. Confusing these two ideas has led to lots and lots of bugs, many detailed in John's other blog posts.

It might be useful to teach these intuitions to beginning programmers who _already know_ assembly language before learning C (though are there more than a vanishingly few number of those anymore?) But teaching assembly language as part of, or as some sort of prerequisite for, teaching C strikes me as a waste of time and likely to lead to wrong assumptions that students will eventually have to unlearn.

<comment><USER4> I agree with both of you to some extent. Despite the fact that C implements its own semantics, those semantics are downright bizarre and hard to gain intuition about unless you have some mental model of the machine.

For example, here are some of the things that confused me when I first learned C:

        - why isn't there an actual string data type? (just char*)
        - why do some people use "char" to store numbers?
        - whats the deal with pointers?
        - why are pointers and arrays kinda sorta interchangeable?

Until I learned how things work at the assembly language level, I could not gain an intuitive understanding for why C works the way it does.

<comment><USER5> Why do some people store chars to store numbers?

<comment><USER6> They need a char-sized number, and memory used to be a tightly-budgeted commodity.

Reminds me of this story of a game developer who magically got their game under the limit at the 11th hour

[http://www.dodgycoder.net/2012/02/coding-tricks-of-game- deve...](http://www.dodgycoder.net/2012/02/coding-tricks-of-game- developers.html)

<comment><USER7> Although char should not be used to store numbers, since its signedness is implementation-defined (gcc has the switch -funsigned-chars I think to make them unsigned instead of signed). signed char/unsigned char are ok.

</comment></comment></comment></comment></comment></comment><comment><USER8> Let me add the perspective of an old dinosaur that learned to program before C had been invented.

C maps nearly 1:1 onto simple processor and memory models, and most importantly, gets out of your way and lets you get on with solving your system programming problems. Before C, just about any meaningful system programming task required a dive into assembly language. In that context, C was a huge win. It is also what makes C the langauge of choice for embedded development today.

Of course, system programming problems are not the bread-and-butter of most develpers today -- and a good thing, too. We can now build on top of solid systems and concentrate on delivering value to the customer at much higher levels of abstraction: the levels of abstraction that are meaningful to customers.

I dearly love Python because it allows me to work at levels of abstraction that are meaningful to the user's problem. I dearly love C when I want to wiggle a pin on an ARM Cortex-M3.

In my mind, CS education should start by teaching problem decomposition and performance analysis using a language like Python that provides high levels of abstraction and automated memory management. Then, just like assembly language was a required CS core course back in my day, students today should spend a semester implementing and measuring the performance of some of the data structures that they have been getting "for free" so that they understand computing at a fundamental level. Some will go on to be systems programmers, and will spend more time at the C level. Some won't ever look at C again, and that is OK.

In the end, CS education is about how to solve problems through the application of mechanical computation. The languages will evolve as our understanding of the problems evolve and our ability to create computing infrastructure evolves. CS educcation should be about creating people who can contribute to (and keep up with) that evolution.

<comment><USER9> > I dearly love Python because it allows me to work at levels of abstraction > that are meaningful to the user's problem. I dearly love C when I want to > wiggle a pin on an ARM Cortex-M3

What keeps you from wriggling that pin in Python?

Turing completeness dictates that any Turing complete language is equivalent to any other Turing complete language. In addition, you can do high levels of abstraction in C. The preprocessor and void pointers allow you to do some rather nice things. Structured programming also let you build things up. The advantage that Python enjoys is that it comes with a large number of library functions already provided and there are easily discoverable third party libraries. There are other differences, although every difference has a trade off. Garbage collection bloats memory requirements. Being interpreted means errors that can be caught in advance at compile time occur at runtime.

<comment><USER10> > Turing completeness dictates that any Turing complete language is equivalent > to any other Turing complete language.

Sorry to pick on you, but this is a good example of misuse of this fact in an argument where it's not really relevant. Turing-completeness only relates to functions that take some string as input as produce a string as output (since that's all the turing machine model can do). In contrast, real-world programming languages interact with a machine or operating system, and not all languages provide the same interfaces or even run on the same machines.

I can easily implement a Turing-complete language whose only allowed system calls are reading from stdin and writing to stdout. Despite being Turing- complete, it will never be able to spawn threads, connect to a network socket, or even allocate memory on the heap.

</comment></comment></comment><comment><USER11> I'm currently at uni studying CS and recently finished my 'Programming in C' unit. The teacher from the get-go said it would be challenging compared to other languages that we had used to date (mainly Java) and that quite a few students struggle with it. Once I got my head around pointers and debugging through GBD/Valgrind the unit came immensely enjoyable and rewarding.

We didn't use any fancy IDE's and were told to stick to VIM, we also had to compile with the flags -ansi -Wall -pedantic which alerted you to not only errors but warnings when we compiled our code if it didn't meet the C90 (I think) standards. It was a lot of work crammed into 13 weeks but it had one assignment which I thoroughly enjoyed.

Tic Tac Toe (Ramming home using pointers, 2D arrays, bubble sort for the Scoreboard).

Debugging a bug-riddled program (My favourite).

Word Sorter (Using dynamic memory structures, memory management by having no leaks, etc).

The debugging one was very different from most other assignments I had done at uni to date and the teacher said he recently introduced this assignment because the university had received feedback that students debugging skills weren't the greatest. They could write what they were asked to just fine, but when it came to debugging preexisting issues quite a few struggled. We got given a program with around 15 bugs and you got marks depending on what was causing the bug and a valid solution to fix it. This forced us to use tools such as GBD and Valgrind to step through the program and see where the issue was and to be much more methodical.

I really enjoyed C and when I find a bit of time outside of work and study I'd like to explore it more.

</comment><comment><USER12> A long-standing gripe of mine: When I clicked through to his example "cute little function" in Musl, I found myself mentally adding comments to work through all the "cuteness". If that's the case, IMO, it's either _too_ cute or needs more comments - not sure how much time I've spent picking apart kernel code just to figure out what the hell some of it does, but it's definitely not time well spent.

EDIT: Meant to add: fantastic article, wish my Intro to C instructor had read it...

<comment><USER13> I spent about twenty minutes looking at this function trying to figure out what it does. It looks like it uses a neat trick to compare native integers instead of bytes for speed, but I just couldn't figure out what it does. Then I realised it's part of the standard library and "man memchr" told me what it does...

<comment><USER12> I mean, it's definitely a neat way to optimize comparisons for the CPU's word size. The problem is with completely unexplained things like:

      #define ONES ((size_t)-1/UCHAR_MAX)

Reading through the loop, it seems as though it will create, e.g., 0x01010101 for a 32-bit machine with 8-bit bytes. And sure enough, if you calculate ((2^32)-1)/255 that's exactly what you get. But I never would've known that without going through the code and proving to myself that the definitely of ONES actually makes sense.

If you write code like this and there are never any bugs then fine, I guess. But there will bugs.

<comment><USER7> The whole ONES... HASZERO shenanigans is somewhat explained here: [https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...](https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord) as well as the entry after it.

Edit: And most likely in the excellent book "Hacker's Delight" as well.

</comment></comment></comment></comment><comment><USER14> The core of what makes C elegant is that basically everything that looks atomic is atomic, in the sense of taking O(1) space and memory (at least until C99 introduced its abominable variable-length arrays, and perhaps some other features I'm forgetting about).

Absent macro obfuscation, it is easy to reason about what a snippet of C does and how it translates down to machine code, even taken out of context. In C++, something as innocent as "i++;" could allocate heap memory and do file I/O.

The downside is that C code can become quite verbose, and to do anything useful, it takes a lot of ground work to basically set up your own DSL of utility functions and data structures. For certain applications, this is an acceptable tradeoff and gives a great deal of flexibility. I think teaching this bottom-up approach to programming can be quite useful - in a way, it mirrors the SICP approach, albeit from a rather different angle.

The question is, why are there not more languages that have the same paradigm, but also add basic memory safety, avoid spurious undefined behavior, provide namespaces, with a non-stupid standard library, etc.?

<comment><USER15> Building on pjmp's comment, this quote...

"The question is, why are there not more languages that have the same paradigm, but also add basic memory safety, avoid spurious undefined behavior, provide namespaces, with a non-stupid standard library, etc.?"

...basically just described Modula-3. It meets your requirements, was easy to read, had concurrency, had decent stdlib which had some formal verification, and could act as low-level as you needed with "UNSAFE" keyword. Brilliant design given all tradeoffs it balanced. It had some commercial uptake and was used in CVSup for FreeBSD.

[https://en.wikipedia.org/wiki/Modula-3](https://en.wikipedia.org/wiki/Modula-3)

Note: Important to not ignore it once you see "garbage collection." The GC was optional with a single keyword determining whether you or it handles a specific variable. Let's one pick and choose their battles with fate. :)

Note 2: The Obliq distributed programming language was an interesting project based on Modula-3. The SPIN OS, written in Modula-3, let you link code into a running kernel in a type-safe and memory-safe way for reducing context switches for performance.

<comment><USER16> Much of the code in the fantastic _C Interfaces and Implementations_ [0] is inspired by Modula-3. It's a fantastic book to work through after finishing K&R for anyone wanting to learn how to write safe and reusable C code.

(Regular HN readers will recognize the author of the top review on Amazon.)

[0] [http://www.amazon.com/Interfaces-Implementations- Techniques-...](http://www.amazon.com/Interfaces-Implementations-Techniques- Creating-Reusable/dp/0201498413)

<comment><USER15> Wow. Interesting to see the two converge that way. That's the glowing review I've seen of a book in a while. Guess I'm going to have to get it just in case. :)

</comment></comment></comment></comment><comment><USER17> Great post! Univiersites tend to teach a very small subset of C, just enough to make a tic tac toe application or something silly.

I learned C by myself many years ago but it's only until recent I have been using it for big projects.

Reading Redis' source code was a great aide, xv6 is also amazing to learn systems programming.

Learn C The Hard Way is also a good read, but not as your main book, since it goes too fast. Other invaluable resources are: Beej's Guide to Network Programming and Beej's Guide to Unix Interprocess Communication

A good advanced book is Advanced Programming in the Unix Environment

<comment><USER18> Books I have read so can personally recommend are (in no particular order)

        Programming in C
        C Primer Plus
        K&R (obviously)
        21st Century C
        Modern C (also mentioned in this post)
        Understanding and Using Pointers in C

<comment><USER19> I loved "Expert C Programming: Deep C Secrets" by Peter Van der Linden. Great deep dive on the minutiae of important details (the difference between arrays and pointers as function arguments, etc)

<comment><USER20> I do agree, that book is really great, both very in-depth and at the same time entertaining to read.

Unfortunately, it appears to have been out of print for a while now.

Another book I can highly recommend is "The New C Standard: A Cultural and Economic Commentary" ([http://www.knosof.co.uk/cbook/cbook.html](http://www.knosof.co.uk/cbook/cbook.html)). It takes apart the C language standard (C99) pretty much sentence by sentence, explains what it means and also contrasts how C99 is similar to or different from other languages (C++ mostly, but also, say, Fortran or Pascal).

</comment></comment></comment></comment><comment><USER15> Although a C opponent, I find this to be a good writeup. I hope more C students see it. Particularly, the author focuses on introducing students to exemplar code, libraries with stuff they can study in isolation, and making habit of using checkers that knock out common problems. This kind of approach could produce a better baseline of C coder in proprietary or FOSS apps.

Only thing I didn't like was goto chain part. I looked at both examples thinking one could just use function calls and conditionals without nesting. My memory loss means I can't be sure as I don't remember C's semantics. Yet, sure enough, I read the comments on that article to find "Nate" illustrating a third approach without goto or extreme nesting. Anyone about to implement a goto chain should look at his examples. Any C coders wanting to chime in on that or alternatives they think are better... which also avoid goto... feel free. Also, Joshua Cranmer has a list there of areas he thought justified a goto. A list of great alternatives to goto for each might be warranted if such alternatives exist.

Only improvement I could think of right off the bat on the article outside including lightweight, formal methods like C or stuff like Ivory language immune to many C problems by design that extract to C. Not saying it's a substitute for learning proper C so much as useful tools for practitioner that are often left out. Astre Analyzer and safe subsets of C probably deserve mention, too, given what defect-reduction they're achieving in safety-critical embedded sector.

</comment><comment><USER21> Although this is an interesting post, I'm disappointed from a pedagogical point of view. The article covers these topics, in this order:

1\. What book do we assign?

2\. What should we lecture?

3\. What sort of code review work should we have students do?

4\. What kind of assignments should we use? But only to say that he won't cover it in the article!

This is the almost the exact opposite order of what is most useful in terms of learning. Yes, some people (especially auto-didactic and well-focused students) are able to learn tremendous amounts on their own through books. But they are a relatively poor tool for teaching, compared to active learning methods. Lecture can be great, but usually is passive and worse than useless.

I want to acknowledge the importance of defining what you will teach and what successful (end-of-course) students look like and how to assess them. After you've decided that, it is proper to devise assignments and assessments, and then to decide on lectures and supplemental materials that support students in completing the assignments and assessments successfully. The time students spend should be active and practical - not that readings can't be provided, but they should be on-point and meaningful. Proper application of Instructional Design principles and theories of learning can make a world of difference for students.

But kudos for thinking about it, kudos for thinking about feedback mechanisms, and kudos for

PS: Obviously, I believe C has a great place in the curriculum - shouldn't leave undergrad without it!

</comment><comment><USER22> I love K&R, 21st century C, Understanding C pointers, Deep C secrets but I think they are a little complicated for beginners. I wouldn't bother opening them until you have written a couple of small programs in C or you have good experience in other languages.

When I first learned C in highschool I got a few books on C which all seemed to have the word 'Beginner' in the name. 'Absolute Beginners Guide to C' is one I remember in particular. I think having multiple books is pivotal because as a beginner if you encounter an explanation that doesn't make sense to you it is very hard to reason around it. You probably have very little prior knowledge, almost everything you know and learn up to the point where you get stuck will be contained in that single book, and if you don't know any other languages you can't make any connections to help yourself out. The reason the second, third, or fourth book is so important is that it will have a slightly different explanation that might make something click in your brain.

</comment><comment><USER4> I thought this was an excellent post. C has changed in lots of important ways in the last 10-20 years. The changes are both convenient (far better tooling) and inconvenient (much less forgiving of undefined behavior). Those of us who use C professionally have had to pick up most of these changes by osmosis. This was a really great run-down on how you'd bring a newbie up to speed with the state of the field.

</comment><comment><USER23> '"even what seems like plain stupidity often stems from engineering trade- offs"'

This has truly become something I try to keep in mind, considering a) I've later, sometimes long after starting on someone else's code base, learned a useful rationale for why they did some of the previously more inscrutable things in their code, and b) ended up writing a few things like that myself.

Documentation is key to understanding these systems, but it isn't sufficient. Often you are presented with a nicely documented mega-function, which while anyone can read through, but is very hard to reuse a portion of when needed. In breaking it apart into smaller chunks, you necessarily scatter some of the reasoning about why a particular approach was taken from where it was originally used, or at least where the weird behavior is required. You can either reproduce large chunks of the documentation at many different points in the code base, and hope it doesn't get out of date as the systems it describes in other files is slowly changed, or keep the documentation as fairly strictly pertaining to the code immediately around it, in which case the knowledge of how the systems interact can get lost.

Whenever you encounter code that seems to make no sense, it's better to assume there's some interesting invisible state that you need to grok, than that the programmer was an imbecile or amateur. The latter may be true, but assuming that from the beginning rarely leads to a better outcome.

Edit:

I'll share my favorite example of this. At a prior job, we had a heavily used internal webapp written in Perl circa 1996. It was heavily modified over the years by multiple people, but by the time I was looking in on it in 2012, it was a horror story we used to scare new devs. The main WTF was that it was implemented as one large CGI which eschewed all use of subroutines for labels and goto statements, of which there were copious amounts. The really confusing part was that they were used exactly as you would expect a sub to be used, just with a setting a few variables and a jump instead, so we always scratched our heads as to the reasoning for this. There was even a comment along the lines of "I hate to use goto statements, but I don't know a better way to do this, so we're stuck with this."

Fast forward a couple years, and I'm migrating the webapp to a newer system and Perl, and I discover the reason for this. At some point it was converted to be a mod_perl application, and the way mod_perl for Apache works is to take your entire CGI and wrap it in a subroutine, persist the Perl instance, and call the subroutine each request. The common problem with this is that because of this any subroutines within your CGI can easily create closures if they use global variables. The goto statements really were intended to be used just like subroutines, because they were likely switched to in an attempt to easily circumvent this problem. Now, there are better methods to combat this, such as sticking your subroutines in a module, and having your CGI (and then mod_perl) just call that module, which is what I ended up converting the code to do, but the real take-away is that the original decision, as impossible to defend as it seemed, was actually based in a real-world trade-off, and at the time it was done may have actually been the correct call.

</comment><comment><USER24> The Harvard CS50 course on edx does a pretty good job of teaching C, esp if you do the recommended reading/psets of "hacker level" which is from the book Hacker's Delight 2.

There is some initial magic, where they have you import cs50.h which is full of black box functions in the beginning but other than that it's a good example of teaching beginner C.

</comment><comment><USER18> If part of a CS course I think C is an excellent first language. Perhaps not for someone wanting to learn about software development on their own though.

It seems to me that while we know _how_ to teach C properly today not many places do because they don't do as they say.

<comment><USER25> One thing C does is force you to think about how the computer actually uses memory. So many languages abstract away the memory management and you end up with stuff like java programs that constantly and aggressively thrash the hell out of the processor cache by creating and (later) destroying objects for everything they do. Cache misses are one of the biggest performance killers on modern CPUs. You also see programmers do stuff like add characters to a string one at a time, even though each addition creates a whole new string and discards the old one.

If you do stuff like that a lot you can easily end up wondering why your program is so slow even though the profiler says that there are no standout slow parts. Everything is just uniformly slow because their coding style doesn't consider the amount of work each statement maps to at the machine level.

<comment><USER26> There are plenty statically compiled languages which don't abstract away the memory management, and are still way more robust to use than C, just start looking at Modula-2. Programming in C makes a lot of sense in many situations compared to C++ or Python or Javascript, just to name a variety, but not so much when compared to many other languages, which really compete in the same space as C, but did not catch the same attention.

<comment><USER25> Learning C has the advantage of opening up a ton of Unix software for you. Modula-2 not so much.

</comment></comment></comment></comment><comment><USER27> There is not one C. There are multitutdes of C. C is a recombination of the Programming language with the Compiler with the Plattform with the Code Convention of choice with the librarys chosen with the OperatingSystem (if there is one).

And C needs knowledge in all fields recombined to be really used freely. Know one of those fields not - and you will be like a wanderer on a frozzen lake, doomed to trust those who know to guide you by ramming posts of no return where the ice gets thin.

Its also about taking a sledgehammer to all those certaintys people have about computers from marketing and personal experience as consumers.

</comment><comment><USER28> I find that many books that teach C either assume the reader knows how to program, or are too complex for them to understand.

I was going to write a Kindle book in the beginner's guide to C using Code::Blocks and its IDE because it is FOSS cross platform software. I found out it is a lot harder than I thought it was.

I learned C in 1987 at a community college still have the book on it that is written for Microsoft C, and we used Turbo C and Quick C for some of the assignments. Most of the programs I wrote can still compile and those that get errors or side effects can be debugged easily.

</comment><comment><USER29> CS degree from pitt.edu 1996 and C was not required. But a friend an I took it as an elective. We did not want to get out of school with CS degree and no C.

<comment><USER30> If not C, what did they have you use for systems programming? Like, in your Operating Systems course?

<comment><USER31> Pitt grad here, though a decade after the OP. Pitt has 3 courses related to this stuff:

      * CS 447: http://cs.pitt.edu/schedule/courses/view/447
      * CS 449: http://cs.pitt.edu/schedule/courses/view/449
      * CS 1550: http://cs.pitt.edu/schedule/courses/1550

447 and 449 are required, 1550 is optional.

447 is almost entirely MIPS assembly, and goes into hardware architecture as well [https://people.cs.pitt.edu/~childers/CS0447/](https://people.cs.pitt.edu/~childers/CS0447/)

449 is a C class, using K&R 2nd edition: [https://people.cs.pitt.edu/~jmisurda/teaching/cs449/2164/cs0...](https://people.cs.pitt.edu/~jmisurda/teaching/cs449/2164/cs0449-2164-syllabus.htm)

1550 is more specifically about operating systems, using Tanenbaum's book: [https://people.cs.pitt.edu/~jmisurda/teaching/cs1550/2164/cs...](https://people.cs.pitt.edu/~jmisurda/teaching/cs1550/2164/cs1550-2164-syllabus-11am.htm)

So at least today, there's one class that's all C stuff. Almost all of the rest was Java, while I was a student.

</comment></comment></comment><comment><USER32> "This claim that positive signed overflow wraps around is neither correct by the C standard nor consistent with the observed behavior of either GCC or LLVM. This isn't an acceptable claim to make in a popular C-based textbook published in 2015."

Perhaps someone could explain what I'm missing. It's _exactly_ the behavior that I see using gcc-4.8 and Apple llvm-7.3.

<comment><USER33> Read the linked content in the post about undefined behavior. Signed overflow is undefined, not implementation defined. Clang and GCC treat it as undefined such without -fwrapv. That means they assume it cannot happen and feed information into optimization passes and code generation based on that assumption. It's worse than the result potentially being different: a program with signed overflow may crash, corrupt data or worse and it happens in practice. One common example is overflow checks often being optimized out if they do it by trying the operation and then checking for overflow. As the compilers get smarter, the problems will grow. They barely do any integer range analysis right now...

</comment></comment><comment> awinter-py first piece in a while to make me optimistic about college curriculum priorities.

Not sure it's possible to teach green frosh 'why does industry use an old language' and the static analysis ecosystem (easier to teach skills than wisdom). But I applaud these people for trying. This feels like real programming.

</comment><comment><USER34> Knowing assembly is a good first step and a prerequisite to be useful in an embedded project.

</comment><comment><USER35> All good points. But teach all these in one semester? Poor students..

</comment><comment><USER36> For all assignments, tell the students to use the most appropriate language. Plot twist: all assignments are for high level applications and C isn't the most appropriate.</comment>


Epic ups Unreal Marketplace creators' pay well above industry standard - <AUTHOR> https://arstechnica.com/gaming/2018/07/epic-ups-unreal-marketplace-creators-pay-well-above-industry-standard/ <comment><AUTHOR> The most surprising part of this is that it's also retroactive - <USER2> who's sold on the asset store will be getting a cheque for the difference on every sale since 2014.</comment>


Show HN: Reviews stats on about half a million reviews - <AUTHOR> https://feedcheck.co/blog/whats-better-short-reviews-or-lengthier-ones-or-some-good-to-know-review-stats/ <comment><AUTHOR> We analyzed about half a million English reviews</comment>


A New Persistent Attack Methodology Targeting Microsoft OWA - <AUTHOR> http://www.cybereason.com/cybereason-labs-research-a-new-persistent-attack-methodology-targeting-microsoft-owa/ <comment><AUTHOR> Analysis PDF here: [http://go.cybereason.com/rs/996-YZT-709/images/Cybereason- La...](http://go.cybereason.com/rs/996-YZT-709/images/Cybereason-Labs- Analysis-Webmail-Sever-APT.pdf) They don't give information on how the DLL got there in the first place, though.</comment>


The Greatest Secret to Raising Venture & Angel Capital - <AUTHOR> http://smartstartup.typepad.com/my_weblog/2007/07/the-the-greates.html Raising venture capital secrets. <comment><USER2> Interesting to compare this with Paul Kedrosky's take on the Twitter funding:[http://paul.kedrosky.com/archives/2007/07/26/the_twitter_les...](http://paul.kedrosky.com/archives/2007/07/26/the_twitter_les.htm)

Another observation: if you apply this advice to a typical Web 2.0 startup, you get an employee. The "customer" of a free consumer web startup is its eventual acquirer: after all, that's who's going to pony up the cash that becomes the entrepreneur's profit. The "suppliers" are the users who donate their time, and sometimes the investors who donate the money needed to build something that makes it worth it for the users to donate their time.

You have three options for how you're going to manage time, cash, and users. You can go to your customer (the big corporation), and say "Pay me now and I will build something that hopefully users want. If they don't, you're out the cash." This is an employee. You can say "I will build something that users want, then when I have shown that users want it, you can pay me. If it flops, it's my problem." This is a bootstrapped startup. Or you can go to someone else, say "Give me cash and I will find users. Then the customer (big company) will want to buy us, and we will shared in the profits. If this doesn't happen, you're out your money and I'm out my time." This is a funded startup.

It also occurs to me that many of the misunderstandings behind Web 2.0 and doubts about the sustainability of free web startups come from this reversal of the roles of customer and supplier. Most people think of business as big companies producing a product that is consumed by ordinary people. The Web 2.0 entrepreneur essentially "productizes" consumers and sells them to a big company. This only works because brand loyalty and customer satisfaction have become tradeable commodities: 10 million loyal users and a product they use daily is considered an asset, even if none of them are paying you for it.

</comment><comment><USER3> Interesting anecdote, but completely mistitled.

After reading the article, I didn't feel like I learned any secret to raising venture and angel capital, I just learned a trick for managing it once it's been obtained.

<comment><USER4> > "The Greatest Secret to Raising Venture & Angel Capital"

I think what you were meant to take away is that investment capital is easier to get once you proved you can generate cashflow upfront. You don't really have to prove you will have a product that produces cashflow, you are already doing it. And investment capitalist believe in the market.

So I think it is aptly named, if you think you need to go through the typical steps to getting money you can ignore that if you just start making money. So why then do you need money? To grow the business faster then the market would otherwise allow.</comment></comment>


New Laptop With Built-In Projector - <AUTHOR> http://gizmodo.com/5013328/asus-demos-laptop-with-built+in-projector <comment><USER2> Boy that looks clunky. I'd like to see the Apple version.

Why not just a small hand held projector the size of mouse (then you can swap machines if you need to).</comment>


What's Wrong with Stack Overflow: Social Over Substance - <AUTHOR> http://stackoverflow.com/questions/3736094/how-do-i-increment-add-one-to-or-decrement-subtract-one-from-a-number-in-com

<comment><USER2> I don't get your complaint.

You posted a trivial question you knew the answer to, and then posted your trivial solution, at which point you were told that it was preferred if people asked genuine questions they didn't know the answer to.

If anything, people knocked you for not providing _enough_ substance-- and I don't see anything "social" about the interaction at all.

There's a lot of things wrong with StackOverflow-- but you're not offering much of a critique.

<comment><AUTHOR> What's trivial to one is not trivial to all.

The reason I posted the question (and answer) is that I saw someone else was confused about these operators in a different Stack Overflow question.

The "social" complaint was because the first commenter down-voted me because he though I was trying to get a badge, not because he thought there was something incorrect about the information (maybe he just didn't say so explicitly).

A lot of people coming to Lisp are new, and need small little code snippets.

Although my answer may seem trivial, it had a few carefully-thought-out properties: 1) A very specific title. 2) A specific answer, with alternatives, and references to the language spec. Many Lisp newbs won't know to go to the Hyperspec.

So, maybe I just posted this in the wrong place. What is the right place for standard techniques or snippets that can improve the code-quality of a cut- and-paste beginner?

<comment><USER2> _The reason I posted the question (and answer) is that I saw someone else was confused about these operators in a different Stack Overflow question._

Then _that_ was the right place to post your answer.

It's generally considered a good idea to lurk a little while in an online community, to see the local standards. If you had done so, you'd have seen that people don't post "standard techinques or code snippets" to StackOverflow-- they ask questions they don't know the answer to, and try to answer other's questions.

If you want to help folks on SO with Lisp, you can try to answer some of the genuine questions that have been asked.

<comment><AUTHOR> _It's generally considered a good idea to lurk a little while in an online community, to see the local standards._

True. I _did_ check the FAQ, at least, and concluded that this was a legitimate post.

I think there's an unanswered need, here. It's a problem of search. You want the first search result in google to be a small, rock-solid code snippet.

Small, because small is simple, and small can be perfect. Longer code samples introduce too many degrees of freedom. Small samples can be unambiguously correct (for a specific purpose). This doesn't mean they're trivial.

Anyhoo. If this isn't what Stack Overflow is, someone should make it...

</comment></comment></comment></comment><comment><USER3> Reminds me of that saying "no good deed goes unpunished".

As a user of SO, I always prefer to see an answer already there than asking it. Even though SO users are super fast at answering my questions (usually get answers < 1h), there is something to be said about the answer already being there.

Having said that, the "hive" at SO has already developed a set of informal rules, and there are plenty of people who seem to make a point of making meta- commentary on questions.

While this is standard fare for social sites and the interwebs in general, at least the signal to noise ratio is an order of magnitude better than most other social sites.

</comment><comment><USER4> I don't get it. Given your self-proclaimed skillset (below) you are trying to tell us you genuinely don't know how to increment a number in Lisp?

        Expertise:

        Computer, Video, and Mobile Games (PC/Mac/Consoles/iPhone/Android)
        Real-time physics simulation
        Game-logic and character AI
        3DS Max scripts and plug-ins
        Unity game engine
        OpenGL/OpenGL ES/Cg Shaders
        C/C++/Objective-C/Java/Python/Lua/Common Lisp

<comment><AUTHOR> You're right, I knew the answer. I wanted to create a canonical answer that others could find, since I could not find one, and since I have evidence that some other programmers don't know this.

<comment><USER5> So why not let them ask the question themselves? I understand that's part of the premise of StackOverflow.

<comment><AUTHOR> Chicken-and-egg. As a senior dev. I often see junior devs who don't know what questions to ask. They do a quick google search, and if it doesn't come up in the first few hits, they're lost.

</comment></comment></comment></comment><comment><USER6> Not only is it OK to answer your own question on SO, there's a badge you can only get by doing so: "Self-Learner: Answered your own question with score of 3 or more."

Here's the tip I shared to get my Self-Learner badge:

[http://stackoverflow.com/questions/1107551/css- strikethrough...](http://stackoverflow.com/questions/1107551/css- strikethrough-different-color-from-text/1107556#1107556)</comment>


Ask HN: What are some of the best tech analogies you've ever read/heard? - <AUTHOR> I recently saw a post on HN about the paint analogy for the Diffie Hellman cryptography solution [1] and it was one of the best explanations for something I've seen that was very easy to digest. I was hoping to find more of these analogies! (What specifically brought this question was, I was hoping to find a good one for the OSI model).<p>[1]https://youtu.be/YEBfamv-_do <comment><AUTHOR> Another one to start that I just read: "We use pointers because it's easier to give someone an address to your home than to give a copy of your home to everyone."

[https://stackoverflow.com/questions/162941/why-use- pointers#...](https://stackoverflow.com/questions/162941/why-use- pointers#comment28383429_162941)</comment>


Babbage: A Clojure library for accumulation and graph computation - <AUTHOR> https://github.com/ReadyForZero/babbage

<comment><USER2> here's the announcement email (very boiled down version of the readme, essentially):

babbage is a library for easily gathering data and computing summary measures in a declarative way.

The summary measure functionality allows you to compute multiple measures over arbitrary partitions of your input data simultaneously and in a single pass. You just say what you want to compute:

        > (def my-fields {:y (stats :y count)
                          :x (stats :x count)
                          :both (stats #(+ (or (:x %) 0) (or (:y %) 0)) count sum mean)})

and the sets that are of interest:

        > (def my-sets (-> (sets {:has-y #(contains? % :y})
                           (complement :has-y))) ;; could also take intersections, unions

And then run it with some data:

        > (calculate my-sets my-fields [{:x 1 :y 2} {:x 10} {:x 4 :y 3} {:x 5}])
        {:not-has-y
         {:y {:count 0}, :x {:count 2}, :both {:mean 7.5, :sum 15, :count 2}},
         :has-y
         {:y {:count 2}, :x {:count 2}, :both {:mean 5.0, :sum 10, :count 2}},
         :all
         {:y {:count 2}, :x {:count 4}, :both {:mean 6.25, :sum 25, :count 4}}}

The functions :x, :y, and #(+ (or (:x %) 0) (or (:y %) 0)) defined in the fields map are called once per input element no matter how many sets the element contributes to. The function #(contains? % y) is also called once per input element, no matter how many unions, intersections, complements, etc. the set :has-y contributes to.

A variety of measure functions, and structured means of combining them, are supplied; it's also easy to define additional measures.

babbage also supplies a method for running computations structured as dependency graphs; this can make gathering the initial data for summarizing simpler to express. To give an example that's probably familiar from another context:

        > (defgraphfn sum [xs]
            (apply + xs))
        > (defgraphfn sum-squared [xs]
            (sum (map #(* % %) xs)))
        > (defgraphfn count-input :count [xs]
            (count xs))
        > (defgraphfn mean [count sum]
            (double (/ sum count)))
        > (defgraphfn mean2 [count sum-squared]
            (double (/ sum-squared count)))
        > (defgraphfn variance [mean mean2]
            (- mean2 (* mean mean)))
        > (run-graph {:xs [1 2 3 4]} sum variance sum-squared count-input mean mean2)
        {:sum 10
         :count 4
         :sum-squared 30
         :mean 2.5
         :variance 1.25
         :mean2 7.5
         :xs [1 2 3 4]}

Options are provided for parallel, sequential, and lazy computation of the elements of the result map, and for resolving the dependency graph in advance of running the computation for a given input, either at runtime or at compile time.

<comment><USER3> Cutting to the chase, does this make the summary results available in the midst of the sequence; eg: if it takes two hours to gather pressure data (or any other time series data) does this expose the running variance 10 minutes in, an hour in, etc. ?

<comment><USER2> Not currently, but it would certainly be possible to add something _like_ that ---exposing the running stats for partial subsequences of the input sequence would just be a matter of replacing the "reduce" in the definition of calculate with "reductions" (well, and at least one other change, but at a similar level of complexity). That wouldn't give you ten, sixty, etc. minutes in to the data gathering, because it wouldn't be tied to how long the actual computation of the elements of the input seq---something outside calculate's purview, ATM---was taking, but it would start delivering running answers right away.

<comment><USER3> Running answers right away is fairly useful; a bit of a challenge in that problem domain is with multichannel sensors ("cameras" with multiple frequency bands, satellites like MODIS, radiometric spectrometers, etc.) where the sharpest "image" is produced by using an SVD (singular value decomposition) type transform to reduce (say) 256 input channels to (say) 6 major dimensions and using those to recreate an enhanced image. Producing branchless code to generate basic running stats (min, mean, max, variance, trends) on multiple input channels is a bit of puzzle, generating an efficient rolling SVD enhancement (best image based on most recent observations) is a bit trickier.

The application areas are continuous processing of continuously arriving data, infinite unbounded sequences.

</comment></comment></comment></comment><comment><USER4> I actually wrote something similar in bash which I use frequently when I need to munge a table of numbers on the command line [1]. The whole time I was thinking I should really be doing this in common lisp.

[1] <http://eschulte.github.com/data-wrapper/>

</comment><comment><USER5> This will be great for building our stats dashboard. Thanks!

<comment><USER6> we use this actively internally @ReadyForZero for a variety of different analysis, hopefully it's helpful for you and others

</comment></comment><comment><USER7> This is great!</comment>


The Dark Roots Of 'The Nutcracker' And The Man Who Wrote It - <AUTHOR> http://www.npr.org/2013/12/25/257139160/the-dark-roots-of-the-nutcracker-and-the-man-who-wrote-it <comment><AUTHOR> NPR at its best.</comment>


Ask HN: Do you find it troubling to choose what to wear? - <AUTHOR> Hi Everyone,
As we all know that Mark Zuckerberg wears the same t-shirt because he wants doesn't want to put some mental effort into deciding what to wear.
I wanted to know, does it really bothers any other person when they have to decide on what to wear.
If yes, Does anyone has come up with a hack way to solve this problem?
Suggestions please. <comment> n-gauge Have 8 hangers: the low four contains trousers (lower nibble), the upper four shirts (upper nibble).

Use you favourite rotate algorithm separately on each nibble, and take lsb of the upper and lower nibbles.

This is the outfit for today.

</comment><comment><AUTHOR> For me, it becomes really troubling sometimes so often time I just iterate between 3-4 pairs for weeks and then suddenly I realize, I can wear others also.

Also, I have noticed one bias towards wearing new clothes and putting away the old but good ones for Months and not picking them up until one day I look at my cupboard and then putting them back again.

I know it's not a thing of priority but it just sometimes bothers me to find a system where I can distribute my clothes equally based on number of days and wear all of them equally.</comment>


The fixed_point C++ Class Template - <AUTHOR> https://github.com/johnmcfarlane/SG14/blob/fp_docs/Docs/fixed_point.md#the-fixed_point-class-template

<comment><USER2> I was having trouble understanding why fixed-point arithmetic was particularly useful in game development. In fact, I was curious why fixed point representation was more useful than floating point at all...

Two links deep, I found [1]. The salient being "...floating point representation gives you extra precision for numbers near zero, this extra precision comes at the expense of precision for numbers further out"

1\. [http://www.pathengine.com/Contents/Overview/FundamentalConce...](http://www.pathengine.com/Contents/Overview/FundamentalConcepts/WhyIntegerCoordinates/page.php)

<comment><USER3> The most useful feature of fixed point calculations is its deterministic nature. Determinism is necessary when multiple parties need to be in the same state, with the state being too large to be exchanged between the parties.

The canonical example are RTS style games where there are hundreds of units, but only the actions of the players are sent to every other players. The result of the actions are computed independently by all the players. Having all the players be in sync requires determinism in the calculations, which floating point calculations do not provide.

<comment><USER4> To add to this, when you're trying to minimize information flow among parties, you might have each player only send information to some other players (perhaps only the set that needs to know _right now_ \- think unit information from Player A to Player B. This is in the 'fog of war' for player C, so you don't send it. Later, however, the accumulated state needs to be sent to player C when it becomes relevant to her. I made this example up, but it's quite common to minimize the amount of information sent over the network in latency-sensitive networked multiplayer games.)

The short answer is that accumulated calculations deviate in floating point arithmetic, because floats don't behave like mathematical abstract numbers. One easy way to see this is that _operations on floats are not associative_ , especially when you're working on numbers that differ greatly in magnitude. So you don't have the guarantee that (A * (B * C)) = ((A * B) * C). This can end up with state slowly deviating and it all falling apart.

The reason for this is fairly easy to see: floats are represented as A * 2^B (A is the 'mantissa', B is the 'exponent'). In double-precision floating points, the mantissa is 52 bits, and the exponent has 11 bits (1 is left over for the sign bit). So if you have a really small number, say X = 1.125125123 * 2^-22, you can store it with a lot of precision. If you have a really large number, say Y = 1.236235423 * 2^30, you can also store this with a lot of precision. But now add the two together, and you're basically going to throw out the smaller number entirely, because you don't have enough mantissa bits. So essentially (X + Y) gives you Y. Now if you had a third number, say Z = 1.5 * 2^-22, and you were trying to do Y + X + Z, then order matters. Because (X+Z) together might "bump" it up to the point where they are within a multiplicative factor of (2^52) of Y, so they have some impact on the total. But Y + X throws out X, and then (Y + X) + Z throws out Z. So (Y + X) + Z ≠ Y + (X + Z)

P.S. I didn't check the math but that's the basic argument. I could be off by one or two orders of magnitude, but the point stands that floats behave wackily if you care about correctness.

<comment><USER5> I'm confused at why you'd expect fixed point to avoid these problems. Consider

        auto pi      = fixed_point<int16_t, -7>(3.141592654);
        auto e       = fixed_point<int16_t, -7>(2.718281828);
        auto log2_10 = fixed_point<int16_t, -7>(3.321928095);

        std::cout << (pi * e) * log2_10 << std::endl;
        std::cout << pi * (e * log2_10) << std::endl;

These give 28.2422 and 28.2656 with the provided code, respectively.

For float16s, these give 28.375 and 28.359 respectively.

The correct answer is 28.368, so floats are much closer as well as being closer to each other.

\---

In fact, your example doesn't justify this calculation. If one is sending the accumulated values to C, one isn't worried about calculation error. You just need to require all parties that do calculate it to do so in agreement.

There are several more targeted problems of floating point

* C++ makes few guarantees about what floating point calculations do, and they can vary even between optimization levels. Languages like Python and Javascript fix this by setting well-defined behaviour.

* Often one only needs a certain level of detail, so adaptive computations are just a waste. If you know the bounds of your map and the maximum zoom, a fixed precision gives more uniform calculations and often better precision.

* Fixed precision has obvious and rounding-free addition.

</comment></comment></comment></comment><comment><USER6> I'm surprised they don't support C++11 user-defined literals[1]. That seems like a perfect fit for stuff like this.

[1] [https://en.wikipedia.org/wiki/C%2B%2B11#User- defined_literal...](https://en.wikipedia.org/wiki/C%2B%2B11#User- defined_literals)

<comment><USER7> I don't know, they would have to encode two template arguments, one of which is a freely-chosen integer, into a number of suffixes. I'd say, leave that to the user. The user can define literals for the type/exponent combinations they will use often.

</comment></comment><comment><USER8> Phew! I was thinking this was going to be a template-meta programming example of a y-combinator...

Looks useful!

<comment><USER9> Yeah, I was prepared to see some Lovecraftesque template metaprogramming implementation of lambda calculus just to calculate the fixed point of a function.

</comment></comment><comment><USER10> The negative exponent bothers me. Every implementation I've used specifies either mantissa bits or exponent bits, as a positive value. The extraneous '-' everywhere feels like a waste

<comment><USER5> Given there are no exponent bits (all of the bits are effectively mantissa bits with no hidden bit), your plan doesn't seem to make sense.

The numbers are (integer_value * 2 ^ constant_exponent), such that all bits are dedicated to integer_value.

</comment></comment><comment><USER11> Fixed point arithmetic, as one of the number types, has very well-defined mathematical properties. The Computational Geometry Algorithms library describes this. I think fixed point would be a special case of exact rational numbers. They could have classification structure much like iterators do, except classified for whether they form a field or are double-constructable, and such.

</comment><comment><USER12> I haven't read through SG14, but I'm wondering why the fixed point implementation doesn't provide bases other than binary. Fixed point math has uses well beyond game development, and honestly too many people just use floating point by default.

For example, a decimal base is useful for representing prices that are otherwise unrepresentable in binary (e.g. a penny).

</comment><comment><USER13> Not the "fix x = x" class, but a fixed point number class :-|</comment>


(In)Validate my idea: Bombfell - Dress well without the knowhow - <AUTHOR> http://www.bombfell.com/ <comment><USER3> (from a woman who shops a LOT): mens shirt and pants sizes are fairly standard - thats a good thing for this business. As long as you collect ppl's sizes, most things should fit. I would also consider having a style-determinant upfront. Like: do you want to look like mark zuckerberg, larry ellison, or sergey brin for example if geeks are your target audience (if not, use celebs.) at least this will generally put the clothes you send in the right ballpark of what that guy dresses like. although if he dresses like larry ellison he probably has his personal shopper and a wardrobe of armani and wouldnt be using this service! :)

my biggest concern with this business is that if its successful you actually make yourself redundant. meaning if ppl really like the shirts you send them, and say they're H&M - well they just decide to shop in H&M from then on and stop paying for you. Your retention rate is inversely proportional to how good your product is - thats bad business.

<comment><AUTHOR> Thanks for the feedback! Great idea.

Our thought is that there's value-add in having a fashion-aware person pick out clothes for you - so in your H&M example, for someone like me simply knowing the brand isn't enough, I would appreciate someone picking out specific shirts or pants from H&M. I also typically only go shopping once a year, so not having to shop would be a big convenience.

<comment><USER3> i definitely see value in someone else picking clothes out for ppl who either hate to go shopping or dont have any sense of style. one other idea for you - you should combine this with a secret shopper business. brands will actually _pay people_ to shop as "customers" in their stores so they collect feedback on how their employees behave, if the store was organized etc. i used to do this in college. your shoppers could also be secret shoppers - thats an extra revenue channel for you while they are out buying geeks their clothes! we should talk btw if you want to do this for real: mitalip AT gmail

</comment></comment></comment><comment><USER4> My $0.02: I don't like the idea of ordering something which I have no idea if I will like (not that I can tell if that would happen as there's not much information). And if the point is to just find clothes that females approve of I can go on some women's fashion forum and ask them directly, then go find it in the store and try it on.

<comment><AUTHOR> Fair points, our thinking is that this service would be geared to men who don't want to put in the effort described above - the value add would be the convenience of not having to dig around asking for opinions, and not having to go to the store and shop.

We are planning to try offering Zappos-style return policy and watch how the economics work out.

</comment></comment><comment><USER5> Considering that, if I go looking for clothing that isn't a T-shirt, > 80% of things will fit in a less than ideal way (shoulders too tight, too big in chest, sleeves not long enough, pants tight around calf or to wide at waist), I wish you luck in being able to fit everyone without having them try it on.

<comment><AUTHOR> This is definitely a big open question - we're planning to allow for users to input their measurements so that it should fit reasonably well, but we could be misjudging how picky our target demo would be regarding exactly how well it should fit.

<comment><USER5> Two things that could help:

\- Zappos-esque customer friendly return policy, if it doesn't bankrupt you.

\- If a return is required, make it easy to report why - for example, on a pants return, have a picture of the pants, and sliders for the waist, length, inseam, etc. that go from "too small" to "too large".

\- use past fit information to tweak what kind of clothes are sent out to that person in the future.

\- Another random option - for things that are too big, offer to mail in and tailor them (an inch off the leg, for example).

\- Also, people might REALLY like an item, and want more of it. I know I'm attached to certain bits of clothing, and often have trouble finding another to replace them when I go looking (other than stock items like jeans/etc.).

<comment><AUTHOR> Awesome - thanks for the suggestions!

We are planning to offer Zappos-style return policy, as long as it doesn't bankrupt us :)

Meaning you want the exact same article of clothing once it wears out?

</comment></comment></comment></comment><comment><USER6> The main issue for me would be trusting the female approving the shirt. I suppose you could have a collection of people, each with a portfolio, but it's a bit of a catch 22: I have to pick a woman whose taste I like, but I am only using the service because I have poor taste in fashion.

One way around that would be to simply have a "style" that people want to fit. I might know if I live in NYC that I want the "Wall St" style; SF might be "Hip Startup". Being an engineer, it's much easier to classify objective goals than subjective tastes. If I have to look at a bunch of profiles saying "I go for a casual, slightly-preppy look with the right amount of professionalism"-- I am not going to know what that means.

<comment><USER7> He's a better idea. Instead of choosing a woman whose taste you like, you should be able to choose a woman whose personality / interests / etc you like. Hopefully that'll correlate to you wearing clothes that that sort of person likes?

</comment></comment><comment><USER8> Kind of hard to judge without more details on how it works.

Just based on the tagline though - I hope this involves posting an image of yourself. I could find a fashionable pair of pants just by opening an issue GQ. The hard part about being fashionable is knowing what looks good on _you_.

<comment><AUTHOR> Perhaps I'm more clueless than most, but I've always relied on female friends to tell me what looks good and blindly bought what they tell me to.

Thinking this would be for people who don't want to read GQ or do any research. Plan is to offer some level of personalization, a somewhat crowd- funded personal stylist for many people at once.

<comment><USER4> I think "personal stylist online service" is a more useful business model than "send me a shirt that look nice". I can buy a shirt, but i'm probably doing the rest of "style" wrong and could use tips tailored to the rest of my appearance to make myself more professional or attractive looking.

</comment></comment></comment><comment><USER9> Interesting idea, but a lot of open ended questions and returns galore. My friend tried to do a tailor made shirt business with the stuff made in China - failed too many returns and touch-ups.

I am doing something a bit similar, but we do more data gathering. <http://www.makeyourgirlfriendhappy.com>

My friend runs a shop where they take a photo of you in front of a standardized grid, which allows them to know your size automatically - <USER2> could probably be done with your site.

<comment><AUTHOR> Ha! "The Art of Sexting". Brilliant.

What type of return levels are you seeing sending gifts to the girlfriends?

What's the name of your friend's shop with the standardized grid?

</comment></comment><comment><USER10> It's difficult to evaluate without a description of what the service offers. I recommend that you update the teaser page to tease visitors about some of the proposed features.

Generally in a personalized fashion site I'd like to see the following:

* an up-to-date sense of fashion

* An appeal to cosmopolitan styles

* Accessibility to the fashions offered (Amazon, target, AE, Aritzia, etc... links at least) I'd say it's best if you offered a deal finder and had your reviews tell people what is hot _and_ cheap right now.

Fashion is closely linked with afford-ability.

</comment><comment><USER11> My biggest complaint is "female-approved". Since when do only females know what looks good?

That's not a selling point for me at all. Would make me less likely to use this service.

<comment><USER12> This sentence exactly got me in. I read some czech blog about fashion written by a women about how Czech men dress terribly themselves. You should have seen the discussions under the articles.

I'm ordinary man and a hacker. I personally don't care what I wear. I prefer comfortable clothing. I don't care and I don't have problem with it. But women care and they see it as a big issue. I'm reading the blog just from curiosity to see how it looks from the other side.

<comment><USER12> btw. this is her blog called "Fashion Hell": <http://modnipeklo.cz/2011/02/muz-muze-taky/>

</comment></comment></comment><comment><USER13> Is this basically a less effective version of Trunk Club?

<comment><AUTHOR> Interesting, thanks for sharing hadn't heard of them before. We're planning a subscription-based model where you would regularly receive a shirt or pair of pants every month, so more "passive" consumption over time to keep your wardrobe reasonably up to date going forward.

I think depends on the type of guy you are, myself and a number of guys I know aren't really into fashion and aren't super-fussy, but do want to dress reasonably well - just without effort. Trying to test now whether there's enough guys with that same attitude :)

</comment></comment><comment><USER14> I like this idea. I agree with derekdahmer that it'll be hard to know what will look good on us without first knowing what we look like. What if you had some sort of "paper doll" type system. You upload a full body pic of yourself, and then the female approved outfits can be virtually tried on.

</comment><comment><AUTHOR> I've always wanted a service that would regularly send up-to-date clothes without me having to shop or know what's hip these days. Anyone else?</comment>


Repository invitations on GitHub.com - <AUTHOR> https://github.com/blog/2170-repository-invitations <comment><USER2> This looks great, but I always get nervous about inviting someone into a repository. A simple mistype and a complete random has access to the repo. I would feel happier if the autocomplete list prioritised people you'd invited previously or already share repos with.

</comment><comment><USER3> Nice! This will prevent activity stream spam.</comment>


Ask HN: What features do you want from a podcast app? - <AUTHOR> I'm building an open source podcast app for Android, mostly for learning purpose. Data will come from listennotes.com and the app design and features will be heavily inspired from Spotify because I'm a big fan of Spotify UX. I was wondering if I can add any specific feature to make it more interesting for frequent podcast listeners. Thank you. <comment><USER2> So remember to add what Spotify failed miserably

\- Mark an entire Podcast as heard/listened

\- Disable recommendations needs to be an option

\- Start screen needs to be whatever the user want, so make it adjustable in settings

\- Auto download and auto erase of played episodes

<comment><AUTHOR> Great! All of it can done. The start screen will be filled with your recent activities and podcasts related to the topics you choose. Why do you want to disable recommendations though? Recommendations seem like a good for discovering new podcasts.

<comment><USER2> It's about not having the option

For instance Spotify always tries to make us listen to irrelevant podcast makers, connected to political Fighting

There's no problem having recommendations The issue comes when you can't disable then

</comment></comment></comment><comment><USER3> It may be a good idea to add pop-up games. How do I explain this. If I am recording a podcast and say the first 10 listeners to click the pod-up on their screen can claim a prize, that'll encourage people to open the app and click the pop-up. I'm not technical so its hard to explain but yeah.....just a way to make interactions between hosts and listeners etter

<comment><AUTHOR> I like the gamification aspect and I know at least one big music/podcast app which has really great click rates on their pop-up banners. Having said that, this doesn't seem to fit well with what I'm trying to build, which is a no- nonsense open source podcast app. Some might like the pop-ups you're talking about but I'm sure that more than enough people will complain about it.

</comment></comment><comment><USER4> The apple podcast can put the newest episode first, so annoying. You look at recently updated of the podcasts you have it shows some episodes, but you have to click on available episodes to see by date order. Maybe I just haven't figured it out.

I also use Podcast Republic. I subscribe to podcasts but I can't arrange the order of which they show (the podcasts, not the episodes). I want to drag some to the top. I don't have it set to auto download because I want to check out the episode description before downloading.

<comment><AUTHOR> I have used apple podcasts and I know what you're talking about. The UX of that app is unbelievably bad. I'm sure that none of those issues will be in this app.

<comment><USER4> I meant The apple podcast CANT put the newest episode first, so annoying. but you understood my point.

Yes hard to be worse than apple one.

</comment></comment></comment><comment><USER3> It may be a good idea to add pop-up games. How do I explain this. If I am recording a podcast and say the first 10 listeners to click the pop-up on their screen can claim a prize, that'll encourage people to open the app and click the pop-up. I'm not technical so its hard to explain but yeah.....just a way to make interactions between hosts and listeners easier. Happy to explain this in detail (firstname.lastname@example.com) reply

</comment><comment><USER5> Yes. One big button on the player that, when tapped, will take the last 30 seconds of audio and send it to me by email. When I'm out walking or driving and something comes up in a podcast that I want to remember or take note of, there is no easy way to do this currently. I use Podcast Addict now, but a feature like that would be enough for me to change players.

<comment><AUTHOR> This is really interesting. Although I was thinking that instead of emailing, I can create a bookmark like feature. It will save the timestamp of the episode which you can easily visit later. I'm definitely going to add this feature.

</comment></comment><comment><USER6> Search capability is key. I really like the ability to search for keywords in episode titles and show notes that is provided by the Castbox app. Something like this is super important to me. I fully support open source and would prefer an app that is free and open, however. Linux user here.

<comment><AUTHOR> I'll be using listennotes.com apis and it allows you to search podcasts, episodes and descriptions. Overall, looks good.

</comment></comment><comment><USER7> Hi, Check out [https://Audioburst.com](https://Audioburst.com), we offer tools for both podcast creators and app publishers. You can freely use our SDK for your app to get sound-bites from podcasts.</comment>


New Ganglia Web Interface Improvements - <AUTHOR> http://morethanseven.net/2011/06/26/New-ganglia-web-interface-improvements.html

<comment><USER2> This is a great improvement, and having JSON data for the metrics means that you can skip having the server render all those graphs via rrdtool and instead use something like HighCharts or other Canvas based graphing toolkits.

Now they just need to switch away from RRD as the backing data store. Until then I'll be looking at OpenTSDB/Graphite for a more modern approach to metric storage.

<comment><USER3> Graphite's whisper engine is very much like RRD. OpenTSDB on the other hand is not trivial to set up or manage. It all depends on your requirements and resources.</comment></comment>


Google billionaire Eric Schmidt shares his top 3 tricks for building wealth - <AUTHOR> http://finance.yahoo.com/news/google-billionaire-eric-schmidt-shares-163531814.html <comment><USER2> Be super smart, in the right place at the right time, meet the right people, work super hard, make a whole series of seemingly trivial but ultimately critically important life decisions/sliding doors moments, make a whole series of deliberate major critically important life decisions (correctly), have alot of luck. Rich!

I'm just not interested in the financial advice of the mega wealthy. Far more interested in the financial advice of those who have done moderately well.

<comment><USER3> nassim taleb aphorism comes to mind: to become rich, work with the poor. to become poor, work with the rich.

</comment></comment><comment><USER4> and #4: become the CEO of arguably the most successful and fastest growing company in history, very early

<comment><USER2> That's the thing I keep forgetting to do whilst trying to "build wealth" \- become CEO of Google in its earliest days. Why do I keep forgetting that?</comment></comment>


Show HN: QuickQwerty – Touch typing tutor - <AUTHOR> http://quickqwerty.com/ <comment><USER2> I'm at unit 12 and my wrists are hurting :) But it's good practice. Gosh how good it feels to be typing normal words again :)).

I think it can really improve typing performance if you exercise like this.

It feels like I type maybe 30% faster right now after 15 minutes of training.

Good job.

<comment><USER3> No pain no gain. I don't think people realize how bad typing can be.

[http://markmcb.com/2014/10/13/severe-hand-rsi-pain-and- recov...](http://markmcb.com/2014/10/13/severe-hand-rsi-pain-and-recovery/)

[http://24ways.org/2014/dont-push-through-the- pain/](http://24ways.org/2014/dont-push-through-the-pain/)

[http://www.looknohands.me](http://www.looknohands.me)

<comment><USER4> Personally I think the keyboard, and how people are often trained to type, has a lot to do with it. I've seen many who type with what looks like far more force than necessary, and it could be related to the fact that a lot of keyboards require high actuation forces and have a sharp force-profile. That makes the hands tense, which reduces accuracy and speed, and the instinctive reaction is to stiffen the hands even more, making it worse. If you want to type faster, you should relax.

Typing shouldn't hurt, and even when I'm typing really quickly (I average in the 140-150wpm range, with bursts over 200) my fingers feel like they're bouncing over the keys instead of being forced into pecking at them. Use the lowest amount of force that just actuates the keys, and let the key push the finger back up. Try finding a keyboard with a lighter, bouncier/softer force profile.

</comment></comment></comment><comment><USER5> Cool tool, but it feels like there is a little bit of latency when I type. It's very subtle, but it throws me off a bit. Is it true? Maybe it's all in my head. But if it's there, it would be nice to lower it.

<comment><USER6> It might be because the textarea is listening for a keyup event, and you're used to seeing letters when the key is on its way down.

<comment><AUTHOR> Thank you for getting deeper into this and finding the actual cause of the issue. It will help me to fix it in the next release.

</comment></comment></comment><comment><USER7> If you are more partial to the Terminal, check out GNU typist: [http://www.gnu.org/software/gtypist/](http://www.gnu.org/software/gtypist/).

</comment><comment><USER8> Am I the only one who think holding your fingers on the home-row is very painful on the wrists?

Basically every touch-typing guide wants you to sit in this painful position[0].

Is there really no better?

[0] [http://kinesis-ergo.com/wp-content/uploads/2013/07/ulnar- dev...](http://kinesis-ergo.com/wp-content/uploads/2013/07/ulnar- deviation-455x341.jpg)

<comment><AUTHOR> I used the instructions generally given in traditional touch typing courses while writing the instructions for this tool.

I agree that sticking to the home row puts undue stress on the wrists. When I began experiencing soreness in wrists, my girlfriend got me a Microsoft Natural Ergonomic Keyboard 4000. It helped and the soreness disappeared.

By the way, even while working on a normal keyboard, I don't bend my wrists as shown in the image link you have posted ( i.e. the first image at [http://www.kinesis-ergo.com/partners/health- safety/ergonomic...](http://www.kinesis-ergo.com/partners/health- safety/ergonomic-benefits/freestyle-ergonomic-benefits/)). I believe, the following statement from the article is not always true.

"On traditional keyboards the span of your shoulders exceeds the contiguous width of the home row of keys. In order to position your hands over the home row it is necessary to bring your hands together in front of your body with your wrists deviated."

My shoulder width exceeds my laptop keyboard by a significant margin. However, I don't have to bring my wrists together to type. I place my arms and wrists in a manner similar to what is shown in the second image in the URL I shared above, even for a normal laptop keyboard. Each of my arm approaches the keyboard from either side of the keyboard making about 45° angle with the base of the keyboard, i.e. the left arm approaches from near the left corner of the keyboard and the right arm approaches from near the right corner. Fingertips of each arm is placed in a slightly arc shape over the four home keys. Forefingers are aligned with my wrists, therefore, each forefinger makes about 45° angle with the space bar.

</comment></comment><comment><USER9> Nice. I like that you let people download easily.

One thought: the font for '1' and 'l' are too similar, and often confusing.

</comment><comment><USER10> As a german guy (with qwertz keyboard) I feel like I'm left out :-(

<comment><AUTHOR> I am sorry to know that you feel left out. QWERTZ keyboard is not too different from QWERTY keyboard. QWERTZ keyboard has the positions of Y nd Z are interchanged and has a few more letters with diaeresis. So I believe you might be able to use QuickQWERTY itself on QWERTZ keyboard as well if you are a little careful about ignoring the guide for units 7 and 12.

By the way, the code for QuickQWERTY is available at at [https://github.com/susam/quickqwerty](https://github.com/susam/quickqwerty). Anyone interested in writing units for alternate keyboard layouts like QWERTZ, AZERTY, Dvorak, etc. just needs to fork the project and work with one file: js/units.js. All the units are defined in this single JavaScript file.

The only things that one might find a little confusing in js/units.js are the 'main' and 'alternate' properties. The 'main' units teach 6-7 split style of typing the number keys and the 'alternate' units override some 'main' units (units 16 to 20) to teach 5-6 split style. For more information on this, see [http://quickqwerty.com/README.html#split](http://quickqwerty.com/README.html#split).

So all one needs to do to support alternate keyboard layouts is to edit js/units.js and define lessons that make sense for the keyboard layout. The user interface is not hardcoded to display only 21 units and only 5 subunits per unit. Therefore, one can change the number of units in js/units.js as well as the number of subunits in any unit, and the user interface should take care of displaying the appropriate number of units and subunits.

</comment></comment><comment><USER11> [http://www.typingstudy.com](http://www.typingstudy.com) is better :)

</comment><comment><USER12> Looks good!

What does the face indicate under error %?

<comment><AUTHOR> Thank you. The smileys below the error rate show how happy the tutor is with the user's typing.

There are four smileys:

(。ʘ‿ʘ。) - Very happy; error rate is 0% and speed is at least 40 words per minute.

(ʘ‿ʘ) - Happy; error rate is 0% but speed is less than 40 words per minute.

(⊙_⊙) - Unhappy; error rate is greater than 0% but does not exceed 2%.

(⊙⁔⊙) - Sad; error rate exceeds 2%.

Also, see [https://github.com/susam/quickqwerty/blob/1362e6d4edd9932b31...](https://github.com/susam/quickqwerty/blob/1362e6d4edd9932b319537a6cef9adf1b30bf09c/js/tutor.js#L215) and [https://github.com/susam/quickqwerty/blob/1362e6d4edd9932b31...](https://github.com/susam/quickqwerty/blob/1362e6d4edd9932b319537a6cef9adf1b30bf09c/js/tutor.js#L1138).

Typing speed is measured in words per minute. Five characters count as a word.

Error rate = number of errors made / number of characters typed correctly * 100%, rounded to the nearest integer.

</comment></comment><comment><USER13> I <3 that the code is shared.

</comment><comment><USER14> Learn Dvorak and save your hands (and maybe career). And type faster, in a few months.

<comment><USER3> [http://lifebyexperimentation.com/2013/08/learn- dvorak/#.VJRl...](http://lifebyexperimentation.com/2013/08/learn- dvorak/#.VJRl8AOAA)

</comment></comment><comment><USER15> i have to say, i failed miserably the first few times due to always looking up what i needed to write:D Maybe it was because of the random stuff you need to write instead of segments you can interpret,</comment>


Ask YC: What Does "Taste and Style in Programming" Mean to You? - <AUTHOR>

I like to look at code and be able to say that it has been written with 'taste and style'. Taste and style means different things to different people.<p>What does it mean to you? What do you like to see in code or design? <comment><USER2> Code has style when you can't describe why the code is so good. Because when you try to describe it, you know you're selling it short - the code is more than simply its specification. The only way to convey the quality of the code is by reading the code itself. Code has style when you'd rather read the code than an explanation of what it does.

For me, it's always a matter of simplicity. When a problem is hard to describe in English, you naturally assume the code will be a bit complex as well. And yet, sometimes, the problem can be decomposed so neatly that the parts are trivial and fit together effortlessly. For me a requirement is that after carefully reading the code you are absolutely certain there is no room left for bugs. You almost know for certain that the code didn't have any bugs when it was written down for the first time, because it captures intent so well. If you need to refactor it's probably too late already.

So I think books like "Beautiful code" got it entirely wrong. I especially don't agree with icey's opinion that refactoring can make code tasteful or that linebreaks can make or break greatness. It's about bringing human thoughts to computer code. And when that mapping is perfect, the code is great.

<comment><USER3> Some of the essays in Beautiful Code argue more or less what you said here, or at least they do to me. What do you think they got wrong?

</comment></comment><comment><USER4> Look at the two pieces of poetry:

"Did you hear about the rose that grew

from a crack in the concrete?

Proving nature's law is wrong

it learned to walk with out having feet.

Funny it seems, but by keeping it's dreams,

it learned to breathe fresh air.

Long live the rose that grew from concrete

when no one else ever cared."

and

"I see no changes all I see is racist faces

misplaced hate makes disgrace to races

We under I wonder what it takes to make this

one better place, let's erase the wasted

Take the evil out the people they'll be acting right

'cause both black and white is smokin' crack tonight

and only time we chill is when we kill each other

it takes skill to be real, time to heal each other"

there both from Tupac Shakur, but the first one is from the poem " the rose that grew from concrete" and the second one is from the song "Changes" The difference is that in the first one its just words put together with a meaning, they say something. But the second one i like more, because of the rime and the rhythm. The first one is written on paper and published to be read, but the second one is from a song, it has to conform to the rhythm of the song, the words are structured to fit with the music and the flow, the second one has structure and architecture and it has to be simple enough to fit with the music and the beat. Making the second one is harder and its more beautiful. When i see good code, for me that means that it follows the flow of the readers mind, the code just fits and does its job, no fancy magic stuff, just simplicity and beauty. It has to be easy to understand too.

<comment><USER3> I like the first one a lot better.

You may have unintentionally supported the null hypothesis, that there's just no accounting for taste.

<comment><USER4> The first one is good of course, but the idea is that i liked the structure and rhythm of the second one. If i was looking for poetic expressiveness i might rethink my choice. The idea of taste is that you look for something, and if you find it in an object, you like that object. If you are looking for strange symbolist metaphors in poetry, you don't look at realism poetry, you look at symbolism. And in PG's essay about taste he said that people just have a lot in common, so they are generally looking for the same stuff.

</comment></comment></comment><comment><USER5> I know exactly what you're talking about! To me, you can look at a piece of code, and know if it has a certain Feng Shui to it... Code that is only dense when it has to be, and is commented when it is. Artful use of white space. Code that has obviously been refactored once or twice.

Other than that, it's sometimes hard to describe. But it is very easy to tell if you're looking at code from someone who loves to code versus code written by someone who just does it for a paycheck.

</comment><comment><USER6> I like to see code that my mind can parse as easily as the machine can. Tasteful code likely is short, efficient, and readable... but perhaps there are exceptions to that? Good taste is like obscenity - hard to define but you know it when you see it.

<http://www-cs-faculty.stanford.edu/~knuth/lp.html>

</comment><comment><USER7> This is the same as asking why certain pieces of art or music are beautiful. Any two random people would likely disagree over their interpretations of beauty, but as a whole, many works would likely receive a drastically high 'beautiful' vote, like Pachelbel's Canon.

That said, with code, I think there are a few properties which are considered 'beautiful' or 'tasteful', not in and of themselves, but combined with that impalpable aesthetic we call 'beauty'.

Of all of these, I think the only one most programmers would agree on is that truly incredible code is nominally quite brief.

<comment><USER2> > truly incredible code is nominally quite brie

That's probably true. But that makes me wonder...

People have a hard time appreciating poetry in their second or third language, because you need to have such vast knowledge to get the subtleties of the poet's intentions.

I suspect the same holds for code. The more skilled and more experienced the programmer, the more complexity he can handle. And he'll find beauty where mortals like us are simply confused.

I can't appreciate Shakespeare, but I suspect it is as great as many claim it is. I would probably dismiss Shakespeare as unnecessarily complex and verbose if I didn't know better.

Worth thinking about the next time you're annoyed at a piece of complex code, and really want to refactor it so everybody can read it. You may be destroying something beautiful.

</comment></comment><comment><USER8> I don't know if it can be boiled down to one thing. One likes to see mastery at every level, from the high-level design down to strict adherence to coding conventions.

The software has to have a strong opinion about what it's doing. It's modelled the problem in a way which leads to a straightforward solution, using a minimum number of concepts.

According to the conventions of the language in which it was written, the visible structure must reveal the underlying concepts. To a reasonably experienced practitioner, the code documents itself and comments are infrequent.

</comment><comment><USER9> It's much easier to see what's bad about code written by other people. I suggest you look at some really bad code, and then try and imagine what a superior programmer would find offensive about your code.

You can always visit thedailywtf.com if you're lucky enough not to be exposed to bad code on a daily basis. My personal pet hates are copy-and-paste code, inconsistent formatting, excessively long lines, bad or non-existent naming conventions, Hungarian notation, and spelling mistakes - pretty basic stuff.

</comment><comment><USER10> I'd like to add a subquestion: I'm always told to check out other people's code and study it, but I'm also well aware that popular software doesn't necessarily mean good code. What source-available projects would you recommend I look at if I want to see some quality examples of the craft?

<comment><USER11> I recommend finding a mentor. Someone who writes code that you respect (be it for quality, clarity or efficiency). Start reading their code and asking questions.

The open source community is a good place to start looking if you don't have someone you respect in your own community.

<comment><USER3> And so the question comes full circle: did you have any particular open source projects in mind? It's a big community.

</comment></comment></comment><comment><USER12> Usually simplicity with correctness

</comment><comment><USER13> Getting the essential things right.

<comment><USER14> essential things, please explain this a bit?

<comment><USER15> If you're programming in Lisp, this probably means writing the right macros - the right DSL - to express the rest of your code in.

</comment></comment></comment><comment><USER16> Five pounds of flax</comment>


Ask HN: Wrong choices during development, who pays? - <AUTHOR>

What is your opinion?<p>During software development you have to make choices. How to develop or which api to use. Suppose during development you discover you made the wrong choice. Two weeks of work down the drain or a useless license you bought. Who has to pay for these mistakes, the client who agreed on the proposed method or the development company? I think the latter, what do you think? And even better, how to prevent such situations? <comment><USER2> You proposed the method, which means you should stand behind it's success or failure. It's also likely that your client based his/her decision based on your expert advice (which is why they hired you)

However I know many consultants who simply bill for their time no matter what, even if the path taken leads to complete failure or results in time wasted.

<comment><AUTHOR> I totally agree. What whould your suggestion be in regards to the consultants who bill no matter what. How to prevend such a thing? I guess a clause in the contract is a start.

</comment></comment><comment><USER3> Consultants are supposed to _consult_ , not make business decisions. If you hired a consulting firm, expect them to give you advice for you to make a decision.

If, on the other hand, you care only about results, you should have asked for a flat-rate bid on completed work by a development company. In that case, "how to develop" or "which api to use" shouldn't matter, since you are no longer making development decisions but simply awaiting delivery of the features you paid for.

You can't have it both ways: either you're hands-off and pay only for results, or you have a collaborative environment in which you call the shots (since you are writing the checks) and are responsible for dead-end paths.

As as side note, I wouldn't get into finger-pointing and bad blood here. If you truly care about your product, move forward with it. You could easily spend more on litigation than the 2 weeks were worth. Better to spend you energies on something productive. If you don't like the way the development company is treating you, amicably part ways.

<comment><AUTHOR> I would say this is the magic sentence.

"either you're hands-off and pay only for results, or you have a collaborative environment in which you call the shots"

Many thanks for both your feedback. Realy helpfull!</comment></comment>