Live data from Hacker News

Resume in C

gist.github.com

31–40 of 115 posts

Re: Resume in C

#31

Earlier quoted context omitted.

> * If we are being idiomatic I would suggest pointer arithmetic to iterate instead of using a counter i. How exactly is one more idiomatic than the other?

It's subjective. It feels more c like and natural to me to write while (foo->bar) and not while (foo[i].bar). The latter feels like the way you would do it somewhere else, grafted onto C. But it's not wrong, I don't have deep qualms with it, and that's why I put it last on my list.

It's not subjective. Intel's guidelines for writing vectorizable code:

Prefer array notation to the use of pointers. C programs in particular impose very few restrictions on the use of pointers; aliased pointers may lead to unexpected dependencies. Without help, the compiler often cannot tell whether it is safe to vectorize code containing pointers.

Source: https://software.intel.com/sites/default/files/8c/a9/Compile... (Section 5.1)

Re: Resume in C

#32
post #12

Earlier quoted context omitted.

That's why they run the program, it formats them. Pasting in code from the internet and running it is a little scary though. I wonder of we can spot the backdoor here. :P

It's not even running it only. Recruiters need to compile it first. :)

So it also acts as a good qualified for the company being applied to, then .. pretty wise. Why work at a place that can't compile this?

Re: Resume in C

#33
post #5

Wow, I didn't know this was valid C code, it's pretty convenient. school_t uiuc = { .school = "University of Illinois at Urbana-Champaign", .location = "Urbana, IL", .program = "BS Computer Science", .started = 1251158400, .left = 1336608000, .accomplishments = { "Minor in International Studies in Engineering, Japan", "Focused on systems software courses", NULL } };

My gcc required me to put { } around any fields of unnamed unions.

[gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)]

Re: Resume in C

#34

Code review: * The struct members and variables pointing at string literals should be const. * People do break this all the time but typedefs ending in _t are reserved by POSIX. * Your C99 style struct initializers are valid but it's notable that one popular compiler, MSVC, will not like them. * If we are being idiomatic I would suggest pointer arithmetic to iterate instead of using a counter i.

> If we are being idiomatic I would suggest pointer arithmetic to iterate instead of using a counter i.

Well, the CVE guys need to keep their job.

Re: Resume in C

#36
post #12

Earlier quoted context omitted.

It's not even running it only. Recruiters need to compile it first. :)

So it also acts as a good qualified for the company being applied to, then .. pretty wise. Why work at a place that can't compile this?

What if you need a job because your company decided to do a massive layoff?

Usually I would have fun at dumb recruiting processes, but right now I'm in no condition to be picky about getting a new job.

Re: Resume in C

#37
post #5

Wow, I didn't know this was valid C code, it's pretty convenient. school_t uiuc = { .school = "University of Illinois at Urbana-Champaign", .location = "Urbana, IL", .program = "BS Computer Science", .started = 1251158400, .left = 1336608000, .accomplishments = { "Minor in International Studies in Engineering, Japan", "Focused on systems software courses", NULL } };

These are called desginated initializers, they're part of C99.[0] This is a good read which discusses them and also devles into compound literals.[1]

[0] https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html [1] https://nickdesaulniers.github.io/blog/2013/07/25/designated...

Re: Resume in C

#38

Earlier quoted context omitted.

It's subjective. It feels more c like and natural to me to write while (foo->bar) and not while (foo[i].bar). The latter feels like the way you would do it somewhere else, grafted onto C. But it's not wrong, I don't have deep qualms with it, and that's why I put it last on my list.

I would have to agree. IMO it lends itself to cleaner code if you're working with NULL terminated lists, especially if you use a `for` when doing the iteration instead of a `while`: const char **a; for (a = job->accomplishments; *a; a++) printf(" - %s\n", *a); And job_t *j; for (j = jobs; *j; j++) print_job(j); The person who wrote this code seems to dislike `for`s for some reason it seems, these are pretty obvious p…

[deleted]

Re: Resume in C

#39
post #35

Reminds me of Major Hayden's man page résumé[0] [0] http://majorhayden.com

Nice. Here's one I always remember (written in Haskell) - https://ocharles.org.uk/

OCharles originally did it in Perl/Moose and with a module of mine (Acme::URL) which is how I stumbled across the CV in the first place - https://web.archive.org/web/20120119150530/http://ocharles.o...

Re: Resume in C

#40
post #16

Cute, but it probably wouldn't make it past the HR filter.

That in itself is a good selector for companies where HR wields more power than the engineering.
Post reply on HN