Another computer question...

What's going on here? It's been popping up when I run a search from the browser bar – anyone else getting similar?

IMG_4879.jpeg
 
What's going on here? It's been popping up when I run a search from the browser bar – anyone else getting similar?

View attachment 7680
I don't usually use Google but I switched (temporarily) to it and didn't get the message. Probably didn't do enough searching to trigger it. One possibility is that you or someone using the same ISP have been bombarding Google with rapid requests. I've had similar messages from other sites when I've only accessed it once. As far as I could tell I wasn't infected with a virus/bot or whatever. So it must be another user(s) on the same ISP (?).
 
I had BBC News on in the background and caught a bit of "Tech Now". Some deformed code scrolled up the screen and I saw a construct which I've probably used but I don't think is good practice.
The code appeared to be Python and went something like
Python:
For i,j in something
    # some code
    if raw < T:
        continue
    # some more code
# end of loop
Isn't it preferable to reverse the condition in the "if" such that
Python:
For i,j in something
    # some code
    if raw >= T:
        # some more code
# end for loop
(In Python the indent replaces { and } in C, Java etc.)

I will probably still use the first construct occasionally, but I think it hampers clarity and complicates debugging. What do other programmers think?
 
I have no idea about Python, but in general it is easier to read code (it requires less nesting) if the exception is tested first. That way, the "break" (if the exception is true) is only one line and nested +1, while the non-exception code doesn't need to be nested at all.
 
I think it hampers clarity and complicates debugging. What do other programmers think?
I use whatever feels right in each particular case, but generally would do what you suggest. Sometimes if the indentation level gets too annoying I'll stick the "continue" or "break" in, but generally that means the function needs splitting up anyway.
I get annoyed with stuff that sticks religiously to 80 character limits as well. It's 2026, not 1986 and we are not using 80x25 displays any more. Of course, excessively long lines get even more annoying, so I usually limit them to about 120.
 
Back
Top