The Joys Of Programming

tboon wrote:
SixteenBlue wrote:

Visual Studio 2008 could handle that already.

But in a non-standard way. The C++98 standard created the problem and the C++03 explicitly says double right brackets must always be parsed as the right-shift operator.

But I'm just using this as an example of how crazy C++ has gotten from the perspective of someone who started writing code in it in the late 1980s. If folks like C++, more power to them. I used to love it. It's just so complex to parse that even all the smart people on the ISO 14882 committee (and there are a lot of really smart people on the C++ standards committee) can't add a feature without busting some part of the syntax.

At this stage in life, I am looking for easier and C++ ain't it.

Oh wow, I didn't realize it was in the standard. I thought it was just a poor implementation or something.

SixteenBlue wrote:
tboon wrote:
SixteenBlue wrote:

Visual Studio 2008 could handle that already.

But in a non-standard way. The C++98 standard created the problem and the C++03 explicitly says double right brackets must always be parsed as the right-shift operator.

But I'm just using this as an example of how crazy C++ has gotten from the perspective of someone who started writing code in it in the late 1980s. If folks like C++, more power to them. I used to love it. It's just so complex to parse that even all the smart people on the ISO 14882 committee (and there are a lot of really smart people on the C++ standards committee) can't add a feature without busting some part of the syntax.

At this stage in life, I am looking for easier and C++ ain't it.

Oh wow, I didn't realize it was in the standard. I thought it was just a poor implementation or something.

Oh yeah. Here's a proposed wording for Appendix C (ISO C++ 2003 Compatibility) of the C++11 standard (the actual standards cost money and are not available for free on the web that I know of) that's pretty closed to the final. Check out clause C2.14 in section 2.6 where it specifically address this particular issue.

As noted in the clause, it is a minor annoyance, but is my favorite example to illustrate how easy it is to do something seemingly legal that fails to compile in a standards-compliant compiler.

tboon wrote:
SixteenBlue wrote:
tboon wrote:
SixteenBlue wrote:

Visual Studio 2008 could handle that already.

But in a non-standard way. The C++98 standard created the problem and the C++03 explicitly says double right brackets must always be parsed as the right-shift operator.

But I'm just using this as an example of how crazy C++ has gotten from the perspective of someone who started writing code in it in the late 1980s. If folks like C++, more power to them. I used to love it. It's just so complex to parse that even all the smart people on the ISO 14882 committee (and there are a lot of really smart people on the C++ standards committee) can't add a feature without busting some part of the syntax.

At this stage in life, I am looking for easier and C++ ain't it.

Oh wow, I didn't realize it was in the standard. I thought it was just a poor implementation or something.

Oh yeah. Here's a proposed wording for Appendix C (ISO C++ 2003 Compatibility) of the C++11 standard (the actual standards cost money and are not available for free on the web that I know of) that's pretty closed to the final. Check out clause C2.14 in section 2.6 where it specifically address this particular issue.

As noted in the clause, it is a minor annoyance, but is my favorite example to illustrate how easy it is to do something seemingly legal that fails to compile in a standards-compliant compiler.

This is the dark reality behind the joke "it's not a bug, it's a feature".
When you go long enough without fixing something, people start to rely on the behaviour.

I've suggested crazier projects, who wants to write a C# that has manual memory management as an option?

Given what C++ is supposed to do, how are Go and D these days w.r.t. system programming?

Today was the inaugural meeting of a "software craftsmanship guild" at my company. One of the members was very keen to figure out a way to measure improvement of skills. My response was that it's a matter of adherence to your values in a given situation, so it's dependent on both the situation and how coherent your values are. I don't think that's going to satisfy this guy, though, so I wanted to float the thought here. Has anyone encountered a sensible way to measure skill improvement (not necessarily numerical)? [I'm trying to play devil's advocate against myself, in a way.]

Cyranix wrote:

Today was the inaugural meeting of a "software craftsmanship guild" at my company. One of the members was very keen to figure out a way to measure improvement of skills. My response was that it's a matter of adherence to your values in a given situation, so it's dependent on both the situation and how coherent your values are. I don't think that's going to satisfy this guy, though, so I wanted to float the thought here. Has anyone encountered a sensible way to measure skill improvement (not necessarily numerical)? [I'm trying to play devil's advocate against myself, in a way.]

If you don't look at code you wrote 6 months ago and hate it, you haven't been learning anything.

bandit0013 wrote:
Cyranix wrote:

