答:
How do I objectively determine what areas of study, general knowledge,
  and other skills I would have gained through a CS degree that I may or
  may not be lacking in now?

Just look at the degree requirements, then look up the syllabus for each class.

How do I sort these skills in order of most importance?

You can't really do this yourself without the benefit of hindsight.  I would say the most important thing most self taught programmers lack is algorithm analysis and design.  The rest can be picked up piece meal.

What is the best way (over the next two years) to supplement my education to attain those attributes in such a way to match or even surpass the level of a CS undergrad from a top university?

Even if you aren't admitted to the program, you can often take classes from other departments as electives.  One of my favorite classes was a project class from aerospace engineering where I worked on electronics and firmware for a small satellite.

You can also purchase the text book your desired class is using.  I did that for a couple classes I couldn't fit into my schedule.  Another option is MIT open courseware.


问:
A software design pattern to model runtime-dependent behavior
In a interview I was asked,

Suppose we are going to create a software that runs on both desktop machines and smartphones. Name a software design pattern that could be used to enable the application to create different classes for display at runtime depending on the platform.

I know there are simple solutions to implement this feature in the actual code. For example, in Java I can check the display size and create the suitable class (MobileDisplay or DesktopDisplay class) for that display.

But I don't how this is related to the software design; in my opinion, creating suitable class based on runtime platform is an implementation concern rather than a software design issue.

答:
I can just take a guess on what your interviewer meant, but the "Bridge pattern" enables you to choose between different (maybe platform specific) implementations for an abstraction at run time. The abstraction in your case could be the display.

The original example in the GOF book for the bridge pattern demonstrates this by using different Window implementations, an XWindowImp (for the X-windows windowing system) and a PMWindowImp (for IBM presentation manager windowing system), which seems to me very similar to your question.

And of course, this is a design issue. Not using the bridge pattern can also lead to a working solution, but with more code duplication and more platform dependent code - and that's what design is about - choosing the right concept which leads to better evolvable or maintainable code.

EDIT: an abstract factory can be used to instantiate and configure your bridge classes at run time, so the AF pattern may be of use here, too.

ContentLicense: CC BY-SA 3.0


问:
Has whitespace in identifiers ever been idiomatic?
C# style suggests using CamelCase in identifiers to delimit words. Lisp tradition suggests using-dashes-instead.

Has there ever existed a programming language where using spaces in identifiers was not only allowed, but a commonly used idiom when employing multi-word identifiers?

It's possible to have identifiers with spaces in some Scheme implementations, but it's not a widely seen practice. Here's an example:

```<code>Petite Chez Scheme Version 8.4
Copyright (c) 1985-2011 Cadence Research Systems

> (define |hey there| 100)
> (define |x y z| 200)
> (list |hey there| |x y z|)
(100 200)
</code>```

答:
If you consider an automated testing DSL a language, the robot framework allows spaces in keyword names, and it's very idiomatic. In the following example "Say hello" is a keyword name, "Example test case" is a test case name, and "${first name}" is a variable:</p>

```<code>*** Keywords ***
| Say hello | [Arguments] | ${first name}
| | log | Hello, ${first name}

*** Test Cases ***
| Example test case
| | Say hello | world
</code>```

Body:
If you consider an automated testing DSL a language, the robot framework allows spaces in keyword names, and it's very idiomatic. In the following example "Say hello" is a keyword name, "Example test case" is a test case name, and "${first name}" is a variable:

*** Keywords ***
| Say hello | [Arguments] | ${first name}
| | log | Hello, ${first name}

*** Test Cases ***
| Example test case
| | Say hello | world


答:
Inform 7 is a system for developing interactive fiction using natural language–like syntax, in which multi-word identifiers are commonplace:

```<code>Mr Jones wears a top hat. The crate contains a croquet mallet.
</code>```

The restriction, of course, is that an identifier can’t contain a keyword when this would be ambiguous.

In a similar vein, identifiers with underscores in Agda can be used mixfix, the simplest example of which is probably the if_then_else_ operator:

```<code>if_then_else_ : {A : Set} -> Bool -> A -> A -> A
if true  then x else y = x
if false then x else y = y
</code>```

Title: Has whitespace in identifiers ever been idiomatic?

Body:
C# style suggests using CamelCase in identifiers to delimit words. Lisp tradition suggests using-dashes-instead.

Has there ever existed a programming language where using spaces in identifiers was not only allowed, but a commonly used idiom when employing multi-word identifiers?

It's possible to have identifiers with spaces in some Scheme implementations, but it's not a widely seen practice. Here's an example:

```<code>Petite Chez Scheme Version 8.4
Copyright (c) 1985-2011 Cadence Research Systems

> (define |hey there| 100)
> (define |x y z| 200)
> (list |hey there| |x y z|)
(100 200)
</code>```

Body:
Inform 7 is a system for developing interactive fiction using natural language–like syntax, in which multi-word identifiers are commonplace:

Mr Jones wears a top hat. The crate contains a croquet mallet.

The restriction, of course, is that an identifier can’t contain a keyword when this would be ambiguous.

In a similar vein, identifiers with underscores in Agda can be used mixfix, the simplest example of which is probably the if_then_else_ operator:

if_then_else_ : {A : Set} -> Bool -> A -> A -> A
if true  then x else y = x
if false then x else y = y


问:
How to log configuration or code behaviour changes in non-disruptive way
We've probably all been in the situation where you'd like to alert your team members to some change ("I changed X, so now it's running every hour instead of every day"). But the change is non-urgent, and email can be disruptive - or get tuned out.

Anyone have any techniques where the team can have a running log of changes that everyone should be aware of, that they can peruse at their leisure - or at least, when they suspect something is up?

答: We do this 2 ways. First, for most apps, configuration files are versioned using SVN. So you can always go svn log and perhaps get some context. Second, we use an issue tracker as the official record of requests and changes. People can manage their settings themselves in that system to manage their own spam. Either way you are covered -- you've got local technical info and perhaps context in the issue tracker and nothing is in your face unless you want it that way.


问:
How do I communicate concepts and design for a web application?
Iam not sure if this topic is ok to ask, but we are talking about this since years in our Developer-"Shop". How to write concepts for Web- Applications?

We are using Zend Framework (MVC), OOP Based, Databases, LDAP and such stuff. But no one ive ever meet can show me an good example for some kind of "technical conception".

Goal: Write an document, hand it our to an 2nd person with "some" knowledge about our systems and good PHP 5/Zend Framework skills. Now he must be able to code without many questions to the architect.

Is it possible that this is not common in the "web scene"? Does everyone is just hacking code till the application works?

If someone knows some good papers, examples .. Some keywords to think about:

ERM

UML

答:
You have a very flawed view of software development. Success has been shown to be nearly impossible if you expect to create some specifications and toss them to developers and have them make it no questions asked. The reason Agile development has become so popular is that it forces the client to work with the developer and collaborate. People that are going to be responsible for using, creating, designing and maintaining should all be involved at every step of development.

Your goal is not consistently possible in any scene, not just the web.


问:
How the Erlang get soft-realtime with GC?
Generally GC is not a good choice to get a soft real-time attribute. But Erlang is GC based language can be soft real-time.

Does it mean Erlang have almost no GC latency? How does it work?

答:
Erlang processes don't share memory, each one has its own heap and they can be garbage-collected independently.

Many small heaps result in many small GC-pauses, rather than few big ones.


问:
How to import an image using openGL
I am new to openGL C++ and what I wanted to know is if there was a pre-existing function in the OpenGL library that would allow me to import a 3d or 2d model?

For example, if I make a 3d image using photoshop, or a 3d model using 3ds max could I use a library in openGL example  (not real function):  glUse3dimage(3dmodel); ?

Or would importing images be more difficult and I would have to make my own function? I am not really a good programmer so I wanted to see how difficult this would be.

Another question I had was if this was difficult would this be easier using openGL with another language?  For example openTK with C#?

答:
OpenGL does not specify a standard for model or image data. Which means you can import data in whatever format you want. Which also means you have to write/obtain code to load the data in whatever format you want. I once implemented a parser for the 3D Object format. It was pretty straightforward, and many modelling applications at the time could export basic geometry into this format. If you want to load more sophisticated models (maybe with procedural textures specified, or animation data) you might want to look for an existing library that can do that, though it would also be a good learning experience. ;) There are many libraries for loading image data, I think I just found some from BMP loader code and used that.

I can't speak to using OpenGL with other languages, as I ever only wrote C and C++ and a tiny bit of Objective-C code for OpenGL. I know of JOGL which would let you use Java to write OpenGL applications, but I have never used it myself.

Title: How to import an image using openGL

ContentLicense: CC BY-SA 4.0


答:
There are no specific file handling or file format APIs in openGL  http://www.opengl.org/archives/resources/faq/technical/miscellaneous.htm

You could dump textures of vertex buffers direct to disc and reload them, but it's much better to use some common 3D model format, like .obj

I would also recommend you get MeshLab to allow you to view and test your models independantly

Title: How to import an image using openGL

Body:
I am new to openGL C++ and what I wanted to know is if there was a pre-existing function in the OpenGL library that would allow me to import a 3d or 2d model?

