|
TRex EaterofCars posted:We used to have this nonsense along with making sure we named each class with a public static String MODULE. We used to have to update version numbers in multiple files in every svn commit. It was the source of frequent conflicts.
|
# ? Aug 22, 2010 03:21 |
|
|
# ? Apr 27, 2024 10:31 |
|
And you did it more than once before writing a commit hook to do it automatically?
|
# ? Aug 22, 2010 03:22 |
|
svn:keywords revision http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html
|
# ? Aug 22, 2010 13:48 |
|
Plorkyeran posted:And you did it more than once before writing a commit hook to do it automatically? I wasn't 'allowed' to change it for four months or so.
|
# ? Aug 22, 2010 13:48 |
|
tef posted:I wasn't 'allowed' to change it for four months or so. That's the best part. "Listen, you're doing everything totally the wrong way." "I know but we're not going to change it now" "Why not, it'll take me 15 minutes to set up" "Because I said so" "Please retire "
|
# ? Aug 22, 2010 21:13 |
|
TRex EaterofCars posted:That's the best part. This is why I maintain a build system written over ten years ago for a startup that's only about 18 months old.
|
# ? Aug 22, 2010 21:19 |
|
tef posted:This is why I maintain a build system written over ten years ago for a startup that's only about 18 months old. Do you like working in a fast-paced dynamic environment?!
|
# ? Aug 26, 2010 13:35 |
|
Today I profiled our code and identified a major hotspot, with about 100,000 calls to the second function per page hit:code:
|
# ? Aug 27, 2010 10:07 |
|
Man, every time I look at that code, I see something new that's wrong with it
|
# ? Aug 27, 2010 11:49 |
|
I saw this today and just stared in wonder.code:
|
# ? Aug 27, 2010 16:38 |
|
If you think that's a coding horror, your codebase is probably ok. I can think of a totally valid reason for that. The Color class isn't under your control and features general color management things, for your app you want to have a consistant UI, and you're starting with their definitions of what constitutes DARK GREEN, but that might be changed in the future.
|
# ? Aug 27, 2010 16:53 |
|
king_kilr posted:If you think that's a coding horror, your codebase is probably ok. I can think of a totally valid reason for that. The Color class isn't under your control and features general color management things, for your app you want to have a consistant UI, and you're starting with their definitions of what constitutes DARK GREEN, but that might be changed in the future. No, actually, it makes about as much sense as: code:
code:
|
# ? Aug 28, 2010 01:51 |
|
Jabor posted:No, actually, it makes about as much sense as: There's only one "seven"; there's thousands of shades which can be called "dark green".
|
# ? Aug 28, 2010 02:50 |
|
king_kilr posted:If you think that's a coding horror, your codebase is probably ok. I can think of a totally valid reason for that. The Color class isn't under your control and features general color management things, for your app you want to have a consistant UI, and you're starting with their definitions of what constitutes DARK GREEN, but that might be changed in the future.
|
# ? Aug 28, 2010 19:04 |
|
Orzo posted:..and if that changes in the future, so does COLOR_DARK_GREEN. What? But it can be fixed by just changing the definition of COLOR_DARK_GREEN instead of tracking down the (presumably several) places where a dark green color is used.
|
# ? Aug 28, 2010 19:36 |
|
Why wouldn't you just specify a particular shade of dark green in the first place if you cared that much
|
# ? Aug 28, 2010 19:45 |
|
Maybe someone specified "dark green" and the developer just picked the default implementation and left the separate declaration in case it needs to be changed?
|
# ? Aug 29, 2010 01:27 |
|
So if Constants.DOT == "."; is in our code (and it is!), that's cool, because someone might decide to change the definition of a period one day. Just in case.
|
# ? Aug 29, 2010 03:34 |
|
Kilson posted:So if Constants.DOT == "."; is in our code (and it is!), that's cool, because someone might decide to change the definition of a period one day. Just in case.
|
# ? Aug 29, 2010 03:42 |
|
Janin posted:it's a lot easier for some picky boss to say "can you make the buttons a bit darker" than to redefine the english language Then it should be labelled something like BUTTON_COLOR instead. ...do you write code like this yourself and are trying to defend it, or something?
|
# ? Aug 29, 2010 04:04 |
|
The only place something like that makes sense is if you are writing an abstraction layer to hide several different underlying platform options.
|
# ? Aug 29, 2010 04:11 |
|
Jabor posted:Then it should be labelled something like BUTTON_COLOR instead. It's not particularly hard to imagine being instructed to "make it dark green", and using that so it can be easily changed in case that isn't the "right" dark green. It might have made more sense to put it under BUTTON_COLOUR or whatever, but for all we know it then actually is - as well as LABEL_COLOR and LINE_COLOR and BORDER_COLOR and ten other ones like it.
|
# ? Aug 29, 2010 04:14 |
|
Jonnty posted:It's not particularly hard to imagine being instructed to "make it dark green", and using that so it can be easily changed in case that isn't the "right" dark green. It might have made more sense to put it under BUTTON_COLOUR or whatever, but for all we know it then actually is - as well as LABEL_COLOR and LINE_COLOR and BORDER_COLOR and ten other ones like it. Then, as I suggested before, we have UI_PRIMARY_COLOR or similar. All the benefits of COLOR_DARK_GREEN, but even more flexible for if you don't want it to be dark green any more!
|
# ? Aug 29, 2010 05:14 |
|
Something I think we can all agree on is that dark green is the best color for a bike shed.
|
# ? Aug 29, 2010 06:22 |
|
A A 2 3 5 8 K posted:Something I think we can all agree on is that dark green is the best color for a bike shed. The only place something like that makes sense is if you are painting a base layer to hide several different underlying ugly colors.
|
# ? Aug 29, 2010 06:34 |
|
Maybe somewhere else it says that the UI_PRIMARY_COLOR is COLOR_DARK_GREEN and this is just so when some jackass graphic designer comes in and says "Our corporate branding rules specify Pantone 3442 for dark green and on my lovely uncalibrated monitor it doesn't quite match this test patch I am holding next to it under a fluorescent lamp. Also I have no idea how color works. Or monitors. I just need to find a reason for this to fail my review in order to prove to someone that I actually do something around here. FIX IT." you can fix it easily.
|
# ? Aug 29, 2010 09:12 |
|
If we were to follow the rules of CSS class/id naming then that constant is invalid. One should never write a class (or in this case a variable) where it describes an attribute. Because COLOUR_DARK_GREEN may end up being changed to return blue and suddenly the variable name is misleading and the code has begun to rot. Jabor is right, the variable should be named based on what object it represents, not an attribute of that object. for instance BUTTON_COLOR, TABLE_COLOR, FRAME_COLOR, HIGHLIGHT_COLOR...
|
# ? Aug 29, 2010 11:38 |
|
Color values should never be specified directly in your code. They should always be loaded from an external XML config file.
|
# ? Aug 30, 2010 08:09 |
|
Nigglypuff posted:Color values should never be specified directly in your code. They should always be loaded from an external XML config file. NOOOOOOOOOOOOOOO You are a moron. Don't even speak. Recommending an XML config file??? This is a joke, right? XML config files are for scrubs. Your worldview is, and always has been, obsolete.
|
# ? Aug 30, 2010 09:22 |
|
Instead of XML, I set up a database called "My Objects" and I just add a new table for every CSS element id selector I want to use, then set up individual columns on each table depending on the attributes I want to use. Each of these tables has its own reference table for colors and such so there's no accidents changing a color in one place and having it change in another. For CSS class selectors, I just make a new table referencing all existing element id selectors and I made a trigger to auto-cascade/delete bi-directionally. Any advice to polish this guy further?
|
# ? Aug 30, 2010 09:29 |
|
baquerd posted:Any advice to polish this guy further? You should probably wrap your columns' values inside <column_name></column_name> so that you can serialize them more easily.
|
# ? Aug 30, 2010 09:42 |
|
shrughes posted:You should probably wrap your columns' values inside <column_name></column_name> so that you can serialize them more easily. Nice, that'll really cut down on the post-processing actually, thanks! I came up with a helpful naming scheme that should improve code readability if you want to borrow it: if the element or object existed in HTML 3 or before, I use perl_syntax and if it's 4.0 or later I use javaSyntax. Still working on some parsing issues though, so I've got it replacing every tag with a block of DHTML that gives me blinking iframes for some visual debugging.
|
# ? Aug 30, 2010 09:50 |
|
baquerd posted:Nice, that'll really cut down on the post-processing actually, thanks! I came up with a helpful naming scheme that should improve code readability if you want to borrow it: if the element or object existed in HTML 3 or before, I use perl_syntax and if it's 4.0 or later I use javaSyntax. Let's not forget HTML 3.2, a version number which, the last time I checked, is greater than 3 and less than 4.0. We could use ALLCAPS for HTML 3.2 elements. baquerd posted:Still working on some parsing issues though, so I've got it replacing every tag with a block of DHTML that gives me blinking iframes for some visual debugging. That's M$-specific, it won't work in Netscape 4. It's better to wrap your elements in a pair of tables, so that you can identify elements with a border. Like so: code:
|
# ? Aug 30, 2010 10:07 |
|
shrughes posted:That's M$-specific, it won't work in Netscape 4. Got it covered. JavaScript user agent detection on a per-build basis for maximum compatibility. quote:It's better to wrap your elements in a pair of tables, so that you can identify elements with a border. This doesn't work
|
# ? Aug 30, 2010 10:34 |
|
baquerd posted:This doesn't work Sounds like you are not using AnyBrowser.
|
# ? Aug 30, 2010 14:44 |
|
shrughes posted:This is a joke
|
# ? Aug 30, 2010 16:20 |
|
Vanadium posted:Sounds like you are not using AnyBrowser. I use Mosaic thanks.
|
# ? Aug 30, 2010 16:33 |
|
That won't really work in Links, my browser of choice.baquerd posted:Any advice to polish this guy further? I've gotta quit my job. It's not that far-removed from what keeps me from writing code every day
|
# ? Aug 31, 2010 02:05 |
|
This is in C#, in an ASP.NET project I've inherited.code:
|
# ? Aug 31, 2010 12:04 |
|
|
# ? Apr 27, 2024 10:31 |
|
Nevett posted:This is in C#, in an ASP.NET project I've inherited. That made me look at what Google would suggest as C# IsNumeric function and to my horror the first two where a Convert.ToInt32() with try/catch around it and the third a friggin' Regexp. Ugggghhhh.
|
# ? Aug 31, 2010 12:15 |