Today was the inaugural meeting of a "software craftsmanship guild" at my company. One of the members was very keen to figure out a way to measure improvement of skills. My response was that it's a matter of adherence to your values in a given situation, so it's dependent on both the situation and how coherent your values are. I don't think that's going to satisfy this guy, though, so I wanted to float the thought here. Has anyone encountered a sensible way to measure skill improvement (not necessarily numerical)? [I'm trying to play devil's advocate against myself, in a way.]

If you don't look at code you wrote 6 months ago and hate it, you haven't been learning anything. :)

QFMFT. Sometimes I look at stuff from two weeks ago and want to punch myself in the face.

Cyranix wrote:

Today was the inaugural meeting of a "software craftsmanship guild" at my company. One of the members was very keen to figure out a way to measure improvement of skills. My response was that it's a matter of adherence to your values in a given situation, so it's dependent on both the situation and how coherent your values are. I don't think that's going to satisfy this guy, though, so I wanted to float the thought here. Has anyone encountered a sensible way to measure skill improvement (not necessarily numerical)? [I'm trying to play devil's advocate against myself, in a way.]

I'm leery of this. What is he going to use those measurements for? There are lots of cases where there are many approaches that will work in any given situation, and in that case, who decides which one is "better" and how would you measure that?

Though I'll definitely Nth bandit's comment.

Some things can't be quantified. You can say that someone's skills have improved, but there is no real way of putting a number to it. Managers try really hard to find a way to quantify things that can't be measured.

Zelos wrote:

I was thinking about brushing up on my C++ again and checking out what's changed with C++11 when a colleague sent me this link: http://isocpp.org/blog/2012/11/universal-references-in-c11-scott-meyers

The essence of the issue is that “&&” in a type declaration sometimes means rvalue reference, but sometimes it means either rvalue reference or lvalue reference. As such, some occurrences of “&&” in source code may actually have the meaning of “&”...

