251 reputation
17
bio website lattyware.co.uk
location Leicester, United Kingdom
age 22
visits member for 1 year, 5 months
seen Oct 20 '13 at 18:24

My name is Gareth Latty. I'm a programmer, I write code, designing and developing computer programs and websites. I do freelance work, and also contribute to open source software.

I use a variety of languages and tools, but I love the language Python.

I am currently in the final year of a Computer Science degree at the University of Leicester.

Website - LinkedIn - SO Careers


Oct
22
awarded  Yearling
Nov
5
comment Is it bad style to redundantly check a condition?
As a note, the python syntax for this would be a generator expression: (line for line in lines if line.startswith("a") or line.startswith("b")).
Nov
5
comment what kind of certificate needed for my application ?
I was referring to the line 'I was wondering if I need to purchase any kind of license for them ?' - what license?
Nov
5
comment what kind of certificate needed for my application ?
Are you confusing the terms license and certificate in the first sentence? They are two very disparate things.
Nov
5
comment Is it bad style to redundantly check a condition?
It could be that those lines are being used for something else, and they need to be dealt with before dealing with the "a"/"b" lines. Not saying it's likely (the clear name implies they are being discarded), just that there is a possibility it's needed. If that set of lines is repeatedly iterated over in the future, it could also be worthwhile to remove them beforehand to avoid a lot of pointless iteration.
Nov
5
comment Is it bad style to redundantly check a condition?
I would argue the latter is a bad idea, as it's less explicit - if you later decide to add a "c", it could be less clear.
Nov
5
comment Is it bad style to redundantly check a condition?
It's basically about whether or not you are coding defensively. Do you see this code being edited a lot? Is it likely that this is going to be a part of a system which needs to be extremely reliable? I don't see much harm in shoving an assert() in there to help with testing, but beyond that is probably excessive. That said, it'll vary depending on the situation.
Nov
4
comment What is the difference between “data hiding” and “encapsulation”?
You can have one without having the other - look at Python, where there is no data hiding at all (no such thing as a private or protected attribute).
Nov
4
comment Knowing so much but application is a problem?
Sounds like you haven't spent enough time writing code. The simple answer is, write as much code as possible and get used to it.
Nov
2
comment Does a programmer really need college?
It's worth noting that there are a lot of degrees here in the UK which do a year in industry after your 2nd year, and it's possible to do a summer internship during your degree too, so there are lots of ways to get professional experience while doing a degree.
Oct
29
comment Application of LGPL license on a simple algorithm
As far as I understand, you can't copyright or patent an algorithm, only copyright the exact code implementing it, or patent a solution using it.
Oct
27
comment Who owns the IP rights of the software without written employment contract? Employer or employee?
My suggestion: Talk to a lawyer.
Oct
27
awarded  Commentator
Oct
27
awarded  Critic
Oct
27
awarded  Supporter
Oct
27
awarded  Teacher
Oct
27
awarded  Editor
Oct
27
comment Is saying “if ( $a != null && $a == 5)” the same as “if ($a == 5)”
@user127379 Almost certainly. It's extra code serving no purpose, it just makes it less clear and probably slightly slower. Don't get me wrong - it's going to be insignificant performance wise, but it is entirely pointless. In a language where == could be overloaded to a very expensive operation, this might be worth doing, but I'd argue that the design would need to be changed.
Oct
27
revised Is saying “if ( $a != null && $a == 5)” the same as “if ($a == 5)”
added 49 characters in body
Oct
27
answered Is saying “if ( $a != null && $a == 5)” the same as “if ($a == 5)”