For example, if I make a 3d image using photoshop, or a 3d model using 3ds max could I use a library in openGL example  (not real function):  glUse3dimage(3dmodel); ?

Or would importing images be more difficult and I would have to make my own function? I am not really a good programmer so I wanted to see how difficult this would be.

Another question I had was if this was difficult would this be easier using openGL with another language?  For example openTK with C#?


答:
No, thats not within the scope of OpenGL itself.

To load 3d models, one good tool is the Open Asset Import library:

http://assimp.sourceforge.net/

For 2d models (assuming you mean images here), use whatever library available in your language/framwork for loading images, and then draw the pixels using opengl's functions.

Title: How to import an image using openGL


问:
Find a "hole" in a list of numbers
What is the fastest way to find the first (smallest) integer that doesn't exist in a given list of unsorted integers (and that is greater than the list's smallest value)?

My primitive approach is sorting them and stepping through the list, is there a better way?

答:
What is the range of numbers you will encounter?  If that range is not very large, you could solve this with two scans (linear time O(n)) using an array with as many elements as you have numbers, trading space for time.  You could find the range dynamically with one more scan.  To reduce space, you could assign 1 bit to each number, giving you 8 numbers worth of storage per byte.

Your other option which may be better for early scenarios and would be insitu instead of copying memory is to modify selection sort to quit early if the min found in a scanning pass is not 1 more than the last min found.

Title: Find a "hole" in a list of numbers


答:
Assuming that you mean "integer" when you say "number", you can use a bitvector of size 2^n, where n is the number of elements (say your range includes integers between 1 and 256, then you can use an 256-bit, or 32 byte, bitvector). When you come across an integer in position n of your range, set the nth bit.

When you're done enumerating the collection of integers, you iterate over the bits in your bitvector, looking for the position of any bits set 0. They now match the position n of your missing integer(s).

This is O(2*N), therefore O(N) and probably more memory efficient than sorting the entire list.

Title: Find a "hole" in a list of numbers

Body:
What is the fastest way to find the first (smallest) integer that doesn't exist in a given list of unsorted integers (and that is greater than the list's smallest value)?

My primitive approach is sorting them and stepping through the list, is there a better way?


答: No, not really. Since any not-yet-scanned number could always be one that fills a given "hole", you cannot avoid scanning each number at least once and then comparing it to it's possible neighbours. You probably could speed things up by building up a binary tree or so and then traversing it from left to right until a hole is found, but that is essentially of the same time complexity as sorting, since it is sorting. And you probably won't to come up with anything faster than Timsort.</p>

Title: Find a "hole" in a list of numbers


答:
If you sort the entire list first, then you guarantee worst-case run-time.
Also, your choice of sort algorithm is critical.

Here's how I'd approach this problem:

Use a heap sort, focusing on the smallest elements in the list.

After each swap, see if you have a gap.

If you find a gap, then return: You have found your answer.

If you don't find a gap, continue swapping.

Here's a visualization of a heap sort.

Title: Find a "hole" in a list of numbers


答: The 4D language allows white space in method names and variables. It is generally frowned upon within the community, but all built-in methods and variables use them when applicable (SET MENU ITEM PARAMETER, for example)


问:
Safe iPhone app ↔ server communication
What would be the best approach to achieving private communication between my iOS app and its server component? Is having a single unchanging “secret key” baked into the app source enough, or do I need to set up generations of such “handshake” keys dynamically somehow?

The server by itself doesn’t have access to any sensitive data, so even if the user hits some private endpoints, it won’t get them anywhere, but I just want those to be hidden from the public. Basically, I want to ignore all requests hitting particular routes, unless they are coming from my iOS app.

The server component runs on RoR, if that’s important.

答:
You've got a classic problem that really can't be solved.

