- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
In some situations where non-coding managers want to mess up the UI or some other aspect of the design, I've had success saying, "this will cost a lot more than letting the radio buttons and check boxes work like normal" (which is true) or "I don't know how to do that" (which is sometimes true, depending on the desired feature).
And then I stop talking. No argument.
Admin
Someone should lock Atwood and Spolsky in a room and toss the key.
Admin
I guess you missed their point: I presume that they fuss over the pretty abominable C syntax. Remember: syntax by itself is a barrier to entry, and a completely useless one. By itself, syntax is worth next to nothing. Vide successful Lisp projects (Yahoo Stores nee ViaWeb, Orbitz) where syntax was molded to the application (with macros & read macros), not the other way around. I doubt that they fuss over the concept itself.
In several languages (Arc, Lisp, Scheme, Perl, Python) references to functions (having functionality of C function pointers) are 100% painless. In C, I used to pull up my cheatsheet. And then you get C++ (and Pascal!) with implicit function pointers (virtual methods), only to confuse matters some more. That's where you have things that behave like function pointers, but are not written as such. Yay! Very useful, but does it inherently "make sense" ? No.
Compare this Perl example
or this Arc example [more readable than Lisp]
to this:
Go C!, go go, er, better not.
Cheers, Kuba
Admin
I think you're right, I should stop reading this page and spend the time on something that's going to grow me instead of amuse me. Thanks Mr. guest speaker
Admin
In that vein, I would offer the following suggestion:
Lesley Anne Robertson Simple Program Design: A Step-By-Step Approach
I feel very lucky, in that when I started my formal education in programming, this book was the text for the first six weeks of class. We didn't touch a compiler or code editor until we had spent time studying the underlying process of functional decomposition that Ms Robertson teaches.
The book focuses on procedural programming, but the principles it teaches extend well into object-oriented approaches. There is a good reason to have private scope on OOP functions, and that is to allow methods to be broken down into comprehensible and easily-maintainable components, without exposing them outside of a class. a bit more functional decomposition within class definitions would bear great fruit in providing solid functionality to client code.
The other biggest tips that I would give to the new programmer are:
Use natural language and real words in your identifiers. code will be much more comprehensible and maintainable if your variable state clearly what they represent, and your function names tell you clearly what purpose the code is intended to accomplish. It's been many years now since programming languages have imposed length restictions on identifiers, so there is really little need to garble code with cryptic abbreviations.
Use line-breaks and whitespace well. Good programming languages tend to be whitespace-insensitive. The line for (i = 0; i < limit; i++) { will compile just as readily as for(i=0;i<limit;i++){ and IMHO is much easier to read and, if necessary, debug. Likewise, using an end-quote, concatenation operator, new-line, and open-quote may take a few extra keystrokes, but if it means the difference between a statement that scrolls off the right of a screen and one that can be seen an comprehended in in toto, it will save a lot of grief in the long run.
Take a break. Sitting in front of a computer screen at all times can really narrow ones perspective, and a broad perspective is critical to understanding the real-world context in which your code will be used.
Admin
i'm laughing at you.
Admin
I rather like bad code, as an independent contractor being called in as the fixer of bad code is very lucrative indeed.
I like the bad Indian code if only to make me look better when it comes to my manager's perspective.
Admin
to all those that say "i never write bad code":
look for an other job!
we do not need people that can not reflect and accept they sometimes do make mistakes
Admin
We all write bad code, just to different degrees. For a moment, let's assume that writing code is like riding a bike. You could say that 'everyone falls off their bike'. Therefore, even Lance Armstrong falls of his bike.
This analogy implies that everyone screws up at an equivalent rate, and is also equivalently (un)skilled at their job. This implication couldn't be more flawed. While it is true that everyone makes mistakes, we don't all screw up code like people in WTF stories do (thankfully).
I know I'm a good coder, but I also know that some people are way more talented at coding than I am. Just as I know that Lance doesn't fall off his bike nearly as often as I do (and I hardly ever fall off), and when he's not falling off the bike, he rides much harder, faster, and longer than I can.
Admin
I agree that C/C++'s syntax can be a pain to remember (I can never remember how to write template classes for example, even though I use Standard Template Library stuff all over the place). But to be fair, in C it would be much better to write:
But then C is still displaying it's irregularities now, since the standard typedef syntax is:
typedef [old type] [new type];
Whereas for function pointers the thing seems all mixed together. As for this:
Ouch, I never realised that was possible o_O
Admin
The really scary code, the ultimate WTF, is going to be when it knocks at your door and ask:
"Is your name Sarah O'Conner?"
Yea laugh, it could and probably will happen...
Admin
Meh, by the time it happens you'll probably be able to reply
"No, my name is Sarah O';DELETE FROM targets;"
And go get a latte.
Admin
I'm guessing: Person 1: cowboy tony Person 2: Mary Person 3: coding machine Person 4: silent bob
Interestingly I myself have shown traits of all of them. I find it facinating that most of the comments so far have devolved into "those who can vs. those who can't" again. That does seem to be contrary to the point of the article, which nobody seems to have disagreed with so far (I haven't read all the comments.)
The point, as I took it, is that we need to be more helpful to those who can't. We all right bad code (I wrote some last week), and we all right good code. Even "those who can't" occasionally put out a gem. One of the first concepts I learned from Agile is "criticize the code, not the coder". Honestly I remember that one the best because it was probably the hardest for me. It's easier (for me at least) to mock then to be helpful. We also need to make sure criticism is constructive. Mocking, while fun, is not criticism and does nothing to help those mired in supporting bad code.
captcha: why would I post that?
Admin
I couldn't put it better myself, evanm.
Too often, professional and amators alike are thrown into the same pool of talent, only expected to deliver. Surely, there's a much better way to organized such a varied workforce for the benefit of everyone.
I think a lot of it has to do with a generalized plug n' play hiring mentality. As long as companies keep hiring "techies" to take care of whatever's under the hood, the professions of software development will only live up to blind managerial expectancies and mediocrity will be rampant.
Many employers don't want to admit themselves that they're not only in the business of producing value for their customers, but also of investing in the professional growth of each of their employees. I'm sorry to say that I have yet to find a company which sufficiently cares for what its employees, professionals, care about to genuinely commit themselves to building and maintaining a working environment that's conductive to quality output. More often than not, this kind of growth has to be realized through individual effort, which can become tiresome with time... and only marginally rewarded.
Following your comment, I could also go ahead and bring up that there's a larger divide between, say, mechanical engineers and mechanics than there is between the software professions, where good "algorithmicians" are also expected to be great coders, and good coders architects, and so on... Software developers, it seems, are expected to be all around great at everything or be tagged with the mediocrity label. So, before pointing at management, maybe we should all start by having a look at ourselves and acknowledge first that each of us has something different to bring to a team.
Admin
The real WTF
Coding Horror = dork who does op ed pieces that usually turn out to be product reviews. This site even though it says its about .net code you will never see a single code snippet to laugh at.
Worse Than Failure = dork who doesn't know what a good thing is until its gone. Like the name. Hey at least you have code I can laugh at.
My pong clock is more gay than yours.
Admin
I stopped writing bad code the moment I discovered the "Generate Random Code" button that comes with all IDEs today.
Admin
Admin
As documented by the authors blog and my own personal experience in interviewing CS graduates with Masters & PHds, there are some that can't even answer the most basic programming questions, let alone code. I have been developing for over 26 years and looking back at how I wrote code before college, I can say that I wrote alot of WTF code for those old apple II, LISA and TRS 80 machines, but it was a learning experience that led to a great career, where I can take WTF code and refactor or rewrite the code into better code, or even correct my own first pass at solving a problem.
At this stage of my career I have to write text as much as I write code, and I have found that when creating documents, the first attempt may be just trying to get my ideas out and that the rest is just a refinement, of the original idea.
Over the years I have done created many models and created a lot of paper describing the solution, but I also found that sometimes, spending all that time preparing takes more time and leads away from the simplest solution and burns alot of the customer's time. It is just as effective to create some code to solve all the problems and then refactor the code to elegant streamlined code.
The trick is to for the developer to be able to look at the code and realize that the code they write should be looked at and streamlined, broken out, or dropped from their solution.
In the eighties I also found what I still believe today, is that Writing Code is as much ART as Science. In the eighties when looking for potential programmers I found that people with music degrees made excellent programmers, they had the math skills, and they knew how to correctly string things together without wasted movements, all they had to be taught was the language to use.
So a degree is not a very good indicator, I think the tests like the old Wolf test and simple questions like the authors Fizz Buzz test is a start.
Admin
Answers
1). Mary 2). Machine 3). Cowboy 4). Bob
And Bob is turning into another coding machine.
Admin
Seminal - Without Question!
Admin
Except for myself being perfect, I'd say you're spot on.
Admin
John Titor, is that you?
Admin
Admin
Admin
I think that the problem is that our industry is still very young and immature (what, 50 years only?). We clearly don't have the right tools, nor the right theories, nor the right training, at least to achieve the goals we set for ourselves.
Take cars. I've always been amazed at how dependable they are. They adapt to any driving style, they take shocks and holes in the road, they will continue to move even in hostile environments, etc. But this did not happen overnight, it literally took 100s of years! I would say the same for houses, roads, etc.
CS and IT on the other hand are completely new fields and they cannot really build on experience inherited from the past (not even mathematics). Yet, we're already able to make some really amazing stuff. Today our programs are usually very fragile and do not adapt to hostile inputs, unexpected conditions, etc. They have countless bugs, misfeatures, they're not user friendly, they don't report errors... I guess we must all be very humble and accept that this is only the beginning of the industry. We need more time to understand how to make things better.
Admin
I would probably reply:
1100110111010111000111101011100000111100111011111110101
As I activated a massive EMP...
Admin
And I have seen many with formal CS education whom I would like to revoke the authorization to develop from.
Admin
Hi Zak,
Strange question, but I've often wondered why people include their captcha in their comment. Please enlighten this poor soul :)
Admin
I see a lot of xenphobia on this forum... there is a lot of reason because overseas workers are cheapers... Money exchange is one of them. I worked with excellent non-USA programmers and also I maintaned horrible code produced in USA. Guess what: there is good and bad programmers both, inside and outside USA!!
Admin
nice
Addendum 2022-11-02 23:27: The promotion of every initiative, in my opinion, depends primarily on content marketing. Therefore, it's crucial to locate qualified authors that can give you high-quality essays. As for me, I selected a literature review services organization where I could get excellent papers on academic subjects for my site. It is highly practical, and I have complete faith in experienced editors and specialists who are certified.
Admin
"world's ugliest dog" reminds me of VERY old cartoon called "Mighty Man and Yukk". Yukk was a anthro dor who usually wore a hood shaped like a small doghouse on his head. he was so ugly, his face would literally shatter mirrors, make cameras explode, make MOUNTAINS COLLAPSE...