loubacca

- friends
388 link karma
26 comment karma
send messageredditor for
what's this?

TROPHY CASE


  • Verified Email

Put the Jews behind electric fences, you say? Hmm... by larsdabneyin atheism

[–]loubacca 0 points1 point ago

So if the gays and lesbians can't reproduce on their own and apparently straight people can't make gay and lesbian babies...

how did the gays and lesbians show up at all??

Now I'm so confused! ;-)

Quadruple Rainbow by Krusein pics

[–]loubacca 0 points1 point ago

What does it mean?!? What does it mean?!?

Meanwhile in Tucson, AZ by loubaccain pics

[–]loubacca[S] 0 points1 point ago

Scale: 1 spider leg span = 1 adult hand span!

What is your pseudocode style? by s0n0fagunin learnprogramming

[–]loubacca 1 point2 points ago

Yes, it's critical...but it's inside a page specific event handler. Not terribly conducive for any kind of reuse.

A bunch. :)

I've been programming for over 30 years, taught for 6. I taught myself BASIC in the early 80's on a TI-99/4A and then an IBM PC-Jr (no really)

My first professional gig in the early mid 90's was working with PowerBuilder. I moved on to VB, ASP, JavaScript, C/C++, C#. I've also taught C++, Java, x86 Assembly and a variety of Linux shell scripting.

Like I said, I like your commenting style, but I feel like something is missing when the "why" of some code isn't obvious. I just feel that 30 seconds of writing a comment could save someone hours of digging around later. :)

What is your pseudocode style? by s0n0fagunin learnprogramming

[–]loubacca 0 points1 point ago

Hmmm...seems odd to write a new function for just this

public bool IsNewRouting(string arg)
{
      return arg == "";
}

Of course...if I did it this way, then I'd also implement your commenting style, like this: // Is this a new routing? If so parameter will be empty

Seems convoluted (especially for this example)...but maybe there is some merit in more complex cases, but not like this.

What is your pseudocode style? by s0n0fagunin learnprogramming

[–]loubacca 0 points1 point ago

but you should avoid writing such code, where possible

Agreed.

I do like your function comments...but this isn't quite what I meant.

Brian Kernighan has said, "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it"

So I write comments to help me (and other programmers) figure out what I was up to when I come back six moths later. From my current project:

// decide if this is a new or updated routing - command arg is empty for new routings
if (e.CommandArgument.ToString() == "")

I can guarantee that a new programmer to the project would have no idea what it means to the data that the routing is undefined.

If I don't comment this...what would you suggest as an alternative?

What is your pseudocode style? by s0n0fagunin learnprogramming

[–]loubacca 0 points1 point ago

You can improve the code all day...but at some point there is some very simple code that has very complex reasons for a specific implementation. Perhaps the boss asked for very strange behavior that forced your coding hand or perhaps you wrote something so that it works well with another component but is outside your normal approach or maybe you implemented something just because it worked well with a known bug in a third party tool. In other words, code can be very clear in even very complex solutions, but sometimes no matter how clear the code is, it may not answer the question, "Why, did I do this?"

Having trouble understanding OO by gringo1980in learnprogramming

[–]loubacca 0 points1 point ago

Every time I explore a new programming concept I learn I try to understand what business problem or coding dilemma is the new tool trying to solve...after all that is all programming does, help us solve our problems.

What does OOP solve?

Hmmm...perhaps I need to make a game. My game has a player and the player has a name and a score like this:

String name;
int score;

So far so good. But now I want to make a multiplayer game and there are going to be 5 players. I suppose I could copy and paste the same code, like so:

String name1;
int score1;
String name2;
int score2;

and so on. It would be annoying, but not impossible.

Let's really turn the screws...let's make an epic game where you could have as many players as wanted to play AND you had no idea how many players were going to play. This copy and paste solution won't work.

We now have a problem we can solve with OOP. Make a Player class.

Public class Player {

    String name;
    int score;
}

How many of these could you make? 1? 100? 10000? You bet! How hard would it be? Piece of Cake.

Oh no! we forgot to add Team name to each player. If you had not used OOP you'd be stuck doing this:

String name1;
int score1;
String TeamName1;
String name2;
int score2;
String TeamName2;

and on and on for as many players as you had created.

With our new player class we can do this:

Public class Player {

    String name;
    int score;
    String TeamName;
}

And now you can use the team name for any player that needs it! Which method do you prefer? ;-)

There is so much more to OOP than this simple example - inheritance, encapsulation, polymorphism and many more funny sounding words, but like any programming concept they are there to either solve the business problem or make our lives as coders a little easier. Hopefully this is not a vague analogy, but something you can really grasp.

