Okay, so I just recently started messing with furniture making. I know a little bit about making stuff and scripting but I wouldn’t call myself a pro just yet. Anyway, I’m using the Mizzy's Furniture Script (whole sale version) to add the animations to my furniture. I really like the whole set up with it but there’s a problem I’m having and that’s getting the position right. I found a scripted called Pos Rot Determinator script which is supposed to tell me the position of my avie. Well the issue is even with that I’m still having issues with positioning the animations. The Mizzy’s Furniture Script wants something like this <0.55, 0, -0.40> and when I use the Pos Rot Determinator I get something like this <0.3343345, 0.0000, 0.45433> do I need to round the number off to the nearest whole number or something? I’m not a math genius so this is really giving me a headache, lol. Any help, tips, advice or anything would be helpful before I start pulling my hair out!! I paid a good amount of L’s for the Mizzy’s Furniture Script and I would really like to use it without the hassle of sitting, standing up, sitting and standing up again to get the correct position!
Don't worry about rounding..put in the numbers that your Determinator is giving you. LSL takes several decimal points of precision -- it's just your Determinator is being a bit more precise than the example
Peach, have you tried any other animation positioning scripts? This one is L$0 and I have found it very easy to use: https://marketplace.secondlife.com/p/Easy-SitTarget-Tool/1462278
Related
I'm a newer than new newbie ... and I think this question should be part of the thread Newbie - Game Development (iPhone) - New to Objective C and Game Dev but I could only find an "answer" post window. I'd like to ask a related question.
If I were to develop a game in GameSalad or Stencyl, would I be able to look at the actual code of that creation and maybe import it into something more complicated like Cocos2d-x or Unity3D later on?
I ask, because happybadgers advised in that above mentioned question/answer to start out in something like GameSalad -- sort of jump into creating a game while learning objective c. But I imagine a person would eventually want to do more than "drag and drop" coding as their skills increased ... so -- could you take your drag and drop creation(s) and pop it/them into something that lets you play with the code more?
I'm aware that this may be a stupid, naive or stupidly naive question, so please excuse me, if so.
Thank you for your time. And if you vote to boot this question, I hope you'll explain the error of my ways.
As far as I know you cannot view the code directly in Gamesalad. However, a lot of the logic behind the game will be easy to replicate in code once you get the hang of it.
An example of this is the statements that you use such as if, while, for, get and set will all be available in Unityscript. You will not be able to convert your game into a Unity file however the art assets will be transferable.(So basically you can keep the aesthetic of your game,but you will just need to translate the drag and drop to code.)
Good luck,
p.s
(If you are really struggling with some code, just send me the drag and drop logic and I will do my best to convert it for you).
I'm trying to create what I'd assume is a very straightforward piece of physics code using Chipmunk on iOS, which will effectively have eight UIButtons move around a UIView of their own accord, bouncing off the edges, and off of each other, at a randomized speed, etc.
As a relatively new coder, I am having a very hard time doing this. I have pulled apart example code from the chipmunk website (even some specifically using UIKit elements) but I am afraid I just don't know enough to establish what forces need to act, how I set them up, etc. I realise that this is a wide question, but all of the tutorial content I've found regarding Chipmunk seems to assume that one's already a proficient programmer, or a proficient physicist and mathematician. I'm a hobby coder and can't spring to pay for any of the professional Chipmunk packages, and since the free version is in C, not Objective-C, even getting it integrated seems like days of work for me.
Chipmunk doesn't seem to be well-documented. For instance, searching for "friction" in the documentation finds a single (unhelpful) instance of the word. If there's no scale, how am I to know what value to enter? I realise I am frustrated and it is easier than I am making it, but it seems like doors are being slammed in my face every way I try to pick this stuff up.
Lots of the tutorials I have found use older versions of Chipmunk too, which huge amounts of stuff have changed from, making them really, really tough to follow along with.
I could really use a bare bones introduction that doesn't automatically assume I can already do it. Is one likely to exist anywhere? Any other tips for how to handle this?
Not sure if you are the same guy I just answered on the Chipmunk forums but there is this new example here which contains a (regular, non-pro) Chipmunk/UIKit example. It's pretty thoroughly commented.
https://github.com/slembcke/ChipmunkColorMatch
To be fair about the documentation, you do have to realize that there are entire textbooks on the sort of physics that Chipmunk covers. While I do feel that the docs sufficiently cover the API, you are right that it assumes that you know the terms and theory. I can't fit all of that into the documentation, and I don't have the time to write that level of a physics primer. There are some things you just have to know like what mass is, what friction coefficients are (and why they have no units or scale), and how forces work. The Chipmunk documentation should not be a go to place to learn that sort of thing.
If you have specific questions, you can always ask on the Chipmunk forums.
In times past, most people coded on a terminal that was 80 characters wide. In many languages this has become, if not holy then close to it.
But now many people have 20"+ monitors (or dual monitors), so screen real estate isn't as prime as it once was.
So my question is this: in Visual Basic code, should code be limited to 80 characters, should there be no limit, or is it really a subjective thing, dependent on where you work and your own preferences?
I think it is subjective, but not completely. Limiting code to 80 characters will make it more readable. This is the reason that newspapers have their articles in columns. It is easier to read text if it doesn't get much longer than 70 characters or so. I believe that people have done usability studies on this, but I don't have the references to back that up.
So, again, it is subjective, and situation-dependent, but longer lines are harder to read. So I try to stay within 80 characters even though I don't have to do so.
Humans read and comprehend fastest, when there are 40-70 characters per line of prose (approx. 10 words per line). I think something similar will apply to code.
Do what is most comfortable and works best for you. This is pretty much a universal truth for everything.
Subjective, but within some constraints (for example, if everyone is issued a monitor with size X). We use 110 characters, and it works for us even though some of us use widescreen monitors rotated to portrait.
I know a number of people who are remarkably fastidious about 80 character lines. As an arbitrary standard it's not bad, but if nobody is nagging you make it whatever length you feel comfortable with.
Approximate 80 characters is what I'd recommend. What I do with the extra monitor realistate is have 2 code files side by side. And the 2nd screen gets all the toolbars, property windows, and a 3rd code or interface layout window.
I'm going to go against the grain here, but I say don't limit yourself. If you are abbreviating class/function/variable names for the sake of saving space, you are just taking your code one more step away from being quickly grok'd. I think everyone should hop on the widescreen bandwagon anyway.
A problem is sometimes people may code in a window that isn't full screen, and then have to scroll, or the code wraps automatically.
Having to scroll left and right to read code is horrible.
I've had the issue with comments in code.. either limiting them in number of char wide.. or putting them in a different file!
In may Daily Job i come across this Dilemma :
"Stable System Vs Better Design"
In routine job when i am fixing some module, When i see bad design
-> Badly written code
-> Badly Written Algorithm
-> Optimization possible
I would prefer to fix these also along with issue i am fixing
But many people opposes my changes a few supports, People who opposes will say
"You should be business oriented if system is stable, If you change some thing may cause regression, Hence do not favor business"
some time :
you will see your own written code after 6 months, Always you will see some improvment opportunity in this
While who support will say:
This is continual improvement and system will be more stable
So i would like to know what you people think
If applicable, write a unit test (or several, to cover edge cases). This gives you the confidence to refactor and know that you haven't broken anything.
Of course, if the code is tightly coupled (or spaghetti!), that's going to be a problem.
If it ain't broken don't fix it - wrap it. Isolate the modules as much as you can without changing its implementation; they should be touched (fixed, improved) when / if a real need arises.
My opinion would be not to fix the old code if it looks not perfect unless the way it is written is interfering with your current task at hand.
Most of the code is written badly. It is a matter of fact. If you're not in a perfect team with the perfect understanding of quality value and the agreement on the approach to achieve and keep this quality level, your optimizations will not change the big picture. You may fix something now but the next guy will make the mess of the things again.
I have came to the conclusion that in this industry if its not broken, don't fix it unless there is a damn good reason to.
If you know the application inside out, or have comprehensive unit tests and time to test the application in a non-productive environment, go for it. Otherwise, do it just when it's necessary.
Both are correct and there is no easy way out.
If you don't fix problems as you encounter them, not all problems will be fixed.
If you break something with a fix that is not 100% related to the issue you're currently working on, then people will hate you.
On the other hand, if you fix some innocent code (or rather code that looks innocent) and it breaks in unexpected ways, you've found something valuable: Brittle code. Brittle code is usually something that no one dares to touch. But to make your product more stable, you must get rid of such code. The first step on this road is to find it.
I have to admit that such fixes cause a lot of "unnecessary" friction in the team. People will yell at you when you touch brittle code because they are afraid. Often, this code will blow into the face of your customers, so you will get heat from all kinds of directions.
So it really depends on how much pain you want to cause and what you're willing to endure. If you fix everything as you encounter it, the code will be better by the end of the year. But it often is worse by the end of the day.
I want to second all the "if it ain't broke, don't fix it" answers, but with a relevant link...
Things You Should Never Do, Part 1 - Joel Spolsky
In essence - sometimes that incomprehensible code is actually a necessary bugfix that you have no chance to understand.
On the one hand, changing code that's already more-or-less working can run the risk of breaking things, and it can easily become an all-consuming task.
On the other hand, leaving bad code alone for fear of breaking things can stifle new development, due to the burden of maintaining bad code.
Sometimes code looks bad because it has to deal with complicated corner cases, as Joel Spolsky points out, and rewriting it will create bugs by failing to cover those corner cases. Sometimes code looks bad because it really is bad, and rewriting it can fix bugs that you didn't even know were there. Experience with your code base should help you determine which code is which.
In Boy Scout Check-Ins, Jeff Moser discusses the idea of "always leaving the campground cleaner than you found it." Always leave the codebase cleaner than you found it, even if you can't fix everything; those little improvements add up over time.
As was said in this answer, unit tests are a good thing. Working Effectively with Legacy Code, by Michael Feathers, is a great resource on this topic.
I personally have a tendency to spend time fixing stuff rather than getting on with the required task. Unfortunately it is all too easy to start fixing what looks like an easy problem and unravelling a huge mess that you then wish you hadn't.
I have also worked with people who are the other way round, and can live with the bad bits as long as it gets the job done.
More often than not, you can spend ages 'getting something right' to make it easier to work with in the future and you'll find that code is never reused in the future.
I think the main thing is to have a balance of views on your team, discuss things regularly with others and ultimately, meet the requirements for your project, since it's the customer paying the bills.
Be constructive about any problems you find - don't just pick holes for the sake of it! Team code reviews help improve bad code over time as poor coders will start to understand how to make good code.
I would advise marking bad code with 'TODO' comments and then coming back to fix it later time/budget allows. At least you've got a flag for potential problem areas then, without having to (possibly) waste time on a fix that's not required there and then.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
Improve this question
We've all been there. You have written some code and unit tests, the tests all pass, and the code is decent (nothing's perfect, right?). Then, someone who is sure that they know better than you comes along and decides to change your code or the interfaces to your code just because he/she does not like the variable/class names that you used. No "real" refactorings, no real optimizations, no real improvement -- just different words -- not necessarily better words, just different.
My real problem with this is that (a) its a waste of time and (b) it shows a blatant disrespect for the fellow developer that wrote the code in the first place.
My visceral response is to lash out, but that's counter productive. Instead, I though that I might wright a paragraph or two as sort of a "Charter" or "Philosophy" that is adopted for the project. I'm wondering if anyone else has tried this, and if so, was it successful?
After looking at the initial comments below (which are appreciated), I think that my problem is primarily that this change broke the build for code that was already working. So time needed to be spent to fix the code for what was (in my opinion) a non value-added change.
-- Thanks
...decides to change your code or the
interfaces to your code just because
he/she does not like the
variable/class names that you used.
My real problem with this is that (a)
its a waste of time and (b) it shows a
blatant disrespect for the fellow
developer that wrote the code in the
first place.
My visceral response is to lash out...
I see some VERY CONCERNING things in those statements.
naming is REALLY, REALLY important. It is worth rewriting code to get it correct.
It is not YOUR code
How is it disrespectful?
You are taking it too personally.
I once worked with someone who freaked out when I made changes to "his" code. His code as horrible; it was buggy and unmaintainable. He was always staying late, fighting fires and breaking things - basically a negative contributor. I rewrote all his bad code for a big piece of functionality for a project one weekend and when he came back in on monday had a hissy fit. I am not saying your stuff is horrible, but maybe you need to calm down and be more objective about it.
Don't take it so personally. Step back and think about it - maybe "your" code needed fixing
We might be able to give better answers if you posted the code and changes, or at least some better idea of the situation with an example or two.
EDIT:
After seeing the code change and finding out that the build was broken, I am going to have to change the tone of this answer. I understand Steve's frustration - and i agree - that is not a good change. It makes a specific typedef more general and not very descriptive any more.
While I think some of my points are valid, in this case it looks like the changes were not appropriate.
The issue of code "ownership" is irrelevant. If the code changes are useless then everyone on the team should not be happy. If they are good changes then everyone should be happy about it. If there is a difference of opinion then you all need to find a common ground.
Breaking the build is not a good thing.
Steve, sorry if I came down harsh - it looks like in this instance you are justified in your frustration, but not because it is "your" code.
One thing that might help in this sort of situation is to require code reviews for all changes. People are less likely to make pointless changes if someone else has to review it first. If they can actually convince another developer that their change should go in then maybe it isn't so pointless after all.
Heey,
Guys! WE all need TO TALK!
Just sit together and TALK! There are always reasons to change and there are always reasons NOT to.
Decide together!
Don't just go to StackOverflow or a forum and say ask this kind of questions.
The new dev does it - he gets responses from community probably positive (yeahh, bad code should be refactored).
The current dev does it - he gets responses from the community too: "What an idiot could do such kind of changes!"
And the result is: Counterproductive, destructive, offensive environment for a long time.
Who wants it?
Just put your arguments on the table and that's it.
New dev needs some introduction too.
Old dev needs to listed TOO.
This should be collaborative work AND not pissing each other off.
Decide together, talk, as THE TEAM.
And... better ask questions like "How is it better to refactor this?"
Cheers.
In any software development team with a size > 1, standardization is key. Not only for each developer to understand the other's code, but so that the people that come along in 2 years, 5 years and 10 years can look at any part of the code and see a clear and consistent pattern. Will you... and the rest of the team... seriously still be there, working on this project, years down the line?
If you both "just have your way of doing things" and there is no formal standard for the project/company, I suggest you work with the team and/or your boss to suggest a formal standard be adopted. There are many standards already published for the various environments that you can use either as the standard, or as a starting point.
If there is a formal standard, everyone on the team is obligated to follow it... no matter how much "better" they think their way is.
So much for the hard skills.
Now on the soft skills side...
You and your colleague need to develop a healthy relationship, or decide to work in different places. Tit-for-tats that result in people feeling that they want to lash out will make everyone unhappy, not to mention gravely jeopardize the project everyone is being paid to complete. Look for a person you both respect (maybe your boss, maybe a respected and level-headed senior member of the team, maybe HR if you have a good HR department). Explain to that person what the problem is and that it makes you feel unvalued and disrespected. Ask for help talking through the situation with your colleague and agreeing to a better way of working together.
Finally, you need to be open to the possibility that your colleague may be making subjectively correct changes, even if the manner he's doing it in offends you. Separate the correct coding from the correct interpersonal interactions. Do the right thing for the project.
Well if that guy is going to maintain your code, let him do whatever he wants to.
Just remember that it is not "your" code. The code belongs to the company for which you work for. You wrote the code and you got paid for it. Let the Management do whatever they want to do with it.
Don't take things personally, move on.
Sometimes, changing names might be justified. It can be confusing if half the project refers to a person's sex, and then you check in some new code that refers to gender or something. Okay, this might be a bad example as technically they are two different things and their meaning is most likely still obvious. But if a project's code uses two different terms to refer to the same concept, it can be confusing.
Usually I try to leave people's code alone, unless I have some justification for refactoring. Luckily the same seems to go for my colleagues, so no, I have not had the need for writing such a charter yet.
How about using an automated build system, so when this person changes the code and breaks something the team will get an alert about it. This solves your problem with having to waste your time fixing something broken by someone elses change to your code. This way everyone will know that so and so made a change and broke the build, and can see for themself. The rule is "dont break the build".
You should be discussing this with the person who did it, in a non-threatening manner.
I believe every developer should take responsibility and hence own some of the code, but not all of the code. I understand the code that I've written better (irrespective of how good/bad it is) than any other guy that has ever seen it. Therefore the changes I make will be faster and less prone to error.
I don't mind anybody changing the code I've written later on, but I have a couple of conditions:
If you change the code and that causes something else to break, you are responsible for fixing it, not me.
If I don't agree with the changes you made I will change it back to the way I want it since I have to take responsibility for this piece of code in future.
Not all developers should be making changes to all the code, all the time. Only some of the time, for the purpose of getting to know the code (sharing knowledge).
I've never worked for an employer that endorses a "everyone can change anything any time" policy. Developers own certain parts of the code and they are asked specifically to make changes/refactor based on a development democracy.
You touch my code and break something, (1) you better have a good reason for the change that all developers agree with and (2) you better not leave broken things broken or ask me to go do the clean-up for you UNLESS you're my superior. I will humbly submit if that's the case.
I agree with Laurence that code reviews might help. This is an issue of how your team should work together. What might help is the notion of Egoless Programming - in a nutshell, considering the code as a joint product of the team, and trying to make decisions for the sake of the code rather than because of the programmer's ego. Your teammate violated the fourth commandment of egoless programming - "Don't rewrite code without consultation."
Maybe if your team is made aware of these principles, things will improve. I would try this.
Perhaps not completely on topic, but .... If you have developers who have the time to make changes to code just because they don't like the variable names used, then maybe the conversation should be about whether you have too many developers and which ones should be shown the door ... or how you're going to justify to management the bloated staff you have, especially in the current economic circumstances!