To ensure simple privacy (i.e. making sure your data can't be snooped or altered in transit) you can do everything over SSL and give your server a properly-issued certificate by a CA that iPhone recognises.

For authorisation, however, there's no good solution that will 100% guarantee that nobody other than your app can access the API. Your proposed solution would work, except:

anyone who's downloaded your app necessarily has in his possession the private key

if they somehow manage to un-package your app, and de-compile it, they will have the private key in plain-text

once they have the private key in plain-text, they can use it to sign their own malicious requests.

There's no way around this. It's not to say you couldn't adopt that approach, but understand that it's not foolproof. It's this very issue that makes DRM completely ineffective.

Title: Safe iPhone app ↔ server communication


答:
Just to be esoteric and "clever", in the special case of the array having only one "hole", you can try an XOR-based solution:

Determine the range of your array; this is done by setting a "max" and "min" variable to the first element of the array, and for each element after that, if that element is less than the min or greater than the max, set the min  or max to the new value.

If the range is one less than the cardinality of the set, there is only one "hole" so you can use XOR.

Initialize an integer variable X to zero.

For each integer from min to max inclusively, XOR that value with X and store the result in X.

Now XOR each integer in the array with X, storing each successive result to X as before.

When you're done, X will be the value of your "hole".

This will run in roughly 2N time similar to the bitvector solution, but requires less memory space for any N > sizeof(int). However, if the array has multiple "holes", X will be the XOR "sum" of all the holes, which will be difficult or impossible to separate into the actual hole values. In that case you fall back to some other method such as the "pivot" or "bitvector" approaches from other answers.

You could recurse this as well using something similar to the pivot method to further reduce complexity. Rearrange the array based on a pivot point (which will be the max of the left side and the min of the right; it'll be trivial to find the max and min of the full array while pivoting). If the left side of the pivot has one or more holes, recurse into that side only; otherwise recurse into the other side. At any point where you can determine there's only one hole, use the XOR method to find it (which should be cheaper overall than continuing to pivot all the way down to a collection of two elements with a known hole, which is the base case for the pure pivot algorithm).

Title: Find a "hole" in a list of numbers


问:
How to be a successful programmer without a CS degree

Disclaimers (Please read before jumping to answer):

I've seen a number of questions similar to the one I would like to ask, so here are some similar questions.

IMHO They are neither completely what I'm asking, nor are they as thorough as I hope to be (I don't mean to brush off the answers to the below questions, nor am I discrediting the askers, I just want to be a little more thorough):

Can a CS degree benefit an older programmer?

https://softwareengineering.stackexchange.com/questions/80024/importance-of-certifications-for-java-programmer-without-bs-degree

https://softwareengineering.stackexchange.com/questions/81591/in-the-absense-of-a-cs-degree-how-can-i-fill-in-the-gaps-so-to-speak

Importance of CS degree when applying for development jobs?

Let me be clear, I'm not asking the following:

How to teach myself programming from scratch (without a degree in CS)

How to market myself as a good software developer (without a degree in CS)

How to get a great high paying job as a software developer (without a degree in CS)

A little context:

Now that I have disclaimers out of the way, let me flesh out my question, starting with a brief history of my experience as a software developer.

First off, I have been incredibly lucky. I've been given several job opportunities (a couple heavy backend PHP/MySQL projects, and several WP7 apps in XAML/C#) through which I really learned everything I know about software development. Nearly all of the software development jobs I've had were ones that I was not rightfully qualified to have (and I made that clear to my employers before they hired me). I don't want to give myself credit where it's not due, but I would say that perfect humility dispenses with modesty.

In nearly every single development job I've had, I have exceeded the expectations of my employer, and proved to be a valuable asset. There are of course exceptions1. But my point is I'm fairly intelligent and was able to teach myself what I needed to know in order to be successful at my job. With each job I had, I was stretched more and more.

I attend the University of Washington's Seattle campus, and am currently in my fourth year with two years left, working on a Math degree. During the various jobs I've had (see my résumé if you want that list) I've also been attending school as a full time student.

As I think most developers would agree, studying the typical general ed undergraduate courses, including introductory programming courses ABSOLUTELY PALES in comparison with writing real code, building real2 products, working with awesome people, and positively affecting the lives of users3.

So... as things go... I spent far more of my time and energy working instead of focusing on my studies. At times I performed very horribly, but for the most part I was able to stay afloat with my grades.

However the computer science program at UW is very, very, very, very competitive.

So, it was no surprise to me when I got rejected by the program. Twice. Ironically enough, the same half-hour window in which I received the always polite, albeit disheartening rejection notice via email, I got a phone call from Amazon offering me a summer internship4 as an SDE.

As I look around at other 'gents my age (21), who share the same goals as myself in software development, I find myself feeling pretty good about where I'm at, what I'm learning, who I am, and what I can do. There are of course much, much, much more brilliant 21 year olds out there than myself, I don't mean to say I stand out in a crowd, merely that I feel like I'm not abysmally behind the progress of my average peer.

I feel confident about my ability to be successful in the world of software. More importantly I feel confident in my ability and desire to continue to grow, learn, and be embarrassingly humbled when I really need it.

Math Degree

I find myself pursuing a Math degree with the sole purpose of having a degree. There are those that say I should drop out and start working now (as I've had opportunity to do), and there are those that say I should really finish my degree. I've made up my mind to go ahead with my degree for entirely different reasons than either camp tends to bring up, so please don't encourage me one way or another on that matter. Consider the issue "closed" :)

*DEEP BREATH* ...sorry this is longer than I anticipated.

This in essence, is my question:

How do I objectively determine what areas of study, general knowledge, and other skills I would have gained through a CS degree that I may or may not be lacking in now?

How do I sort these skills in order of most importance?

What is the best way (over the next two years) to supplement my education to attain those attributes in such a way to match or even surpass the level of a CS undergrad from a top university?

Here are the steps that I am taking already:

Ask the development community (this post)

Pursue mentorships with seasoned developers who share a similar career path with me

Define short and long term "learning" goals and subsequent syllabi outlining topics of study

Continue to write code and work on projects that I'm passionate about

If you've gotten this far, you deserve a cookie :) I appreciate you bearing with me.

So... development community, seasoned developers, fellow students who are in the same boat as me, what advice would you have?

Also... please do keep in mind my disclaimers at the top of this post about what I'm NOT asking for.

Update:

I realize that I did not provide very concrete parameters for what I deem a successful "answer" to my question(s). I think the question is very vague, and could warrant a number of "correct" answers.

After a reasonable amount of time I will select the answer that fits the following attributes:

Explains the why behind their answer

Can speak from some level of experience (be it hiring/interacting with or being someone who has/is in my shoes)

Is concise but thorough, gives broad principles preferably coupled with specific examples

Lastly, considering the length that matching the above would seem to require, please make it a good well communicated answer that's pleasant to read. Others who may be interested in this in the future I would hope would be entertained as well as educated by the response.

So there are some parameters for "correct". They're very high I think, but I've designed them as kind of an outline for what I envision the "best" answer would be. Obviously given enough time I'll select the closest matching response as the "answer".

```
(1) - I worked on a prior version of this website, and while we did not have an explicit
      conversation about it, I felt that I was not able to do very well at all (this can be
      evidenced by the fact that they have since changed their website entirely)
(2) - Firstly, yes, it's a real product (even though I'm writing this post in Chrome...), and
      it kicks ass. Secondly, I was a high school intern developer in test, wrote proof of
      concept code for some of the new features for IE8... so it was a while ago.
(3) - At the time of this posting I am the developer who wrote this app, I am no longer
      responsible for it's code base
(4) - My internship will start in June of 2012, and I'll be working in the Web Store
      team.
```

答:
IMHO there are no programming jobs (or sales jobs or sysadmin jobs etc), there are only problem-solving jobs. We hire and pay people to solve problems, writing code is only part of solving the problem. Yes, even sales is a form of problem solving. So a Math degree proves you can problem solve as well as a CS degree.

From your posting it is clear you are getting a lot of experience/internships. Great! don't worry about getting a job after graduation.

To attempt to answer your questions:

classes? pick some theoretical CS classes rather than code writing classes. Find some non CS/math classes eg. philosophy it will help you stand out from the crowd

priorities? learn new things (not just easy classes you half know already)

next two years? talk to people, learn, build relationships, look for outside activities. (Hobbies/sports/pastimes away from work/study is one clue to see how motivated an applicant is.)

Final tips: Graduate as soon as you can. Build a network of contacts. And the only secure job is creating your own job. Look for ideas/opportunities where you can start your own business. Good luck.


问:
What is the alternative to frequent manual verification?
I was thinking, is there a particular time in your coding where you verify that it works? Say, after coding a function, or an entire class, or an entire section of an app, or after every 'significant' block of code?

I ask this, because I tend to verify my app too often, sometimes after every 3rd or 4th change. This is a habit which has proven very hard to shake. It appears to be counter productive to do this repeatedly and manually.

Is there another solution? It seems to be either be a more competent programmer and essentially 'know' the return of the majority of your code, or have your IDE check the return periodically, or only test the return via TDD.

答:
Sounds like you're spending too much time manually testing your application and should try automating this process with tests.

or have your IDE check the return periodically

There isn't a real way to do this other than to write your own tests with self-written assertions.

If shipping broken code is killer to your business and your application has complexity (which it sounds like it does) you should be writing tests to verify behavior.

Tests aren't a silver bullet but will make maintaining existing work a lot easier.

or only test the return via TDD.

It should be noted that you don't have to be doing TDD to have automated tests.


答:
Create unit tests.  If you're into the test-first thing, you write the test first and check the return as soon as you write the method.  If you're not, you should write the unit test as soon as possible after you write the method.

Either way, you should test your code before you move on.

Title: What is the alternative to frequent manual verification?

Body:
I was thinking, is there a particular time in your coding where you verify that it works? Say, after coding a function, or an entire class, or an entire section of an app, or after every 'significant' block of code?

I ask this, because I tend to verify my app too often, sometimes after every 3rd or 4th change. This is a habit which has proven very hard to shake. It appears to be counter productive to do this repeatedly and manually.

Is there another solution? It seems to be either be a more competent programmer and essentially 'know' the return of the majority of your code, or have your IDE check the return periodically, or only test the return via TDD.


答: There are few I know of. I am working on one, and the lithe programming language. Inform does, but it's not exactly a general purpose programming language.</p>


答:
This is what TLS and SSL are for. Either one can create a secure connection without the need for a fixed secret key. Read the Description section on the linked page to learn how they do this.

An effective way to get the benefit of TLS/SSL without having to do a lot (any) work is to have your server implement a web service that the client accesses using the HTTPS protocol. HTTPS is just HTTP over a secure connection, and the URL loading system in iOS implements it for you.

Title: Safe iPhone app ↔ server communication

Body:
What would be the best approach to achieving private communication between my iOS app and its server component? Is having a single unchanging “secret key” baked into the app source enough, or do I need to set up generations of such “handshake” keys dynamically somehow?

The server by itself doesn’t have access to any sensitive data, so even if the user hits some private endpoints, it won’t get them anywhere, but I just want those to be hidden from the public. Basically, I want to ignore all requests hitting particular routes, unless they are coming from my iOS app.

The server component runs on RoR, if that’s important.


答:
Everything @Ryathal says is absolutely true.

But if you are constrained and HAVE TO do things in the way described, what you need is a reference implementation (RI) of the architecture you are trying to build.  This means building working code and documenting how exactly it works.  You can then hand the RI to your developers and tell them to build an application the same way the RI is build, but meeting your functional and system requirements (preferably with a comprehensive set of test cases).

This is still far from ideal--the developers may find parts of the RI not appropriate, or not adequate based on the requirements.  There WILL be some give and take, but it should give them a start.

Title: How do I communicate concepts and design for a web application?

Body:
Iam not sure if this topic is ok to ask, but we are talking about this since years in our Developer-"Shop". How to write concepts for Web- Applications?

We are using Zend Framework (MVC), OOP Based, Databases, LDAP and such stuff. But no one ive ever meet can show me an good example for some kind of "technical conception".

Goal: Write an document, hand it our to an 2nd person with "some" knowledge about our systems and good PHP 5/Zend Framework skills. Now he must be able to code without many questions to the architect.

Is it possible that this is not common in the "web scene"? Does everyone is just hacking code till the application works?

If someone knows some good papers, examples .. Some keywords to think about:

ERM

UML


答:
Software development literature and practice (in many projects) tend to propose certain activities to deliver reliable software. These activities are either learned from industry experience or advice and vision laid out by different methodology thinkers. It is a common practice to perform planning, analysis and design tasks (under any other name) at the beginning of major software tasks.

Software programming is an activity that could benefit from knowledge gained by performing those tasks.Programming is not usually the starting point (or the only task) in a serious projects. Development teams are usually composed of people playing different roles. Programming is only one of these roles.

The Business analyst's role is to aid in the process of discovering, documenting and validating the business requirements from the view point of the stake holders and customers, data modelers build the ERD to satisfy those requirements, Architects determine the optimal environment and integration methods to deliver the solution, DBAs tune the database design, Programmers work on delivering the code and may produce system prototypes to solicit early customer feedback etc.

Technical tools such as UML diagrams may be used by different roles at various stages of the system life cycle to document how the system is packaged, parts of the object model, process flow(s), etc.

As @Raythal indicated, the process of requirements determination is not performed in isolation of customers (unless you are creating a novel tool or product) and the analysis process has an iterative nature in non-trivial projects. The relationship between IT and the end-customer need not stop after system analysis has finished. In fact it is good to have controlled customer involvement during the entire project life cycle. The Project Management role should facilitate the interaction between the appropriate team members and the customer and should observe the interests of both parties in doing so.

The contents of the document you mentioned in your question is what matters. It should contain sufficient information for all involved parties to provide their corresponding deliverable. For example, a data modeler can't build a correct data model without business rules. A developer can't produce a prototype if the business process flow(s) is/are unknown and so on.

In practice it is not uncommon to see applications begin in unorganized manner, however, this is not the practice to follow if reliability counts.

You'll find much more about the answer to your question under the subject "software development life cycle" and in particular "Requirements Engineering/Management".


答:
Firstly, let me say that I am very happy that you have asked this question because it is one that I have asked myself over the years.

I guess I could consider myself a bit of a success in this area, so far.  I have some college experience and would like to eventually finish my college education in Computer Science, but I have not yet merited a degree at this point in my life.  I have, however, had quite a lot of success in software engineering despite this disadvantage (going on 10 years).  I have to be honest with you, though, it was not necessarily an easy thing to do (of course, I would wager that anything worth doing is most often NOT the easiest).  I'm also going to say that it's still not the easiest thing.  There are plenty of companies out there willing to give the right candidate a chance, but I have come into contact with others that will balk at the lack of that college education "seal of approval".  However, I wanted it (and still want it) so badly that I was willing to do whatever I could to get any and all experience in whatever language I wanted to pursue a job in at the time.

It started in .net at a very large company.  As a small time non-programmer (worked as a tech support rep, at the time), I learned everything I could about the languages and technologies used as it applied to the company I worked for.  Furthermore, and this is probably the most important thing, I networked.  I shot off an email to every single person that I could find in the directory that had Software Engineer in their title.  Was I annoying?  Probably.  I was always courteous and self-deferential with an eagerness to learn.  I would schedule lunches or just find them in the cafeteria and sit down to try to have a conversation.  Sometimes it was embarrassing or I would get snubbed, but in the end, it got the expected results.  I was able to get small-time credentials to some internal databases and after a while acquired the requisite credentials to develop software on their proprietary platform.  Soon thereafter, I found myself in a position within the company to lend some skills in internal tools development for the analysis team that I worked on at the time.  From there, I always just strived to be the smartest guy in the room in the most unpretentious way possible.  I was eager and I made sure that everyone knew it.  I always tried to provide a solution wherever possible and found that if you try hard enough there are very few problem domains that are impossible to solve (outside of quantum theory, perhaps).

To wrap up what could be a long story (and if you're in the Pacific Northwest I'd love to discuss over a beer), I got my "big break" at a tiny little startup that was willing to give me a shot.  They traded my lack of experience for a little smaller salary, and I hit the ground running.  I then bounced from one small dev shop to the next over the next few years, gaining friendships and skills along the way, to where I am finally as the lead developer and director of a small engineering company.

A key takeaway here, if I haven't communicated it effectively enough, is that you have to network.  Make friends, have some beers and laughs, and find people who are in the field you want to work in (preferably within your technology stack of choice).  Make sure people know your willingness to do whatever it takes and eagerness to get the job done no matter how monumental it may be.  You basically have to "overcome" your lack of formal education.  Jump in and have fun with it.  This industry is the best on earth, IMHO.  I have made lasting friendships and contacts that have helped me from one place to the next and I will continue to do the same for them whenever the opportunity presents itself.

Title: How to be a successful programmer without a CS degree

Body:
Disclaimers (Please read before jumping to answer):

I've seen a number of questions similar to the one I would like to ask, so here are some similar questions.

IMHO They are neither completely what I'm asking, nor are they as thorough as I hope to be (I don't mean to brush off the answers to the below questions, nor am I discrediting the askers, I just want to be a little more thorough):

Can a CS degree benefit an older programmer?

https://softwareengineering.stackexchange.com/questions/80024/importance-of-certifications-for-java-programmer-without-bs-degree

https://softwareengineering.stackexchange.com/questions/81591/in-the-absense-of-a-cs-degree-how-can-i-fill-in-the-gaps-so-to-speak

Importance of CS degree when applying for development jobs?

Let me be clear, I'm not asking the following:

How to teach myself programming from scratch (without a degree in CS)

How to market myself as a good software developer (without a degree in CS)

How to get a great high paying job as a software developer (without a degree in CS)

A little context:

Now that I have disclaimers out of the way, let me flesh out my question, starting with a brief history of my experience as a software developer.

First off, I have been incredibly lucky. I've been given several job opportunities (a couple heavy backend PHP/MySQL projects, and several WP7 apps in XAML/C#) through which I really learned everything I know about software development. Nearly all of the software development jobs I've had were ones that I was not rightfully qualified to have (and I made that clear to my employers before they hired me). I don't want to give myself credit where it's not due, but I would say that perfect humility dispenses with modesty.

In nearly every single development job I've had, I have exceeded the expectations of my employer, and proved to be a valuable asset. There are of course exceptions1. But my point is I'm fairly intelligent and was able to teach myself what I needed to know in order to be successful at my job. With each job I had, I was stretched more and more.

I attend the University of Washington's Seattle campus, and am currently in my fourth year with two years left, working on a Math degree. During the various jobs I've had (see my résumé if you want that list) I've also been attending school as a full time student.

As I think most developers would agree, studying the typical general ed undergraduate courses, including introductory programming courses ABSOLUTELY PALES in comparison with writing real code, building real2 products, working with awesome people, and positively affecting the lives of users3.

So... as things go... I spent far more of my time and energy working instead of focusing on my studies. At times I performed very horribly, but for the most part I was able to stay afloat with my grades.

However the computer science program at UW is very, very, very, very competitive.

So, it was no surprise to me when I got rejected by the program. Twice. Ironically enough, the same half-hour window in which I received the always polite, albeit disheartening rejection notice via email, I got a phone call from Amazon offering me a summer internship4 as an SDE.

As I look around at other 'gents my age (21), who share the same goals as myself in software development, I find myself feeling pretty good about where I'm at, what I'm learning, who I am, and what I can do. There are of course much, much, much more brilliant 21 year olds out there than myself, I don't mean to say I stand out in a crowd, merely that I feel like I'm not abysmally behind the progress of my average peer.

I feel confident about my ability to be successful in the world of software. More importantly I feel confident in my ability and desire to continue to grow, learn, and be embarrassingly humbled when I really need it.

Math Degree

I find myself pursuing a Math degree with the sole purpose of having a degree. There are those that say I should drop out and start working now (as I've had opportunity to do), and there are those that say I should really finish my degree. I've made up my mind to go ahead with my degree for entirely different reasons than either camp tends to bring up, so please don't encourage me one way or another on that matter. Consider the issue "closed" :)

*DEEP BREATH* ...sorry this is longer than I anticipated.

This in essence, is my question:

How do I objectively determine what areas of study, general knowledge, and other skills I would have gained through a CS degree that I may or may not be lacking in now?

How do I sort these skills in order of most importance?

What is the best way (over the next two years) to supplement my education to attain those attributes in such a way to match or even surpass the level of a CS undergrad from a top university?

Here are the steps that I am taking already:

Ask the development community (this post)

Pursue mentorships with seasoned developers who share a similar career path with me

Define short and long term "learning" goals and subsequent syllabi outlining topics of study

Continue to write code and work on projects that I'm passionate about

If you've gotten this far, you deserve a cookie :) I appreciate you bearing with me.

So... development community, seasoned developers, fellow students who are in the same boat as me, what advice would you have?

Also... please do keep in mind my disclaimers at the top of this post about what I'm NOT asking for.

Update:

I realize that I did not provide very concrete parameters for what I deem a successful "answer" to my question(s). I think the question is very vague, and could warrant a number of "correct" answers.

After a reasonable amount of time I will select the answer that fits the following attributes:

Explains the why behind their answer

Can speak from some level of experience (be it hiring/interacting with or being someone who has/is in my shoes)

Is concise but thorough, gives broad principles preferably coupled with specific examples

Lastly, considering the length that matching the above would seem to require, please make it a good well communicated answer that's pleasant to read. Others who may be interested in this in the future I would hope would be entertained as well as educated by the response.

So there are some parameters for "correct". They're very high I think, but I've designed them as kind of an outline for what I envision the "best" answer would be. Obviously given enough time I'll select the closest matching response as the "answer".

```
(1) - I worked on a prior version of this website, and while we did not have an explicit
      conversation about it, I felt that I was not able to do very well at all (this can be
      evidenced by the fact that they have since changed their website entirely)
(2) - Firstly, yes, it's a real product (even though I'm writing this post in Chrome...), and
      it kicks ass. Secondly, I was a high school intern developer in test, wrote proof of
      concept code for some of the new features for IE8... so it was a while ago.
(3) - At the time of this posting I am the developer who wrote this app, I am no longer
      responsible for it's code base
(4) - My internship will start in June of 2012, and I'll be working in the Web Store
      team.
```


问:
What tools do you use to manage requests from users?
I'm drowning in user emails and I'd like to implement a better way to manage all these requests I get and put them in a queue where those people on a team, as well as users, have access to them and can make common notes. I'm thinking about some sort of task management tool that would allow multiple tasks to be created under a project where emails, comments, ideas, etc. could be dropped/entered and easily accessible.

I need something that all parties can be involved in - users, managers, team leaders, developers. I'm looking for a tool that can allow:

Users to just drag/drop an email to submit a request for maintenance or enhancement.

Developers to just see their queue and the weighted priority of each task/project.

A team of developers to see what everyone is working on in real-time.

Management to keep a a log of time spent on each task.

I I am starting to look in more of a Agile/Scrum direction for solving this problem. I found list of scrum agile sofware project management open source tools. Since I am limited on time, has anyone used these? Which one should I test to see if it will meet my needs? TeamPulse is a good direction, but think it is a little too bloated. I need something simple for all parties.

答:
TargetProcess

You can:

track bugs

track requests

track time-sheets

track user stories

track releases

http://www.targetprocess.com

ContentLicense: CC BY-SA 2.5


问:
The Joel Test's equivalent for measuring a programmer
I understand that to measure a project or code, we can use The Joel Test, but is there any simple standard test (like The Joel Test) that is able to measure and filter how good a programmer is?

My plan is to have this test as a quick filter first before going to a more detail test.

答:
It's not as detailed as the Joel Test, but asking them to write a fizz buzz program will be a good indication to see if they can code at all.

http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
and
http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/

That will not tell you about the software engineering maturity of the individual, but it will screen out the worse.


问:
Are there guidelines on how many parameters a function should accept?
I've noticed a few functions I work with have 6 or more parameters, whereas in most libraries I use it is rare to find a function that takes more than 3.

Often a lot of these extra parameters are binary options to alter the function behaviour. I think that some of these umpteen-parametered functions should probably be refactored. Is there a guideline for what number is too many?

答:
Very much like Evan Plaice is saying, I'm a huge fan of simply passing associative arrays (or your language's comparable data structure) into functions whenever possible.

Thus, instead of (for example) this:

```<code><?php

createBlogPost('the title', 'the summary', 'the author', 'the date of publication, 'the keywords', 'the category', 'etc');

?>
</code>```

Go for:

```<code><?php

// create a hash of post data
$post_data = array(
  'title'    => 'the title',
  'summary'  => 'the summary',
  'author'   => 'the author',
  'pubdate'  => 'the publication date',
  'keywords' => 'the keywords',
  'category' => 'the category',
  'etc'      => 'etc',
);

// and pass it to the appropriate function
createBlogPost($post_data);

?>
</code>```

Wordpress does a lot of stuff this way, and I think it works well. (Though my example code above is imaginary, and is not itself an example from Wordpress.)

This technique allows you to pass a lot of data into your functions easily, yet frees you from having to remember the order in which each must be passed.

You'll also appreciate this technique when comes time to refactor - instead of having to potentially change the order of a function's arguments (such as when you realize you need to pass Yet Another Argument), you don't need to change your functions's parameter list at all.

Not only does this spare you from having to re-write your function definition - it spares you from having to change the order of arguments each time the function is invoked. That's a huge win.

Body:
Very much like Evan Plaice is saying, I'm a huge fan of simply passing associative arrays (or your language's comparable data structure) into functions whenever possible.