Go slow, be patient and you will get there!

Good luck!

How do I develop programming "logic"? I feel like an idiot in my CS class by [deleted]in learnprogramming

[–]loubacca 0 points1 point ago

That's fantastic! Good luck!

And for what it's worth I constantly use flowcharts for the occasional tricky algorithm. I do these mostly in my head, but if something really requires some extra thought, I'll jot down the algorithm flow I'm shooting for. It helps me remember what I plan to do, ensures I thought through the entire process and often serves well as a launching point as documentation for customer support or even customers.

Paula Deen Listed on Maxim Top 100.. Reddit, you know what to do by linkhyrule14in funny

[–]loubacca 2 points3 points ago

We passed it.

Sometimes Yes is not the answer by loubaccain iiiiiiitttttttttttt

[–]loubacca[S] 1 point2 points ago

LOL No...apparently it's an epidemic!!

Sometimes Yes is not the answer by loubaccain iiiiiiitttttttttttt

[–]loubacca[S] 0 points1 point ago

Oh no, I understand what you're saying, but I'd sure hate to pick A and find out he really wanted B. If my memory is working, his brain finally engaged and he called me and clarified.

Sometimes Yes is not the answer by loubaccain iiiiiiitttttttttttt

[–]loubacca[S] 5 points6 points ago

  • I'll keep that in mind.
  • Thanks for the tip

How do I develop programming "logic"? I feel like an idiot in my CS class by [deleted]in learnprogramming

[–]loubacca 3 points4 points ago

For 6 years I taught all experience levels in C++. As one person noted, your frustration is not uncommon. In fact, there were two very specific points in the course where students would struggle: at the very beginning in the intro course and at the point you are describing.

The mental leap you are attempting to make takes you from structured programming to a completely different methodology. Don't get discouraged, it will take some time.

Not knowing exactly what your struggling with I can offer just a few tips: Forget the flowchart - while effective before, it is not as suitable to OOP. Try to think of the things you need to create to solve the problem. You can come back to the flowchart for Main but it can trip people up starting OOP.

Build in tiny, tiny chunks. Write a few lines of code. Compile and fix. Continue like this with 3-5 lines of code at a time. As you get better, you will naturally increase this, but start small. This will be much less intimidating and will make the bug fix process much easier.

I like to write my classes first. (actually if you're not doing it this way, you may be struggling more than we all realized.) Main stays blank for a good long time. After I feel comfortable that I gave it my best shot creating the class(es) then I create (instantiate) one example of the class in Main. Compile and fix. Same as above go slow.

Ask for help. It used to drive me crazy that students would struggle and struggle and never ask for assistance. Something that you are stuck on may take the instructor just a few minutes to explain again so you understand. It's much better to ask than to spin your wheels. I encouraged my students to come sit with me in the lab so I could code with them, it's a great experience and I got to give them more direct attention and see immediately if there were any stumbling blocks that could be torn down.

Learn to read the text. This is hard. I know developers older than dirt that sometimes struggle with this. Most programming text books are very difficult to read, but this talent is worth every bit of blood, sweat and tears you pour into it. Read the explanations, step through every line of the code with your finger as the compiler. You should be able to see what each line will do. If you can't, read the explanation again. Back and forth your eye should jump between code and text until you go, "Ohhhhhh, well that makes sense."

Finally, take breaks...so you can persevere. Coding is tough, you need to walk away maybe even sleep on it before a solution will come to you!

Good luck!

Keep us posted on how you do!

The biggest mistake made by novice programmers trying to debug their code. by dmazzoniin learnprogramming

[–]loubacca 5 points6 points ago

Start with Occam's Razor followed by a healthy dose of the Half-split method

Alternative to Crystal Reports? by [deleted]in learnprogramming

[–]loubacca 0 points1 point ago

Someone already mentioned SSRS, but I would also add Telerik Reporting

http://www.telerik.com/products/reporting.aspx

I found the tools easier than CR and with similar features.

Best Christmas Card photo, EVER! by zhuukain pics

[–]loubacca 0 points1 point ago

The rest you say? We must have them sir!

Reddit Store Owners, what tricks do you use to get customers to spend more money? I'll start with something I noticed at Best Buy... by expiredcheesein AskReddit

[–]loubacca 1 point2 points ago

And Kohl's. Them: "You saved $200 today!"

Me: "I just spent $200 on 100% marked up goods then discounted 50% back to their real value."

Overdraft by $9? Get $308 in fines. by The_Fontin WTF

[–]loubacca 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Complete BS!

view more: next