And it then gets even less comprehensible :-(

My favorite is C++'s most vexing parse. That one still bites me from time to time.

tboon wrote:

Oh yeah. Here's a proposed wording for Appendix C (ISO C++ 2003 Compatibility) of the C++11 standard (the actual standards cost money and are not available for free on the web that I know of) that's pretty closed to the final. Check out clause C2.14 in section 2.6 where it specifically address this particular issue.

The most glaring issue to me is the need for "typename" in spots when referencing templated type names. That it's needed at all is a blatant indication that the syntax in C++ is broken.

kazar wrote:

Some things can't be quantified. You can say that someone's skills have improved, but there is no real way of putting a number to it. Managers try really hard to find a way to quantify things that can't be measured.

Thanks kazar et al for the feedback. I'm firmly of the same opinion, but doing due diligence on this guy's behalf. FWIW he is not a manager; he's the most senior research dev at the company. He just wants things to be numerical!

Cyranix wrote:
kazar wrote:

Some things can't be quantified. You can say that someone's skills have improved, but there is no real way of putting a number to it. Managers try really hard to find a way to quantify things that can't be measured.

Thanks kazar et al for the feedback. I'm firmly of the same opinion, but doing due diligence on this guy's behalf. FWIW he is not a manager; he's the most senior research dev at the company. He just wants things to be numerical!

Any numerical score will have more downsides than standard peer review. A lot of things take well to numbers. Writing readable, maintainable code is not one of those things (although we do use PEP8 and pylint at work to help standardize things).

At the end of the day in development only two things really matter:

1. It works

2. It's easily maintainable

Measuring #2 is mostly subjective.

tboon wrote:

Edit: bah, Drupal eats angle brackets for dinner evidently. Trust me, my point is witty and poignant.

Sorry, my trust level for you is not that high.

Quintin_Stone wrote:
tboon wrote:

Edit: bah, Drupal eats angle brackets for dinner evidently. Trust me, my point is witty and poignant.

Sorry, my trust level for you is not that high.

Nor should it be...for you.

It's almost finished (still playing around with content/images), but I finally am getting around to launching my consulting site.

Penny for your thoughts?

http://www.wiseconsultingllc.com/

bandit0013 wrote:

It's almost finished (still playing around with content/images), but I finally am getting around to launching my consulting site.

Penny for your thoughts?

http://www.wiseconsultingllc.com/

Looks pretty good. Lots of promises on the site though. Are you up for the challenge

I'd rewrite this part:

Exaggeration? A bit.
There is no doubt, however, that companies are increasingly dependent upon their software systems to more effectively run their businesses.
Your software helps you increase efficiency through process automation, make more informed decisions with real time analytics, and service your customers 24/7 with online access to your systems

Instead of leading with a rhetorical question, just jump into the explanation. Or leave the explanation out altogether, though that leaves you with a lot of empty space. Beyond that, just proofread the content thoroughly and make sure the formatting is correct. For example, I noticed one byline is "Martin Fowler, Author &international speaker."

Also, I don't know that the copyright blurb is correct from a legal standpoint. I think you have to say who holds the copyright, for one. For example the Sony website has simply "© 2012 Sony Corporation of America" at the bottom. You might want to reduce the number of different fonts used by the site as well.

Finally, once you get some business I'd ask clients for reference blurbs or something along those lines. With service companies, customer testimonials carry a lot of weight. I know I'm not really the target audience, but when I go to a site like this I'm thinking "blah blah we're awesome blah blah buzzwords, okay so where's the evidence that these guys can actually do a good job?" You have to assume that the majority of people visiting your site will make a decision about potentially doing business with you 30 seconds after the page loads and that most will completely skip all the flowery language you agonized over getting perfect.

bandit0013 wrote:

It's almost finished (still playing around with content/images), but I finally am getting around to launching my consulting site.

Penny for your thoughts?

http://www.wiseconsultingllc.com/

Logo and name of company in header should be links back to the landing page.

Would recommend another pass through the color scheme. Contrast is sorely lacking in a few places (David Kirkpatrick attribution, apprenticeship link, etc.).

If you're quoting the software craftsmanship manifesto wholesale, would a link to their page be possible? Also, do you have permissions for these images?

Why the segmentation of the three images at bottom of landing page?

Agreed with complexmath; make sure you take another pass through the copy for grammar and style. "Computer Scientist & creator of PASCAL" -- either capitalize "creator" or (preferably) lower-case "Computer Scientist". Just as inconsistency in coding style casts disproportionate doubts upon functionality, inconsistency in English language style can negatively impact client confidence to a surprising degree. Pick an established style manual and adopt it, proofreading any serious text that reaches a client (website copy, contracts, formal emails, etc.).

Also agreed on fewer fonts/sizes. Noticed a minor stylistic defect that you should bear in mind to make sure it doesn't crop up elsewhere: in the footer, the name of your business is in a smaller font than the copyright boilerplate.

Page speed audit in Chrome devtools is quite good, and the response time is quite zippy, but if you're looking for another thing to polish you can tackle the last few issues (YSlow would be as valid as Chrome devtools).

I successfully sent a message to you with no name or company, phone number "23987" (or similar), and email address of "[email protected]" -- consider a tiny JavaScript helper to validate contact form inputs. Not sure what you're doing with that information server-side, but don't leave yourself vulnerable to anything malicious.

Nitpick, but it will probably look classier not to expose ".html" in your URLs. All the cool kids do URL rewriting.

... Okay, done for now! We critique because we care. Good luck!

Thanks guys. A lot of the stuff you mentioned is on the list, since it is "almost done".

I'll have to look into that contact form, it's still not finished (validation) but in essence it's just a jquery ajax post to a php mailer.

Hopefully I'll get some references as I do more work. Just got started this spring, so I only have a few subcontract gigs, trying to find my own gigs, more profitable.

Regarding contract work in general, I've done just enough to know that you really have to stay on top of the details of the contract. If you agree to work based on a vague specification you could end up with the client trying to force you to do work that you hadn't priced for. Find a good boilerplate contract somewhere online and be really pedantic when writing up the requirements. Your clients should appreciate your thoroughness and it helps avoid being stuck between not paying rent or getting into a legal dispute later on. Make sure to bundle health care, insurance, etc, costs into the fee.

complexmath wrote:

Regarding contract work in general, I've done just enough to know that you really have to stay on top of the details of the contract. If you agree to work based on a vague specification you could end up with the client trying to force you to do work that you hadn't priced for. Find a good boilerplate contract somewhere online and be really pedantic when writing up the requirements. Your clients should appreciate your thoroughness and it helps avoid being stuck between not paying rent or getting into a legal dispute later on. Make sure to bundle health care, insurance, etc, costs into the fee.

That's why I put in the 'fix it for free if not to specification'. I don't work without specs.

On an unrelated note, I downloaded and installed Couchbase today (2.0 beta). As a MS-SQL guy I'm curious to see what all the hype is about. Install was pretty clean, though it put in a bogus IP that I had to back out and push in for localhost (I think it tried to use the public ip on the router or something). Got a hello world up in pretty quick order. So... 8/10 on the install experience, one issue, pretty easily resolved via the forums.

bandit0013 wrote:

On an unrelated note, I downloaded and installed Couchbase today (2.0 beta). As a MS-SQL guy I'm curious to see what all the hype is about. Install was pretty clean, though it put in a bogus IP that I had to back out and push in for localhost (I think it tried to use the public ip on the router or something). Got a hello world up in pretty quick order. So... 8/10 on the install experience, one issue, pretty easily resolved via the forums.

First foray into non-RDBMS data storage?

A few guys at work are itching to try Couchbase, and I'm a little curious myself. We've been using HBase for a few projects, and it's... interesting. I've had fun with MongoDB in non-production environments (and my old company is now using it in a limited capacity in production)... I would love to get back to using it, as I remain cautiously optimistic about their ongoing efforts to improve write safety and reduce the scope of write locks -- the API and support are pretty stellar. Now what I'm itching to find a use case for is a graph database; Neo4J looks pretty slick and I'd love to tinker with it sometime.

Hey guys. I've not read this thread. I really know nothing about programming beyond crestron but I handle our website and they want this google form to email responses and I'm stuck.

It's just javascript if I'm reading correctly but I'm lost on this one part:

Some field names are of asinine length like "Where did you hear about us?" and worse... I need to figure out how to match that in my code. Normally I just do this:

if (field == 'First Name') {
firstname = e.namedValues[field].toString();
}

But how do I match part of a field and not the whole thing? I've tried a few things and no luck yet, this was the latest attempt:

if (field.indexOf("hear about us") == 1) {
hearaboutus = e.namedValues[field].toString();

Can anyone point me in the right direction?

ibdoomed wrote:

Hey guys. I've not read this thread. I really know nothing about programming beyond crestron but I handle our website and they want this google form to email responses and I'm stuck.

It's just javascript if I'm reading correctly but I'm lost on this one part:

Some field names are of asinine length like "Where did you hear about us?" and worse... I need to figure out how to match that in my code. Normally I just do this:

if (field == 'First Name') {
firstname = e.namedValues[field].toString();
}

But how do I match part of a field and not the whole thing? I've tried a few things and no luck yet, this was the latest attempt:

if (field.indexOf("hear about us") == 1) {
hearaboutus = e.namedValues[field].toString();

Can anyone point me in the right direction?

Why can't you just use the full element name as you were previously doing?

You could regex it. loop through the form elements and grab the ones whose names match the pattern you're after

for(i =0; i < document.FORMNAME.elements.length; i++) { if(document.FORMNAME.elements[i].name =~ /hear about us/) { DO STUFF } }

or this:

var oForm = document.getElementById ('FORMNAME'); var text = oForm.elements["Where did you hear about us?"];

Sorry if those don't quite work it's kind of off the top of my head and I've moved most of my javascript element access to JQuery style syntax.

DanB wrote:
ibdoomed wrote:

Hey guys. I've not read this thread. I really know nothing about programming beyond crestron but I handle our website and they want this google form to email responses and I'm stuck.

It's just javascript if I'm reading correctly but I'm lost on this one part:

Some field names are of asinine length like "Where did you hear about us?" and worse... I need to figure out how to match that in my code. Normally I just do this:

if (field == 'First Name') {
firstname = e.namedValues[field].toString();
}

But how do I match part of a field and not the whole thing? I've tried a few things and no luck yet, this was the latest attempt:

if (field.indexOf("hear about us") == 1) {
hearaboutus = e.namedValues[field].toString();

Can anyone point me in the right direction?

You could regex it. loop through the form elements and grab the ones whose names match the pattern you're after

for(i =0; i < document.FORMNAME.elements.length; i++) { if(document.FORMNAME.elements[i].name =~ /hear about us/) { DO STUFF } }

Why can't you just use the full element name as you were previously doing?

or this:

var oForm = document.getElementById ('FORMNAME'); var text = oForm.elements["Where did you hear about us?"];

I'll look at that, thanks.

I could probably just use the whole field name but some of them are long like:

"Question 93: Please describe any steps you have taken in setting up your business (e.g. formed an open structure, obtained a Tax ID #, adopted bylaws or a finance agreement, formed a board of directors, applied for a patent or other intellectual property protection, etc.) *"

and I don't even know if it'll accept the special characters in a variable.

ibdoomed wrote:
DanB wrote:
ibdoomed wrote:

Hey guys. I've not read this thread. I really know nothing about programming beyond crestron but I handle our website and they want this google form to email responses and I'm stuck.

It's just javascript if I'm reading correctly but I'm lost on this one part:

Some field names are of asinine length like "Where did you hear about us?" and worse... I need to figure out how to match that in my code. Normally I just do this:

if (field == 'First Name') {
firstname = e.namedValues[field].toString();
}

But how do I match part of a field and not the whole thing? I've tried a few things and no luck yet, this was the latest attempt:

if (field.indexOf("hear about us") == 1) {
hearaboutus = e.namedValues[field].toString();

Can anyone point me in the right direction?

You could regex it. loop through the form elements and grab the ones whose names match the pattern you're after

for(i =0; i < document.FORMNAME.elements.length; i++) { if(document.FORMNAME.elements[i].name =~ /hear about us/) { DO STUFF } }

Why can't you just use the full element name as you were previously doing?

or this:

var oForm = document.getElementById ('FORMNAME'); var text = oForm.elements["Where did you hear about us?"];

I'll look at that, thanks.

I could probably just use the whole field name but some of them are long like:

"Question 93: Please describe any steps you have taken in setting up your business (e.g. formed an open structure, obtained a Tax ID #, adopted bylaws or a finance agreement, formed a board of directors, applied for a patent or other intellectual property protection, etc.) *"

and I don't even know if it'll accept the special characters in a variable.

Hang on, can you show some of the actual html for the form elements you've got? There ought to be an easier/more direct way to do this.

DanB wrote:
ibdoomed wrote:
DanB wrote:
ibdoomed wrote:

Hey guys. I've not read this thread. I really know nothing about programming beyond crestron but I handle our website and they want this google form to email responses and I'm stuck.

It's just javascript if I'm reading correctly but I'm lost on this one part:

Some field names are of asinine length like "Where did you hear about us?" and worse... I need to figure out how to match that in my code. Normally I just do this:

if (field == 'First Name') {
firstname = e.namedValues[field].toString();
}

But how do I match part of a field and not the whole thing? I've tried a few things and no luck yet, this was the latest attempt:

if (field.indexOf("hear about us") == 1) {
hearaboutus = e.namedValues[field].toString();

Can anyone point me in the right direction?

You could regex it. loop through the form elements and grab the ones whose names match the pattern you're after

for(i =0; i < document.FORMNAME.elements.length; i++) { if(document.FORMNAME.elements[i].name =~ /hear about us/) { DO STUFF } }

Why can't you just use the full element name as you were previously doing?

or this:

var oForm = document.getElementById ('FORMNAME'); var text = oForm.elements["Where did you hear about us?"];

I'll look at that, thanks.

I could probably just use the whole field name but some of them are long like:

"Question 93: Please describe any steps you have taken in setting up your business (e.g. formed an open structure, obtained a Tax ID #, adopted bylaws or a finance agreement, formed a board of directors, applied for a patent or other intellectual property protection, etc.) *"

and I don't even know if it'll accept the special characters in a variable.

Hang on, can you show some of the actual html for the form elements you've got? There ought to be an easier/more direct way to do this.

Yeah, the elements themselves should hopefully have "id" attributes, so you can use something like:

var q93 = document.getElementById("question_93");
Bonus_Eruptus wrote:

Yeah, the elements themselves should hopefully have "id" attributes, so you can use something like:

var q93 = document.getElementById("question_93");

Yeah, I wasn't thinking straight. It'll be much easier to access as per the element IDs

It's a google form so I'm not working directly with the html in the background but here's a snipit:

"Entries":[{"EntryType":6,"Required":false,"GoToPageEnabled":false,"EntryId":5,"OtherOptionEnabled":false,"Choices":[],"Position":0,"QuestionTitle":"Personal Information","Composite":false,"HelpText":""},{"EntryType":6,"Required":false,"GoToPageEnabled":false,"EntryId":64,"OtherOptionEnabled":false,"Choices":[],"Position":1,"QuestionTitle":"","Composite":false,"HelpText":"1. Name"},{"EntryType":2,"Required":true,"GoToPageEnabled":false,"EntryId":110,"OtherOptionEnabled":false,"Choices":[{"SelectedByDefault":false,"Value":"Mr.","Label":""},{"SelectedByDefault":false,"Value":"Mrs.","Label":""},{"SelectedByDefault":false,"Value":"Ms.","Label":""}],"Position":2,"QuestionTitle":"Prefix","Composite":false,"HelpText":""},{"EntryType":0,"Required":true,"GoToPageEnabled":false,"EntryId":0,"OtherOptionEnabled":false,"Choices":[],"Position":3,"QuestionTitle":"First Name","Composite":false,"HelpText":""},{"EntryType":0,"Required":true,"GoToPageEnabled":false,"EntryId":1,"OtherOptionEnabled":false,"Choices":[],"Position":4,"QuestionTitle":"Last Name","Composite":false,"HelpText":""},{"EntryType":0,"Required":false,"GoToPageEnabled":false,"EntryId":2,"OtherOptionEnabled":false,"Choices":[],"Position":5,"QuestionTitle":"Suffix","Composite":false,"HelpText":""},

I can't tell what google is using for element ids. Their code is a mess.