- 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
Are you guys even reading what Mason is writing? His statements indicate a preference for higher level languages that can manipulate below the abstraction layers. The attacks on him are along the lines of "why don't you make your own clothes?!"
I mirror this preference, I love me some BASH and Python, but even in C++ you have to know what happens when you declare that char recvBuffer [MAX_BUFF_SIZE] (the memory demands of your program just shot up). I agree that if you can't understand what's going on at the assembly level, you're contributing to the problem. However, I am far from asking someone to actually write assembly, except as a learning exercise in the same way that student preform derivations by hand. Like with anything that you wish to become good at, you have to understand what is happening and why it is happening that way.
2nd submission...
Admin
To be honest, I did this one time with Lua, to see if it would work. But it was more like an actual array, with just a few items, on a hobby site that never went public.
Now I'm installing MySQL.
Admin
WIN!
Admin
Admin
Thank you! That's exactly what I mean. At least one other person here gets it.
Yep. I haven't actually written any assembly in a couple years now, but I often find myself tracing through the CPU View when I'm debugging, if that's where the problem is or if I'm in a module with no source available, and if I didn't know how to read it I'd have a lot of trouble.
Admin
Honestly, it was far from the worst I've seen... I would probably have the array in memory, and pushed out to a serialized file that gets loaded when the application loads. The data set here is relatively small, so having it in memory isn't a huge deal. This doesn't say anything, though about tracking changes along with order state, order history, or customer information, which is probably the bigger issue. I once dealt with an application where the variable were _m1, _m2, _3, ... _m42, and the usernames and passwords were in a database table called "Phone2" (true enough).
Admin
That's absurd.
Reminds me of a consulting job I did converting an accounting system from Foxpro to an As400. The Foxpro system was created in someone's basement. Each day the last user would start the final step in the daily procedures and go home. It was to calculate a total and did some unspeakably stupid and unecessary things. I replaced it with one SQL statement that took about 20 seconds to execute.
How do these people get these jobs?
And what kind of consultant gets up and walks out when confronted with this all too frequent bad coding?
Admin
Yea.... I'm pretty sure Scott was making a joke
Admin
Well, I don't use the STL, I'll admit, but not because it's an abstraction layer. I don't use it because it's built upon the C++ language and its template system, both of which are massive WTFs. (But that's a completely different argument.) I'm fairly competent in C and very good at Delphi, which is about as high-level as you can get and still be in native code, with an extensive, mature framework library that I love using.
But the nice thing is that it doesn't force me to. Delphi's libraries are object-oriented and its visual controls wrap the Windows API well enough that you don't have to know anything about Win32 to get most things done. But if you don't want to use any given feature, you aren't locked into it. (Unlike, for example, Java, in which you can't choose not to use objects.)
Admin
What's gets my blood boiling in Windows is when a long running background task doesn't set itself to a lower priority - e.g. Windows or Outlook search, Memeo backup, Norton scanning, etc., etc., etc. A fix can be as simple as one line, something like this in services:
SetPriorityClass(GetCurrentProcessId(), BELOW_NORMAL_PRIORITY_CLASS);
or like this in multi-threaded apps:
SetThreadPriority(GetCurrentThreadId(), THREAD_PRIORITY_BELOW_NORMAL);
This kind of thing you'll never see in a .NET or Java application. Just not part of the mindset.
By the way, when I wrote Memeo about it, they "fixed" it by setting the UI to a lower priority but kept the backup engine as-is. Now in Memeo the UI takes forever to show but the background engine still runs at full priority slowing your machine to a halt. I decided not to talk to them any more.
Admin
If you ignore the fact that your modern machines do more.
Look, your Apple ][ booted up quickly. Fine. Now let's see it sort a 40 million row CSV fil-- what's that? Can't do it? Awww. Well, your NES turns on instantly, let's see it play a Netflix-- oh can't do that either. Poor baby.
Admin
Mason, I agree with your point about it being a good idea to know what's going on behind the scenes when you use a high-level language, but I have to object to the "code" vs "script" distinction: unless you are applying voltages to the CPU directly with wires from your brain, your so-called "code" is interpreted by other software. Even zeros and ones are abstractions of a sort. I don't get the attitude that because compiling C# happens in two steps and compiling C happens in one step, that it's somehow an entirely different thing.
Admin
Holy mother of god you idiots are easy to troll.
Admin
@Zylon: So what's new?
The primary audience who comments here are programmers who want to feel good about themselves because "at least I'm not that bad".
Hence, a good amount of them will respond defensively if you challenge that notion.
Incidentally, real men program with a magnetized needle and a steady hand.
Admin
[quote user="Engival"][quote user="Spivonious"]That said, if he absolutely wants to avoid SQL (maybe it's a db of 10 items), there's STILL better ways to do it. Dump your data to a text file as a csv or some kind of serialized array. You don't just go generating new source files on a whim, that's dumb.[/quote]
I've read a lot of stories on TDWTF, this is the first time I've ever seen a story who's situation could be improved with XML.
Admin
You're either a clever troll or a complete idiot.
The irony here is that in the next paragraph you rail on programmers who rely too heavily on abstractions, when, in reality, your NES and Apple II never had a HDD, a TCP/IP stack(okay, this is possible but not likely), or a 3D accelerator. Besides, I'd compare loading times of an Apple //e's Disk ][ drive with a ps3.
Admin
Well, uhm... there's also the opposite.
There is Fefe's Blog, a German blog that advocates online freedom, open source software and argues against web censorship of any kind.
AFAIK it is written in C++.
Admin
Come on, this is easy. Trivial, even. Take your current storray, iterate over the components, plop them into a database. Write a cute front-end to maintain them. Heck, write an adapter if you want which can translate the numbers into proper fields.
The brainless programmer is another matter, I suppose.
Admin
Enlighten me, please. What is the problem with the template system?
Admin
Admin
Mind you this is only because management insists on using fancy buzzword technologies like "electricity." As soon as that fad dies, we'll be back to REAL real programming, with rocks and sticks and nothing else. Don't cut yourself on the sharp parts! Rock=0, stick=1, and that's the way it was and we liked it!
Admin
That it's ugly as balls.
Admin
Don't "yuck" my "yum".
Admin
What is it you think happens when someone writes code (scripts?) without ever having programmed in assembler? Do you think the code is universally unreadable, or horribly inefficient, or buggy, or what?
Admin
Admin
I noticed that despite the fancy talk, you failed to actually explain the WTF. Which leads me to conclusion that you are really one of those dumb fellows, but actually doing a pretty good job looking smart. Would you happen to work in management?
Admin
Admin
To be fair, this guy has met all of his design requirements.
Admin
LMAO, "stupid baby languages", you just excluded most of the programmers on the planet who create real apps, solve real business problems, and make good $$ doing it - asshat, all you left out was a comment like "M$ sucks and the penguin rulzzzzz". When will you kids ever learn to stop generalizing and grow up.
Admin
Based on what?
Admin
Based on?
Admin
I reckon it's this page.
http://www.giftshopperhq.com/tools/ryobi-tools.php?p=0
Admin
The biggest problem of high level languages is evolution. If you think something is completely idiot proof, the nature will breed a bigger idiot and prove you wrong (as we can see every day on this site).
Real programmers understand the advantages of high level programming concepts but they don't need a high level language to make use of them where appropriate. That's my definition of "real programmer".
Admin
Said as if that's a bad thing. And, oh wait, the computer doesn't run the source code of your "real" programming language either, another program compiles it first. Shoot, an abstraction! Guess what, unless you throw the electric impulses at your CPU by hand you're always dealing with abstractions in programming.
And half your job as a programmer (real or otherwise) is to understand the faults in your tools.
I agree with this point in general, but I wouldn't go as far as the assembly level. You don't need to be able to translate your code to assembly to be a good programmer, but having at least a general idea a) that there exist lower levels and b) that abstraction X works better than abstraction Y at the lower levels is important to a point.
You're forgetting that the PS3 or any modern OS are doing a lot more stuff than the IIe or NES did, and that coordinating and writing all this stuff in a low-level language is just about impossible in any realistic time-frame. Abstractions, encapsulation, interfaces and all that stuff were invented just to be able to deal with ever more complex software. Yes, there's a performance drop while the computer does its song and dance to go through all the proper interfaces and protocols you have dreamt up instead of just flipping the bit at the other end of the memory directly, but the increase in stability and manageability for the human is immense and necessary.
Having said that, modern computers are terribly slow! ;-)
Admin
I thought you were going to use a database?
Admin
I assume that since you stopped at the assembly level, you do understand that some abstractions are not necessary nor worth exposing. So isn't it reasonable to assume that for some problems, the abstraction of assembly is just as unnecessary? As an example of such problem, think about something like an online shopping cart application. How would knowing assembly be useful for implementing that?
Admin
Look again...
He didn't say he wanted to explain it, merely the chance to explain it.
Definitely in management.
Admin
Program doesn't quite mean what you think it does. The word program come from the Greek pro- (before) and graphein (to write) and therefore it's core meaning is "write in advance". As regards to computer, programming is simply the action of writing in advance the tasks that the computer must execute. How this is accomplished, whether through an interpreter or in asm, is irrelevant.
And, I don't know about Java, but in .NET, you can easily fall back to unmanaged code if needed.
Admin
I don't know enough about what's going on in the NES or PS3 to comment on those.
However, with old PCs versus new PCs, a big part of the bootup problem is that the bootup sequence code runs mostly in series, when much of the code has to wait for relatively slow device responses; running the initializations in parallel could make the process a lot faster. Of course, the reason they don't do that is that messing up those initializations could cause significant issues.
Further, when you're talking about intel compatible systems, they not only run in series, but they also use the oldest, slowest mode available.
And don't get me started on what's going on for MacOS X - OMFG. (Actually, that could be an abstraction issue - it could be I only think it isn't because I understand at a low level how it's messing up.)
It's really not Mason's best argument - the biggest issue isn't the encapsulation at all.
I believe Mason's point was that the resulting compiled program runs directly, through an abstraction layer. If one is so inclined, one can muck with the binary directly to effect some small changes (I've done it on rare occasion - but it's generally far easier to make changes to the source and recompile. Failing that, it's usually easier to disassemble, tweak, and reassemble - but you'll point out that's using an abstraction layer again. And you'll also point out my hex editor's also an abstraction, as it shows the code in hexadecimal format, rather than electrical impulses.)
Of course, that only really matters when the performance is critical - and most of the time, it isn't.
Yes, but as any experienced programmer on ancient MacOS (pre X) knows, if your abstraction layer doesn't allow you to work around it, there are things you just cannot do. Understand the fault all you want - the application will still bomb when certain conditions arise, and the only thing the application developer can do is disable the functionality near that bomb. (Yes, many bombs were things which could be fixed. Not all of them were.)(Disclaimer: I fled the MacOS programming scene when I went to college, over this issue. I've heard it remained up until MacOS 9 (and has some tendrils in 10, but fewer people run into them), but my last real exposure was around MacOS 3 or 4. Which I've mostly repressed.)
Agreed, to a point. One also needs to have some concept for how things are implemented. For example, knowing about how associative arrays work beyond just the simple fact that they run a lot slower than standard arrays, but handle non-integer indices and sparse arrays can be useful in optimizing code which uses associative arrays. It also can help you determine when one should use an associative array versus traditional array versus a multi-level array assortment.Further, knowing quite a bit about the way things work at a lower level is insanely useful if you want/need to do debugging with strace/truss/dtrace or similar programs. I've debugged about a dozen different programs that were running into problems with unchecked errors, and thus behaving erratically. Things like assuming that mkdir(2) always works, sleep(2) always waits exactly the requested number of seconds, and execve(2) never returns. (Yeah, I know - the last is a very common misconception, some compilers even have it. But the POSIX definition for execve(2) clearly lists a number of errors for it, and indicates it will return -1 if it does return.)
Also, it can be phenomenally useful to be able to code inner loops in lower level languages when the situation calls for it.
Admin
I can't speak for lolwtf, but for me it's based on using that pile crap.
Admin
Erm… Maybe you wanted to say one abstraction layer (instead of several)?
Exactly. Programmer hours are often worth more than CPU time.
I completely agree. The thing is, these days it's mostly a non-issue, really. I can't recall the last time I have found a bug in a compiler or interpreter, if it was reasonably mature. If you're choosing an immature platform to do your coding on you're expecting bugs in the compiler/interpreter, but who really does that these days?
Sure, the more you know, the better. If you get the general idea of how things work at an assembly level, even if you couldn't assemble your way out of a wet paper bag, is usually enough though. As you said yourself, often you're not bothering actually descending to that level, because it's a lot less hassle to just change something in the abstraction layer.
If you're a real-time embedded systems guy, you absolutely need to know assembler. Heck, you should know your way around with an oscilloscope. If you're a GUI-app developer on any reasonably recent OS, you mostly don't, it's a lot more important to know your libraries in and out. If you're a Java or .NET or PHP or whatever guy who's mostly coding business logic with a bit of output, what makes you a good programmer is rigorous discipline and clean structuring ability (+ knowing your libraries), since an internally consistent and (business-)logically bug free app is much more important than a wasted CPU cycle or two.
Admin
Yeah, I've heard this one already... ten years ago...
The real main difference between web programmers, desktop programmers and real programmers is that real programmers don't waste time with religion wars and don't really give a .... weather they have to code for web or desktop, they just learn and code.
P.S. By the way, don't your genuine full web apps use servers? Oh, maybe servers are written in HTML, how would I know...
Admin
When I was a boy, our Computer Science department told us that the school did not need a Time Share system. 24 turn-around (cards and printers) was good enough for their students.
I see that MS has decided that ASP.NET does not need to do dynamic scripts.
Admin
To add to what other people are saying about the original post, the biggest oversight is data integrity. There is nothing to stop a developer from putting a string where a date or number ought to go. How do you define allowed ranges on dates or numbers? This is to say nothing of enforcing uniqueness and referential integrity. To call this an epic fail is an understatement.
FTW!
Admin
All the world will be your enemy, ASP programmer. And when they catch you, they will kill you. But first they must catch you. Be cunning, and full of tricks, and your softwares will never be destroyed!
Admin
Now what the hell was he thinking? Rewriting that code with .NET could have provided him hundreds of hours of work and thousands of dollars in cash.
Standing up and walking away to the nearest bar was real WTF.
Admin
Except if it's a progress bar...
Admin
Since I have used the below code numerous times in .NET apps, I think you should shut the fuck up about things you obviously know nothing about.
Process.GetCurrentProcess().PriorityClass = PriorityClass.BelowNormal;
Thread.CurrentThread.Priority = ThreadPriority.BelowNormal;
Addendum (2009-12-31 06:21): Also, you fail at trolling.
Admin
Agreed, classic ASP makes me break out in cold sweats whenever I see it. VBscript... ugh.
You cannot call PHP "object-oriented" when it doesn't even have a built-in "string" object. It can be made OO, but it really isn't out-of-the-box.
No, the "brain" was lazy and stupid. It doesn't take much smarts to implement a storage system in that way, in fact it's far easier (and requires far less effort = lazy) to do so than to use a database. Also, you have to be stupid to not be able to recognize that such a system might be simple to write, but a nightmare to contain.
Admin
You win over nine thousand internets for that comment.