|
I don't think these are the bad Idea or junk or crap etc. whatever you called it.
It just the way of programming. And it the way the programmer want it to be.
One Algorithm can be done in many way.
So If you think you can write a better one, You should not shout into their face an say something Like
"Your code is bad. I found this junk in your code. I am the best." Impressive Huh!?
What you should do is give them a suggestion, Though it free
|
|
|
|
|
Well... you can lead a horse to water...
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
And remind him he was drinking poison...
It feels good to learn and achieve
|
|
|
|
|
Not only the code uses hardcoded "enums" and uses everything as strings, it also does very "useful" IFs.
if(cboTipoIncentivo.SelectedValue == "414")
dtIncentivo = oIncentivo.ConsultaCreditoIncentivo("", txtN_Processo.Text, sIdf_Pessoa, cboTipoIncentivo.SelectedValue);
else
dtIncentivo = oIncentivo.ConsultaCreditoIncentivo("", txtN_Processo.Text, sIdf_Pessoa, cboTipoIncentivo.SelectedValue);
|
|
|
|
|
Looks like a breakpoint construction to me. I would consider using such things myself assuming you can't break on an empty code block.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: I would consider using such things myself assuming you can't break on an empty code block.
;
xacc.ideIronScheme - 1.0 beta 3 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Right click on the breakpoint's red ball => Condition.
Here you go!
Admittedly it does slow down the program a bit...
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Thanks. I'll give it a try sometime next week.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Super Lloyd wrote: Admittedly it does slow down the program a bit
Yup. Don't even try to use it in a loop...
Greetings - Jacek
|
|
|
|
|
A switch would have been more fun!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Even more fun: inheritance. And delegates
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Haha, why make simple when we can make it complicated!?
Challenge: write a 12193 lines long C# program which convert any value to the integer value 1 (or 0).
Bonus point: all method should be called, through different path, for any values!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Looks developer is in hurry to finish code or he/she missing some work to do in condition.
|
|
|
|
|
My favorite...
if(5 == 5)
do something...
else
do the same thing...
|
|
|
|
|
Once I travled 400 miles to interview with a startup. All went well untill I was handed a pencile and a white sheet of paper and asked to write a recursive function in C# to produce a Fabbinicc sequence. Needles to say I didn't get the job. Do these people know that recursive algroythms = spigetti code?
Hey Interviewers here is an IQ test:
Penciles are for drawing as code is to?
Hmm, the only thing important about Fabbinicci numbers and programming is that 1^n + 2^n ... + x^n has infinate solutions. And I'm not writting crypto software so it doesn't really matter.
~~~~~~~~~~~~Update~~~~~~~~~~~
I have learned much from this thread. Thanks to all who gave me a hard time!
As a result of all my research and learning I created a 'Big O Analyzer'.
Hope it helps someone other than myself.
Big O Algroythm Analyzer for .NET[^]
~~~~~~~~~~~~Update~~~~~~~~~~~
'The great advantage of recursion is that an infinite set of possible sentences, designs or other data can be defined, parsed or produced by a finite computer program.'
Reference: Wikipedia on Recursion
~~~~~~~~~~~~Update~~~~~~~~~~~
If you tried the Big O tool and were disapointed that it did not find any Big O's at all, it's been updated. At infinity point = 1000 it's about 99.9991% acurate (good as gold). You might need to use .00002% brain power to figure out what the Big O is.
~TheArch
modified on Wednesday, July 22, 2009 4:56 AM
|
|
|
|
|
Message Closed
modified 20-Jun-23 15:43pm.
|
|
|
|
|
Hmm, yeah! I can pass a test on code only 50% pass but but fail an english test 100% people pass.
infinate = ∞
|
|
|
|
|
Message Closed
modified 20-Jun-23 15:43pm.
|
|
|
|
|
Hmm, Both, Shout first ask questions later.
The identy is related to eclidian geometry identies and 'Hilbert's Tenth Problem'.
|
|
|
|
|
Hmm your from Switzerland... Work at CERN by chance?
|
|
|
|
|
I'd say the second, but I'm not English either..
|
|
|
|
|
Second one ofc, unless you put a ',' before the 'stop shooting' in the first one, but then it would mean something else xD
WTF has that to do with the code horror btw?
GSoC 2009 student for SMW!
---
My little forums: http://code.bn2vs.com
---
70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
|
|
|
|
|
The Fibonacci sequence doesn't have that formula. It's the recurrence relationship Fn-1 + Fn-2, with seed values of F0 = 0 and F1 = 1. And it seemed to be a test of your capability to write recursive functions. You're right about one thing though - pencils and paper aren't a development environment. They might be useful for simplifying an algorithm, or brainstorming (oh, how I hate that word) ideas, but when testing how well somebody writes code, they need to be in as close to how they would develop while at the company as possible
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
I think pencil and paper are superb for coding and especially planing!
I use them a lot. If I have to write complexer functions I first draw or write a pseudo code on paper and see where the difficulties can appear.
Then I start coding.
My experience is that ,in the latest during testing, you will save some time.
Or if you start up with a new project and you think about the best strategy to attack the problem.
Paper and pencil (or pen) is the best to do.
Cheers
Ps.: What has this to do with Coding horrors. Was looking for a laugh, but now I am disappointed.
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
Hmm,
Well if you want a laugh... I broke the pencile four times, lead twice and then I broke the pencil in half after erasing three holes into the paper. I am a visual type myself, I see all the code in my head orginized into simple structures of reusable logic, for complex things over ~200 lines of code, I use state diagrams and use cases. But I don't use a pencile for that. Seems like a wasted step. I can orginize my ideas using graphics tools. Me personal fav. is MS One Note.
|
|
|
|