Thus, instead of (for example) this:

<?php

createBlogPost('the title', 'the summary', 'the author', 'the date of publication, 'the keywords', 'the category', 'etc');

?>

Go for:

<?php

// create a hash of post data
$post_data = array(
  'title'    => 'the title',
  'summary'  => 'the summary',
  'author'   => 'the author',
  'pubdate'  => 'the publication date',
  'keywords' => 'the keywords',
  'category' => 'the category',
  'etc'      => 'etc',
);

// and pass it to the appropriate function
createBlogPost($post_data);

?>

Wordpress does a lot of stuff this way, and I think it works well. (Though my example code above is imaginary, and is not itself an example from Wordpress.)

This technique allows you to pass a lot of data into your functions easily, yet frees you from having to remember the order in which each must be passed.

You'll also appreciate this technique when comes time to refactor - instead of having to potentially change the order of a function's arguments (such as when you realize you need to pass Yet Another Argument), you don't need to change your functions's parameter list at all.

Not only does this spare you from having to re-write your function definition - it spares you from having to change the order of arguments each time the function is invoked. That's a huge win.


答:
Yeah:

Do you program in your spare time?

In all my experience, this single question is most indicative of how good a programmer is. If they enjoy it; if they have passion for doing the task, then they're going to be good at it.

And frankly, a lot of 9 to 5 jobs don't involve a lot of coding. They don't involve a lot of iterating through the life-cycle of designing new programs and seeing how that design works/fails. Without that iteration, there's simply not the practice needed for programmers to gain core program design skills.

And they don't involve a lot of learning. Programmers who even simply hack on things at home are going to be exploring new and interesting solutions without the constraints of big business.

Title: The Joel Test's equivalent for measuring a programmer

Body:
I understand that to measure a project or code, we can use The Joel Test, but is there any simple standard test (like The Joel Test) that is able to measure and filter how good a programmer is?

My plan is to have this test as a quick filter first before going to a more detail test.


答: F# allows white space in identifier names, but they must be surrounded with double backticks.  See the answer to this question: https://stackoverflow.com/questions/6639688/using-keywords-as-identifiers-in-f.</p>


问:
I target short projects, but fail miserably on projects that requires persistence
I know this is kind of time-management question. I do well in short assignments, but fail miserably, when it comes to projects that require hours and hours of work to be done day after day.

I cannot code more than 10 minutes, unless there is a deadline. I kinda wander and come back and code. It takes me ridiculously large amount of time even for simple project. I kinda lack persistence. I have my thesis coming up in December. The more time I spend, the better my publication will be.

I was wondering, may be I could get some help on how to code persistently?

I just get out of my chair and start doing other things, when I see a bug or when I have a module that requires thinking and it takes me long time to come back sit and put my thought back to the code.

Any advice on how to improve my persistent coding skills?

答:
I'm going to be blunt. You need to fix this problem before you get into the workplace. Work only in five minute increments and only on stuff you are interested in and prefering to work alone and not with a team are all reg flags of someone who would be a bad hire.

The first thing you need to do is disconnect from all the distractions. When you are working, no Facebook (or other Internet time-wasters), no phone, no IM/email, no games. Period. Never under any circumstances during work hours(well you can reintroduce work phone calls and work only IMs/emails later). SInce you aer in schoolll you will have to screate teh work scheduel, But I think you need to actually schedule the time every day to do this.

Next you need need to learn to concentrate for longer than five minutes. Set a timer for ten minutes (If you can't handle that then start at 6 minutes) and no matter what do not stop until it goes off. Gradually increase the time until you can concentrate for an hour.

Learn to do the boring bits first where possible and reward yourself for doing the stuff you don't like with the stuff you do like.

When you have a group project, do not work alone. Get the group together and work a scheduled set of hours.  Set aside some time at either the beginning or end of the scheduled work period to discuss progress.

As far as you are OK if you like respect everyone on the project, well get rid of that attitude right now. You don't have to like co-workers to work with them. You need to be polite to everyone and offer the same professional competence whether the person is a jerk or not. If someone is going to cause disruptions because they can't get along, it is best to make sure it is someone else. This is totally about attitude, you can change your attitude.


答:
Do you use source control?

Yes, but

It doesn't really tell you anything.

How do you know whether I forward merge?

How do you know whether I pull changes before pushing?

How do you know whether I build before committing to repository.

Can you make a build in one step?

Yes, our CI lead writes scripts and I just run them in powershell.

Do you make daily builds?

Our CI server does

Do you have a bug database?

Yes, but I haven't configured it and I don't administer it, I simply use it.

Do you fix bugs before writing new code?

In a perfect world where I have unlimited resources - yes I do. In real world I'm sometimes forced to log them and work on something else.

Do you have an up-to-date schedule?

Nope, that's not my job.

Do you have a spec?

I get given a spec, I then analyse it and produce relevant documents.

Do programmers have quiet working conditions?

Will you not hire me if I listen to music, talk to my colleague and make a joke? Software development supposed to be creative - working conditions will vary from one organisation to another.

Do you use the best tools money can buy?

You don't know what the best tools are and if you think that you do, there will always be someone to argue your point.

Do you have testers?

Yes. Actually, yes and they are not very good, but that wasn't in the question.

Do new candidates write code during their interview?

Yes and they fail. Yes and they pass. What does this tell you?

Do you do hallway usability testing?

No, but what if we do something better?

To conclude:

This test might work well in a perfect academic world where everything just works, everybody gets along, shares knowledge and there are unlimited resources.

What you want to know is what kind of engineer I am. Simple bitwise answers won't tell you anything useful and I think that somebody has to be very naive to fall for them.

Answers above, both negative and positive don't tell you anything about my ability to produce clean code.

This is not a rant, but I would be very interested to hear what kind of developer you think I am based on the answers that I have provided. This will hopefully prove my point.


答:
Visual Basic (and VBScript) also allow whitespace in identifiers if you surround the identifier with square brackets.

```<code>Dim [Hello World]
[Hello World] = 123
</code>```

However, doing so is quite rare.

Body:
Visual Basic (and VBScript) also allow whitespace in identifiers if you surround the identifier with square brackets.

Dim [Hello World]
[Hello World] = 123

However, doing so is quite rare.


答:
You cannot effectively reject connections unless you supply every customer with a private key which you can individually revoke. But this is probably overkill. You don't need a bulletproof solution if most people won't bother to fire a bullet.

It's a security question, so let's describe a threat model and mitigation strategies.

Suppose you have an URL hitting which can incur noticeable cost to you (e.g. processing cost), and you want to protect it from both a simple DoS attack and from copycat apps.

Use SSL to hide the connection from being easily analyzed. Use a non-obviuos port number, a redirect sequence, a cookie exchange to complicate the connection slightly before you do the costly part of the request. Use some secret code baked into your app to let the server know it has to accept the connection.

Now someone cannot learn the expensive-to-hit URL simply by running a packet sniffer, or by looking at URL-like strings in your code. A potential attacker has to decompile your app.

You cannot really protect your code from being decompiled and / or run under a debugger. The attacker eventually learns the secret key and the connection sequence.

You notice that you start to receive rouge requests at your costly URL: either in a form of an attack, or in a form of a copycat app that has to access your service in order to run, or maybe an exploit code is publicly posted. You cannot tell a rogue request from a legitimate request, though.

Create a free minor update to your app, with a different secret key. It should hit a different costly URL that serves the same data as the compromised costly URL. For some time, make the both URLs accessible.

Watch your user base switch to the updated version. Throttle the compromised costly URL and eventually 404 it. You have just mitigated a security breach, hopefully without losing too much. Back to square one.

Disclaimer: I'm not a security expert.

Title: Safe iPhone app ↔ server communication


问:
What software programming languages were used by the Soviet Union's space program?
I got interested in the Soviet space program and was interested to discover that the software on the Buran spacecraft circa 1988 was written in Prolog.

Does anyone know what languages might have been used in earlier missions, especially the Mars PrOP-M rover missions of the early 1970s which were somewhat autonomous and could navigate obstacles?

Edit

My source for the Buran Prolog is this declassified document from the CIA site from May 1990.  I couldn't find an OCR version, so here's the relevant quote from p. 0449:

According to open-source literature, the Soviets used the
  French-developed programming language known as Prolog to develop
  on-board system software for the Buran vehicle...

答:
In the 80s, the third generation of Argon airborne computers used Pascal, Fortran and Si. (Si?). I have not found any other language beside assembler used before that.

From Argon airborne computer history

Argon family was created in three stages. During the first stage (1964 - mid 70s) 11 types of computers for space, airborne and ground automated control systems were produced.

and

In mid80s the third stage of development of Argon computers began. In 1986, the state program was adopted whose goal was to create unified mobile computer families, so-called SB EVM, based on ES EVM, POISK and SM EVM architectures.

One of these, the SB-3580 airborne computer, had:

Programming facility: OS RAFOS-11 cross-system. Programming languages include: Assembler, Si, Pascal, Fortran.а

source: Introducing Argon


问:
Freelancing - Share the source code?

Possible Duplicate:

Hand over source code to customer

I have developed a couple of form based windows application in vb.net for a client and they all work well and he paid me through a freelance site. I have handed over the executable and the setup to the client and all was well. Now the client wants the source code for the application. Is there a general practice on sharing the source code with the client?

Please note - the client never mentioned he needs the source code and he is now asking for it after a week after the app was completed and he made the payment.

I don't mind sharing the source code, but I am not sure if I should. This probably means the client would not hire me again and the bigger question is the source code really his property?

This question may have been asked a few times, but I cannot still draw a conclusion on what is right.

update

To answer some of the questions:

The source code was not mentioned at all. There was no exclusive contract signed except for the usual agreement of the freelance site.

I am not sure if software development comes under work for hire and is it valid for users outside of the US?

The reason for not sharing the source code was this was a very small project and I got paid for a mere few hours. So if I have an option then definitely I would want to keep the source code to myself as that gives a possibility of the client coming back. The application works flawlessly and the code is solid. Also, the task that the client wanted to achieve was very challenging and I would not like other programmers (competitors) to know how I achieved it.

So unless I get the confirmation that the source code is purely the property of the client, I would not be willing to share it.

答:
If your goal is to do more work for this client, give them the source code. It's a small project and the client will go to someone else just to spite you. I know I would

Since there was no agreement, give the client the code, but get a written agreement that you are allowed to use, sell, alter, for personal or future work.

If you were paid by the hour, you can charge for your time to put the code together and send to the client.

Title: Freelancing - Share the source code?


答:
Problem is that you don't have any confidence in your code. Yes, partially it's a "bad habit", but I think the main problem is indeed a lack of confidence.

Eventually you'll be working on a system where you won't be able to verify your change instantly. This is likely to have a negative impact on your productivity.

To address this you need to set yourself a target and increase that target gradually.

Unit tests will help you when testing individual components, but there is only so much that can be done with unit tests. This becomes more relevant in enterprise systems.

Each time you break something, or the system does something you didn't expect it to, make a note of what happened and how you fixed it. Eventually you should start seeing a pattern. You should be then able to address this by evaluating your stats.

I'm also assuming that you have been a developer for a relatively short period of time, so the confidence in your code will grow with your experience.


问:
Dealing with estimates as a junior programmer
I have been working for a couple of months now in a company that estimates (for the general population, not juniors specifically) tasks and then we are given the task, solve it, it goes through two tests and at the end the estimate should be somewhat met.

I am beyond stressed because some of the estimates are simply impossible for me to meet. I still don't know the entire system(because it is quite substantial) so sometimes half the time is spent finding out what i need to do and where and by the time I finish sometimes the estimate is over and there is still testing to be done (and correcting mistakes if they were any).

The second time I have to deal with a similar functionality it all works much faster, but so far I feel like I am just bad at programming.

Is there anything you did when you were just beginning that helped you get over this stage? I get so stressed when I see how little time there is to code that sometimes I can't even focus properly at what I'm doing which makes it even worse.

答:
Bring this up with your team lead, project manager and/or whomever does your estimation; not us. People understand that things don't take the same amount of effort for everyone, and they can work to either adjust the estimates when the task is assigned or at the very least allay any fears you have about the review period.

This is, in my opinion, the reason that estimates should be done by the people assigned the task (with input/collaboration from the lead/peers). You get more accurate estimates for how long the work will actually take people to do.


问:
Do you actively think about security when coding?
When you're coding, do you actively think about your code might be exploited in ways it wasn't originally meant to do and thus gain access to protected information, run commands or something else you wouldn't want your users to do?</p>

答: Absolutely.  I think about injection vulnerabilities, and also how my business logic will work in a desktop environment versus a web environment, and how security is implemented in both types of environments.</p>


答:
I can't imagine a worse position to put a junior developer in than to set an expectation that they can't keep, unless of course they're doing it to challenge you. Have you had any real repercussions to not meeting the estimates?

I'd say first, it's important that you learned to estimate on your own. When you're given a task, immediately estimate it at what you think it would take, and then start finding the delta between the two. I can almost bet that quality is being sacrificed in the initial short estimate. If it's simply that they're expecting you to design and develop items faster than you can, you may need to have a chat with someone to resolve the issue.

Second, understand that quality is a feature that stake holders, your boss, get to decide to pay for. It may be something that you'll have to either sacrifice doing a bit to satisfy the requirements in the time you have.

Either way, eliminate the stress, it's no fun continuing feeling like you're always behind writing bad code. Hope this helps.

Title: Dealing with estimates as a junior programmer

Body:
I have been working for a couple of months now in a company that estimates (for the general population, not juniors specifically) tasks and then we are given the task, solve it, it goes through two tests and at the end the estimate should be somewhat met.

I am beyond stressed because some of the estimates are simply impossible for me to meet. I still don't know the entire system(because it is quite substantial) so sometimes half the time is spent finding out what i need to do and where and by the time I finish sometimes the estimate is over and there is still testing to be done (and correcting mistakes if they were any).

The second time I have to deal with a similar functionality it all works much faster, but so far I feel like I am just bad at programming.

Is there anything you did when you were just beginning that helped you get over this stage? I get so stressed when I see how little time there is to code that sometimes I can't even focus properly at what I'm doing which makes it even worse.


答:
Create unit-tests and automate your testing but also stop testing so often. Take an extra minute to re-read what you've written and increase your confidence that it works. That way you don't rely on unit-tests to catch the simplest mistakes and you increase confidence in your own ability.

Anecdote: I was tutoring a student and they wanted to compile the code and test it after changing a few lines, I told them no and we proceeded to write out all the code that we needed and then tested it. Before testing, we went through line by line to make sure the logic was correct. In the end, the compiler only caught misspellings and the unit-tests caught no errors.


答:
First up: If you get faster with each attempt at a problem, you are probably not a bad programmer. So let's get that thought out of the way.

I would suggest this is your managers' failing, but it is and always will be your job to manage expectations.

Rather than beating yourself up for not being able to meet unrealistic deadlines, measure how many days' work you can actually do in a week. Then explain to your team lead that you're new to the business and software development and you can only be expected to get n days senior-developer work into a standard week. They should at least understand this, even if they don't like it.

Tell them that you expect to keep improving and show them how you can measure that improvement. And agree with them that you don't expect a senior's wage until you can do 5 days of senior-developer work in a week. But likewise you don't expect the same responsibilities as a senior when you're not paid nearly as much.

To take this further, this is why I'm a strong proponent of using story points instead of hours for estimation. ie. Each job gets a number of points, and the team estimates how many points they can achieve in a given period of time. The following period, the estimate is the same as the actual from the previous period, adjusted for known factors like a heavy holiday month or a developer leaving.

As a manager, when a new developer comes in (junior or senior), I make it clear to the business that we will not increase the estimate in the first instance. That developer is expected to take up as much time from other developers as they save. The new developer will probably do better than that, but under-promise and over-deliver is the mantra.

The developer will improve over time, a senior quicker than a junior, and the team's "velocity" - the estimate month on month - will improve along with it.


答:
Keep calm and carry on. If the issue of your not meeting the estimates is ever brought up, just tell them the same things what you wrote in your post, or if you're feeling insecure, talk about it with your mentor/team lead on your own.

Estimates are just that, estimates. They can and will be off, more-so when you're learning the ropes. And as a junior, it's likely the case you're learning the ropes as a team member on that particular project, as a programmer using whatever technology you're using and as an employee at your company. And if you're working with sensible people, they are expecting that you'll be off with the estimates.

You're likely looking at the tasks you're getting "from the bottom up". Your tasks are more important to you than the big picture of the project you're working on - that's understandable. You see the estimates as restrictions placed upon you and obviously are getting anxious when you're not meeting them.

But when you look at the big picture, you'll see that estimates, even more than 'targets' for developers, are 'signals' for leads/project managers. Breaking work into tasks and estimating them is a way to decrease the complexity of managing and estimating the entire project. Keeping track of actual work done vs the estimates is a means of keeping track of how's the project doing, but it's only one of the metrics that can be applied. When estimates are not met on a regular basis, it's a signal for the manager that there's something wrong with the project. But in any reasonable project, it won't be the fact that there's a junior developer on the team not meeting the estimations.


答:
Many developers with little management experience estimate tasks using their own velocity or velocity of a "best" developer in a team.

Velocity varies with experience. Senior developer can take 3 hours to solve something, when it'll take you 2 working days to solve the same problem.

Stress can be rarely avoided when you take up a new job. After few months it normally gets better, assuming you put in enough work and ask lots of relevant questions.

Your seniors might not be aware of how you feel about estimates, therefore it's important you ask them what do they expect of you.

From my experience:

I think that senior developer or a manager should be able to estimate a user story (business requirement) in terms of t-shirt sizes (XL, L, M, S, XS).

It is developers job to break the user story into smaller tasks and estimate those. Large task might take senior developer a day to solve, when it might take you an entire week.

It is very important to record how long it actually took you to complete the task.

Good project manager or senior developer would constantly gather this statistics. When your productivity improves, they will be aware of it and they will send more work your way.

This will not only make your life less stressful, but it will also allow the department to manage their resources effectively.


问:
Web application - database design/infrastructure
I have just begun development of a web application (that will be deployed using Google app engine), without going into the specifics, the web app will allow users to deploy a small website of their own, part of app allows the users to create a form to allow customers to sign up to the users website, however each user may require to collect different data on its customers, for example one user may require a customer’s first name and email address only where as another may also require the customers age.

My question is what would be the best way to structure the database(s)?

By structure the database(s) I mean how can I implement them so that I can store the different data collection sets for each user and then store the information that is retrieved by each of these users from their customers? For example I don’t think this is right but my initial though was that I would have to deploy a database for each of the users but this seems like overkill, or add a new table for each of the users (I don’t even know if these two are options). I have only had experience with trivial databases and this problem has me confused.

答:
I would suggest that you look into Cassandra or MongoDB. They both are, what is commonly known as NoSQL databases.

Some advantages that NoSQL databases have over traditional relational ones are:

Helps in Scaling

Flexible data model

Distributed and Fault tolerant


答:
I use industry-standard practices, like using SQL parameters.  I use "safe" platforms, like the .NET Framework, and take advantage of security features like anti-forgery tokens in ASP.NET MVC.  I don't write my own encryption algorithms, but I do understand what those encryptions provide in the way of security benefits, and when I need to use them to obtain those security benefits.

In short, I use best practices, but I don't develop my own security tools.  I am not a security expert in that regard; I rely on other security experts, who have presumably already thought deeply about these issues, and have a clear understanding of the risks and benefits.

My fundamental approach to security, beyond simply using security tools, is to eliminate all possible input to the system except that which I am expecting.  If I have a social security number field, the only characters that should actually show up are numeric digits and dashes, in a specific pattern.

I validate user input on both the client and the server.

Title: Do you actively think about security when coding?

Body: When you're coding, do you actively think about your code might be exploited in ways it wasn't originally meant to do and thus gain access to protected information, run commands or something else you wouldn't want your users to do?</p>


问:
Is there a way to publish software architectural design for open use and prevent patenting?
I'm not sure I have the correct verbage in my question, so let me explain:

What I mean by "software architectural design":

I have (what I believe) is a unique and useful design concept for an architecture that involves multiple clients, shared states, blah-blah, etc. etc.

This architecture would be used in multiplayer games with persistent worlds.

Although it would facilitate a novel kind of gameplay, it is not a description of "gameplay."

What I mean by "for others":

Free for personal/edu/commercial use. (MIT/BSD style license?)

What I mean by "prevent patenting":

I want to make sure that this particular design cannot be patented/copyrighted by someone else.

(Basically, litigation battles over software architectures for games like MMOs, etc. disgust me, and I want to keep this particular design idea free to use.)

Is this something that I can easily accomplish?  Can I just write up a design document for the architecture and publish it to the web under say, the MIT license even though its not actual code?

Or do I have to file for a patent?

答:
I am not a patent lawyer, and if you want to really get to the bottom of this subject, you would probably be better off talking to a lawyer who has a firm understanding of patent law.

With that disclaimer out of the way, I am also aware that patent laws differ in different parts of the world.  Some nations allow for patents as first to register, while others first to invent.

I can't really answer with regards to nations where being first to register is allowed, as I am unaware of the nuances of law governing patents in such countries. In the case of being first to invent however, if you were to publish a something patentable publicly, and if there was nobody in the world who could provide documentary evidence to suggest that they had come up with the idea prior to your publishing it, then it this would provide enough grounds to allow patent registration to be challenged.

Here's your problem though, it's not enough to simply register a patent or to publish something publicly, as this can't really prevent someone lodging a patent application with regards to your invention. The only way to prevent patenting is to challenge the patent, and that often involves paying patent lawyers lots of money if the matter can be managed outside of the courts, and a ridiculous amount of money if the matter goes before the courts. This is partly why software patents are such a bad idea, because it's not ever going to be about right, wrong, or who actually invented what, but about who has the larger checkbook and therefore can afford to go the distance in litigation.

You're probably better of just releasing something under an open source license, and hoping that it will gain enough traction in the public domain to make an illegitimate patent registration not worth somebody's while, however it really comes down to how much value you place on the invention itself and whether you are going to be willing to go through litigation to protect your idea should someone with deep pockets and no conscience attempt to patent your idea anyway.


答:
About the best you can do is publish it as widely as possible and hope for the best.

There's nothing you can do to prevent somebody from applying for a patent on something that (think they) invented. If you publish the design, the patent office may or may not become aware of it. If they do, and understand its similarity to a later application, they may cite it as prior art. If they do, that applicant can 1) argue that it's not really prior art, or 2) attempt to make minor changes to what they claim to work around your prior art (and in neither care are you likely to have any input into saying: "but that's still part of what I meant", or anything like that.

No matter what you do, somebody may get a patent on it anyway. Even if they don't get a patent on exactly what you wrote about, they may manage to get a patent on something you'd consider unreasonably similar. Another possibility is that they apply for patents on ways of applying your architecture, even if it doesn't cover the architecture itself.

Bottom line: there's not much you can do. You can't stop people from suing each other. Unless you're willing to expend inordinate effort, there's a good chance a lawsuit could be not only filed, but completed without your ever even being aware of it (even if).

Title: Is there a way to publish software architectural design for open use and prevent patenting?

Body:
I'm not sure I have the correct verbage in my question, so let me explain:

What I mean by "software architectural design":

I have (what I believe) is a unique and useful design concept for an architecture that involves multiple clients, shared states, blah-blah, etc. etc.

This architecture would be used in multiplayer games with persistent worlds.

Although it would facilitate a novel kind of gameplay, it is not a description of "gameplay."

What I mean by "for others":

Free for personal/edu/commercial use. (MIT/BSD style license?)

What I mean by "prevent patenting":

I want to make sure that this particular design cannot be patented/copyrighted by someone else.

(Basically, litigation battles over software architectures for games like MMOs, etc. disgust me, and I want to keep this particular design idea free to use.)

Is this something that I can easily accomplish?  Can I just write up a design document for the architecture and publish it to the web under say, the MIT license even though its not actual code?

Or do I have to file for a patent?


问:
Mobile web development rudiments
How does one get started with web development for mobile devices (including phones)? I know some old good HTML & JS, but I'm wondering what the modern way is.

To make it concrete, I need to implement a client for an enterprise app. Think of a login-protected dashboard for managers.

Given that I only have basic knowledge and have never implemented such applications, what do I need to take into account when choosing platform and technology?

Shall I go for Android / iPhone, or HTML & JS, or HTML5? What are the general pros and cons that I need to consider?

How can I test an Android app on desktop without using a phone?

Same question about testing HTML/JS or HTML5 (the mobile version needs to be different from desktop, and I would like to see it exactly as if it was a phone).

What resources (preferably online) do you recommend for learning the rudiments? I mean especially HTML & JS: What does the site need to be like to work great on smartphones (and not only on desktops)? I mean possible UI glitches, limited support for some HTML/JS features, page size, and whatever other important details are there.

答:
I agree with many of the answers with regards to using HTML 5 and jQuery Mobile.  If you have .Net development experience (like me), and you don't want to use MVC 4, which is still in beta, you can create an MVC 3 Web application and enable it for mobile browsers.  The key to doing this is to detect the "User Agent" string on the request.  From there, you can determine if the request is originating from a desktop/laptop browser or from a mobile device.  </p>

<p>"Mobile-enabling" a Web application solves the problem of your app running on multiple devices, and requires you to only maintain one codebase.  Check out this post for a quick way to get up-and-running with a mobile MVC 3 application using jQuery and HTML5:</p>

Title: Mobile web development rudiments

Body:
I agree with many of the answers with regards to using HTML 5 and jQuery Mobile.  If you have .Net development experience (like me), and you don't want to use MVC 4, which is still in beta, you can create an MVC 3 Web application and enable it for mobile browsers.  The key to doing this is to detect the "User Agent" string on the request.  From there, you can determine if the request is originating from a desktop/laptop browser or from a mobile device.

"Mobile-enabling" a Web application solves the problem of your app running on multiple devices, and requires you to only maintain one codebase.  Check out this post for a quick way to get up-and-running with a mobile MVC 3 application using jQuery and HTML5:


答:
The data pattern you describe is not relational. You could use a relational database for this, but it is not the right tool. As suggested you should use a non relational database, such as mongodb(document database), couchdb, or something else. If you insist in use a relational database,  you could create a table where the user attributes is stored as rows instead of columns, but keep in mind that this is not the best option and could be problematic in terms of performance when the table becomes large. The described schema could something like this:

// specific user Information
Create table users_info (userid, info_name, info_value)

// common user information
Create table users(userid, username, site_name)

//sample data
insert into users(userid, username, site_name)
Values(1, "nohros", "nohros.com")

insert into users_info(userid, info_name, info_value)
Values(1, "ssid", "6664312")

insert into users_info(userid,info_name,info_value) values (1, "ssn", "123456789")

Title: Web application - database design/infrastructure

Body:
I have just begun development of a web application (that will be deployed using Google app engine), without going into the specifics, the web app will allow users to deploy a small website of their own, part of app allows the users to create a form to allow customers to sign up to the users website, however each user may require to collect different data on its customers, for example one user may require a customer’s first name and email address only where as another may also require the customers age.

My question is what would be the best way to structure the database(s)?

By structure the database(s) I mean how can I implement them so that I can store the different data collection sets for each user and then store the information that is retrieved by each of these users from their customers? For example I don’t think this is right but my initial though was that I would have to deploy a database for each of the users but this seems like overkill, or add a new table for each of the users (I don’t even know if these two are options). I have only had experience with trivial databases and this problem has me confused.


答:
There are two ways to go here.

Use a NoSql type database and have some pretty complex logic in your code to pull everything together.

Or

Generate a relational database schema, plus all the classes/code to handle it for each website. You have a fairly complex code generator, but, simple straightforward and easy to debug code for the actual website.


答: Yes. Security is important, and shouldn't be an afterthought; adding security after the fact is generally more difficult than designing it into the application in the first place, and if you add it in later you'll probably miss some things (or just not bother adding it in at all).</p>


答:
My first thought was not, but then reading the other responses, it is usually assumed that if you pay for some "custom" software package they own it.

If this was a purchase or license then yes, you would own the code, but this was not case here.

The company is likely asking for it so they can maintain it going forward.  They may have some internal person, they may use you again, or someone else.  Their opinion of you will likely have a lot more to do with how well you worked with them, how good the deliverables were, and how much they liked working with you personally.

Title: Freelancing - Share the source code?

Body:
Possible Duplicate:

Hand over source code to customer

I have developed a couple of form based windows application in vb.net for a client and they all work well and he paid me through a freelance site. I have handed over the executable and the setup to the client and all was well. Now the client wants the source code for the application. Is there a general practice on sharing the source code with the client?

Please note - the client never mentioned he needs the source code and he is now asking for it after a week after the app was completed and he made the payment.

I don't mind sharing the source code, but I am not sure if I should. This probably means the client would not hire me again and the bigger question is the source code really his property?

This question may have been asked a few times, but I cannot still draw a conclusion on what is right.

update

To answer some of the questions:

The source code was not mentioned at all. There was no exclusive contract signed except for the usual agreement of the freelance site.

I am not sure if software development comes under work for hire and is it valid for users outside of the US?

The reason for not sharing the source code was this was a very small project and I got paid for a mere few hours. So if I have an option then definitely I would want to keep the source code to myself as that gives a possibility of the client coming back. The application works flawlessly and the code is solid. Also, the task that the client wanted to achieve was very challenging and I would not like other programmers (competitors) to know how I achieved it.

So unless I get the confirmation that the source code is purely the property of the client, I would not be willing to share it.


答:
That's a tough place.  Sounds like you're stuck in the "just have to deliver" stage of that pipeline.

Over the years I've noticed the following about estimation:
The quality of an estimate can be determined by answering (with a proper name) the following three questions.

Who made the design?

Who made the estimate?

Who is doing the implementation?

The quality of the estimate is inversely proportional to the number of distinct individuals named.  For example: the best estimate is when the same person has done all three of the above tasks, a weak estimate is when one person did design/estimate and another will do implementation, and the worst estimate is one where all three questions are answered with a unique name.


问:
If I am developing a hosted payments page, what should the infrastructure look like?
If I am not storing credit card info, do I have to be concerned with PCI-compliance?

I will be using a payment processor with a bank in my country. Literally just taking the credit card info and passing it to the gateway and processor. I would love to get an idea of the various technologies I might need to consider from an software architectural point of view.

What are the best practices in terms of accepting credit cards and reducing fraud risk on my end?

I will be creating the app in Rails.

答:
PCI regulations are not US laws, they are rules put forth by the various credit card companies, being outside of the US doesn't exempt you from complying with them.

First thing to determine is what payment processor you are going to use, that will pretty much set the direction for everything else.


问:
The bracketless if statement is frowned upon, but is it still bad style if your IDE is equipped for it?
This type of conditional statement is generally frowned upon

```<code>if(condition)
  statement;
</code>```

because if you add another statement, like this

```<code>if(condition)
  statement;
  statement;
</code>```

it gives the impression that the second statement is part of the if block when it isn't.

That said, my IDE does automatic indentation, which I think makes this problem moot. Furthermore, when I want to add another statement, it automatically does the bracket completion--which makes the issue about having to manually add brackets when you want to add another statement moot.

Is there any reason why this would still be bad style?

答:
Yes, because not everyone on your team may be using that particular IDE. In general, it's still pretty dangerous since most IDEs/editors don't have this functionality so it can still let bugs creep in.

Also, many people prefer the brackets for readability purposes, since it makes it more clear that certain code is associated with an if statement.


答:
Kindof. Disclaimer: I'm a security guy ;)

So the way I work is that I have my threat model, which describes what kind of attacks by what kind of attackers are likely. That helps to work out the security requirements. When I'm actually coding, I do the usual "safe coding" practices like being careful that cursor variables are always within bounds, tainted input is sanitised, error conditions are handled. Then I go back to my threat model to see which modules are most likely to get targeted by attackers; those get some extra review.


答:
Alright, I'll be the one to state the unspoken.  If omitting the brackets was such a serious offense, it would show up with -Wall, and none of the newer languages would let you do it at all.  It is nowhere near a universal preference, and a lot of people even remove the brackets from existing code because it removes clutter and clarifies you only intended to include one statement.  It's a rookie mistake because the code won't pass even basic testing, and in my experience the following mistake is more common among rookies:

```<code>if (condition);
{
    statement;
}
</code>```

Probably because autoindent won't catch this bug, but will catch the one cited as the reason for including the superfluous brackets.  Autoindent has been a feature of every single programmer's editor for decades, and if you don't use it, you deserve to get stymied by stupid syntax errors.

Title: The bracketless if statement is frowned upon, but is it still bad style if your IDE is equipped for it?

Body:
This type of conditional statement is generally frowned upon

```<code>if(condition)
  statement;
</code>```

because if you add another statement, like this

```<code>if(condition)
  statement;
  statement;
</code>```

it gives the impression that the second statement is part of the if block when it isn't.

That said, my IDE does automatic indentation, which I think makes this problem moot. Furthermore, when I want to add another statement, it automatically does the bracket completion--which makes the issue about having to manually add brackets when you want to add another statement moot.

Is there any reason why this would still be bad style?

Body:
Alright, I'll be the one to state the unspoken.  If omitting the brackets was such a serious offense, it would show up with -Wall, and none of the newer languages would let you do it at all.  It is nowhere near a universal preference, and a lot of people even remove the brackets from existing code because it removes clutter and clarifies you only intended to include one statement.  It's a rookie mistake because the code won't pass even basic testing, and in my experience the following mistake is more common among rookies:

if (condition);
{
    statement;
}

Probably because autoindent won't catch this bug, but will catch the one cited as the reason for including the superfluous brackets.  Autoindent has been a feature of every single programmer's editor for decades, and if you don't use it, you deserve to get stymied by stupid syntax errors.