Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×

Comment Re:Subs and functions (Score 1) 477

Being able to separate your code into small logical pieces makes it easier to understand, test and maintain.

Well said! Bravo!

Breaking code into smaller logical pieces is paramount to making it maintainable. When you or someone else goes to maintain it in the future and finds there is a problem with a specific portion, such as with writing data to the database, they should be able to find the database portion and trace back from there.

A good example of this principle of logic separation is with code that interacts with a database. I've worked with some custom PHP code that had a lot of interaction with a database, but all the connections were done directly when needed instead of using a class (or even just a function). The effects of this decision had a ripple effect:

  * parameters to the connections had to be given inline
  * connection strings had to be globally accessible, though were regularly hard-coded
  * SQL had to be written & executed inline
  * checking for rows returned/rows affected/errors had to be done for each call manually
  * code was regularly created via copy/paste
  * variable re-use often caused errors (previous call was successful, last call wasn't, but variable continued to have a successful appearance)

The first thing I would have done, had I been allotted the time, was to integrate an abstraction layer for the database. Separating this logic would have allowed for the ability to write-out SQL statements to a text file for analysis--which is very helpful for determining where a database can be optimized (i.e. better indexes, etc).

This specific level of separation would also allow for moving to a different database with a smaller impact on the code: modify a smaller set of code to connect to a new DBMS, then use it to track any issues resulting from the new database. Not only does it help save time, but it avoids rewriting a ton of code!

Comment Re:Subs and functions (Score 1) 477

When I first started coding, I did everything inline: no functions, classes, or anything. Then I saw code that was mostly functional, and noticed how much easier it was to use a function to avoid duplicating code all over the place. The object orientation came later, and was a very welcome addition, as it helped to split things into specific (or generic) containers for storing and manipulating data.

That said, I feel that moving things into functions is very important, even if that function is only called once. Putting things into functions forces you to define exactly what is happening in a way that allows it to be reused. This also helps with introducting unit-testing or other types of testing to ensure your code is running properly.

Comment Re:thousands of government bureaucrats (Score 1) 406

If RFID chips are instituted as a way of attempting to control people, identity theft will/can be more widespread. The data from an RFID chip is very easily read. Even if there were a password associated with the RFID, this would be rudamentary to steal, since few people utilize strong passwords. Now imagine it took no more than the right ID+Password to completely hijack another's identity... it would be like handing out kits with a person's DNA, SS #, driver's license, mother's maiden name, full set of fingerprints, and the last 30 unique passwords they used. I vote yes to nationwide stupidity.

Comment Re:Go! (Score 1) 512

Yes, they sound different. But the point is that it is two languages that are separated by a non-alphanumeric. C, C#, C++... they're all different programming languages, all pronounced differently ("See", "See Sharp", "See Plus Plus"), but look similar.

Oh, and I need your geek hat.

Comment Re:Go! (Score 1) 512

I can just see it now:

JACK: "So, you used 'Go exclamation point'?"
ALEX: "Actually, now we refer to it as 'Go Bang'."
JACK: "You mean like when you're talking about those shell scripts and you say 'she-bang'?"

The sexual connotations will just never end. Awesome. I think the next big programming language should be called 'F-U' and be pronounced...

Comment Re:Go! (Score 1) 512

Obviously, "Go" and "Go!" are different. Like "C" and "C#". It is the exclamation point that makes all the difference (if you can't see the sarcasm here, you need to remove your geek hat).

JACK: "So, what programming language did you create FruzzleBunnies 5.0 in?"
ALEX: "I wrote it in Go!".
JACK: "Oh, that Google language, eh?"
ALEX: "NO! I wrote it in 'Go exclamation point'."
JACK: "Right. Guess I thought you just had too much caffeine the first time you said it."

Comment Re:Hello Streisand (Score 2, Insightful) 505

I would venture to guess that the retraction wasn't for the reasons that it appeared to be. Mr. Simon Aldous made a statement that essentially compared Microsoft to Apple, but I don't think the issue at hand has anything to do with any "stealing ideas from Mac" or anything like that; the problem is that Simon basically said, "Mac's interface is better than ours and has been for a long time, so now we're gonna start making ours look like theirs, 'cuz ours sucks." Joe-Bob might read it and think, "wow, Microsoft even says Mac is better, why don't I just buy a Mac?"

Comment Re:Well... (Score 1) 189

I absolutely agree. From a global perspective, Microsoft is very wrong for not allowing all systems to receive the most important security updates.

But from Microsoft's business perspective, it is in their best interest to give just anybody updates, as doing so would suck away even more bandwidth. It also devalues the purchasing of valid licenses: "I can get all the updates with my pirated copy? Why the hell should I buy a copy then?"

[WARNING: M$-bashing in 3... 2... 1...] The only reason anybody even thinks about security now is because of how terrible Microsoft's implementation (or lack thereof) has been so far. People seem to believe that viruses are just a part of owning a computer. They think that Microsoft Office is the only word processing system there is, and all the ones I've seen that received a non-Microsoft document (like "*.odf") figured that the file was corrupt if they couldn't open it in Word.

I could sit and rant all day to just about any born-and-raised Microsoft user that there are other OS's out there that are free of viruses (not to mention free of cost), and they just won't care, because they can't even differentiate between the operating system and the software. Running 20 different programs on their computer just to get 80% of the viruses removed is commonplace, even if they have to pay a lot of money for several of them.

"Your Windows XP workstation got formatted because you were infected with a virus? Well, we got this fancy-dancy Windows 7 here for ya, for only $300. Come this way, and I'll show you all the hardware you're going to need to make your computer run..." [20 minutes later] "... or you could just spend $2000 on this brand new system that already has it."

IMHO, Microsoft doesn't give a damn about its users. Pirates are pirates. Even granny down the street that managed to reinstall Windows XP using some (perfectly valid, unused) key she got from her neighbor. MS doesn't care about the economy either, as long as they're getting paid.

Comment Re:Well... (Score 1) 189

Let's think about this not from a moral perspective, but from a business one. In all reality, it is better for Microsoft to ignore those with pirated copies of Windows and thereby allow botnets and viruses to flourish: they're "in bed" (or at least used to be) with anti-virus companies, and now they're making their own; what good is an anti-virus program if there isn't widespread infection? "Illegitimate" systems having high infection rates (and generally lowered performance) gives more validity to the idea that people should pay for a valid copy of Windows.

(I could add a great blurb here about switching to other systems that have only a tiny fraction of the vulnerabilities of Windows, but this isn't a Microsoft-bashing.)

Comment Re:Monopoly is a horrible game (Score 2, Interesting) 81

Not only do some people enjoy the game, but some people also modify the game a bit to be more fun. For instance, my family plays using two boards joined at "Go". Twice the monopolies. We add a rule where the utilities are counted as transports ("Railroad Tycoon"), so a person with the entirety of transports on one board gets $800 instead of a measly $200. There's all kinds of other rules we add, like larger/more dice, which works very well on the double-board game.

Education

Submission + - University of Phoenix: Technical Failure

CrazedSanity writes: "I have been attending Axia/University of Phoenix online for some time now, with just a handful of courses left until I finally get my Associate's degree in IT. Keep in mind that I had over 8 years of professional experience in the area (specifically web application development) prior to going for the degree, so I'm really just getting it so my resume looks a little better.

I recently failed one of my classes due to a slew of poor grades and a final paper that mysteriously disappeared. There appears to be nothing I can do about the final (I attached the file, even checked multiple times that it was attached, as the teacher would not accept resubmissions for any reason), since I forgot to also it as an email to the instructor. The technical staff failed to give any useful information regarding whether or not the file was ever actually submitted.

It is important to note that at least 5 other students were given zeros on the same assignments for the exact same reason. No resubmissions accepted. One of the students was stationed in Afghanistan, something that the teacher was told, and she wouldn't even give him any leniency. That's patriotism for ya.

Now with only 15 points standing between me and a passing grade, I received a letter stating that technical problems are not valid reasons for a grade dispute. The dispute in question is over a "paper" wherein I had to build a basic webpage with a few specific tags, CSS, etc: I submitted it as a *.txt file by accident, so the teacher gave me a zero. The original instructions said nothing about the file's extension, so I assumed text or html would be (and technically are) equally acceptable.

Because of two other failed classes--both math, one of which I took again and passed--I am no longer eligible for student loans or apparently any other financial aid. In order to qualify, I have to pay out-of-pocket for the next two classes to the tune of just under $2000. Do you have any advice? I don't want to go the lawyer route because I am very light in the wallet..."

Slashdot Top Deals

Thus spake the master programmer: "After three days without programming, life becomes meaningless." -- Geoffrey James, "The Tao of Programming"

Working...