238

Copy-paste blindly: bad. Look up documentation, read code examples to get a better understanding: good. I'd rather work with someone who looks up things all the time and makes sure everything works as intended than someone over-confident who thinks he knows it all but doesn't. But the worst is someone who doesn't bother understanding how things work, and ...


201

Perfect is the enemy of good. Or put another way, don't worry about it today. If your app does what it needs to do, then it's fine. It's not a bad thing to rewrite parts of software further down the line; by that point you 1) know more clearly what you're trying to build and 2) know which bits are actually the bottleneck. You could spend an enormous amount ...


178

What is even more important than your code surviving for 20 years is that your data survives for 20 years. Chances are, that's the thing worth preserving. If your data is easy to work with, building an alternate system on top of it with newer technology will be easy. So start with a clear and well documented data model. Use an established, well supported ...


176

In HTTP 1.1, there actually is a status code (307) which indicates that the request should be repeated using the same method and post data. As others have said, there is a potential for misuse here which may be why many frameworks stick to 301 and 302 in their abstractions. However, with proper understanding and responsible usage, you should be able to ...


174

Modern day startups need to hit the market as soon as possible. They don't need to spend about six months in order to release their Java web application. Twitter for example was built using Rails/Ruby but once it became unscalable, they migrated to the JVM. Not to mention that the development process isn't productive: code -> compile -> deploy while it ...


140

At what point should a developer be allowed to choose his tools? When they don't impact your team. Am I looking at this the wrong way? Absolutely. Yes, you have a short deadline. Yes, you could get it done faster in Rails. But the company as a whole needs to deploy and maintain the application. If the company has a stable of good C# developers, then it ...


136

In my experience, Java for web applications is overkill for small applications. A simple blog with one database table hold blog entries, for example, could be done in something much simpler. I have usually seen Java do much better in much larger web applications (think banks and insurance companies) that communicate with a number of other systems (such as ...


135

I programmed java web apps for 10 years before I switched to python, 4+ years ago. I feel that I'm much more productive using python and can get much more done in a shorter period of time, and to be honest, I'm much happier when I develop in python. Here are some of the reasons why I think python is better then Java based on my personal experience, your ...


132

Planning software for such a lifespan is difficult, because we don't know what the future holds. A bit of context: Java was published 1995, 21 years ago. XmlHttpRequest first became available as a proprietary extension for Internet Explorer 5, published 1999, 17 years ago. It took about 5 years until it became available across all major browsers. The 20 ...


122

Background Web development is all about communication. In this case, communication between two (2) parties, over the HTTP protocol: The Server - This party is responsible for serving pages. The Client - This party requests pages from the Server, and displays them to the user. In most cases, the client is a web browser. The User - The user uses the Client ...


112

Captain Obvious to the Rescue! I'll be Captain Obvious here and say that there's some middle ground to be found. You do want to build for the future and avoid locking yourself into a technological choice or a bad design. But you don't want to spend 3 months designing something that should be simple, or adding extension points for a quick and dirty app that ...


110

If you code your solutions in a maintainable way and actually UNDERSTAND what you copy/paste/modify then there is no problem. I die inside every time I ask a senior developer questions about why he did what and the answer is "I don't know, I copy pasted the code and it worked at that given time".


109

Any thoughts on how I can overcome this mental block, and to ensure my app will be scalable? The crux of the issue isn't scalability. The crux of the issue is thinking that you will get it right the first time. You should focus on writing clean code. Because clean code maximizes convenience when you (inevitably) have to change something in the future. And ...


104

Just Tell him the truth.. You are not a PHP shop. (That's reason enough why YOU can't do it in PHP) This is the price you are quoting for .Net. If he can beat that elsewhere, so be it. It's a horrible sales tactic to knock down your competition based on the platform used. (Even if it has a lot of weight in the clients mind) Sell yourself, Sell your ...


98

I'd say you have to talk to the team lead and say something like: I know you guys are a .NET shop, but I was actually hired for my Java/JRubyRails skills. I can build this new application in X amount of time using those tools that I already know. I could learn C#/mvc4 like you want, but it will take >> X amount of time. What do you want? This raises the ...


94

Start Ups want the shiny. Whatever the shiny is: RoR, Groovy, Grails, OOP w/ PHP, Foobar, Wibble, Narf, etc. Enterprise wants stable, reliable and scalable: Java and .NET fit that bill (when done correctly). Current gig: Financial Services. Platform: ColdFusion (essentially a Java Tag Library) and Java. Previous gigs: Education Testing Services - ...


93

Security through obfuscation is never good security. There must be better ways of protecting your intellectual property. And that is what you and your colleague should bring up as a joint concern with your manager. If management then decide that they don't want to spend the time or money on improved security, then both of you will have to live with that ...


89

Let's talk about cars. Oh wait, we already did - remember that time we met, some time ago? We talked about cars. In fact, you seemed to be quite the expert on cars. You were able to explain, in detail, all of what's right, wrong, and exciting about the latest Formula 1 race. You knew by heart all of Lamborghini's models, including their price and ...


89

There's a famous military saying, attributed to Helmut von Moltke: "No battle plan survives contact with the enemy". In the same vein, I do not think it's possible to make a spec that will not have to be changed - not unless you can predict the future and read minds of the stakeholders (even then they may not have yet made their minds, even if they claim ...


87

HTML and CSS are difficult to interview for a few reasons: They are too basic, compared, for example, to a programming language, They depend very much on the context of the job. Examples: If you create Google scale, hugely fast and optimized websites, the people you interview for the job cannot ignore what CSS sprites are. If you create XHTML W3C valid ...


82

Typically, it is bad practice to use language X to generate code in language Y. Try decoupling the two languages by making data their only interface -- don't mingle the code. In your example, you could improve the code by using PHP to populate a cfg structure that's available to JavaScript: <script type="text/javascript"> var cfg = { theId: "&...


82

There are indicators. Some are easier to find, others are harder. file extensions: .php indicates that the site is written in PHP, .asp indicates classic ASP, .aspx indicates ASP.NET, .jsp indicates Java JSPs, ... cookie names: JSESSIONID is a widely used cookie name in Java servers headers: some systems add HTTP headers to their responses specific HTML ...


81

The business logic should be placed in the model, and we should be aiming for fat models and skinny controllers. As a start point, we should start from the controller logic. For example: on update, your controller should direct your code to the method/service that delivers your changes to the model. In the model, we may easily create helper/service ...


73

An addition to the FrustratedWithFormsDesigner's answer: Since I guess that your question more targets towards smaller sites, there is an important aspect that you need to consider for a lot of people: Hosting is ubiquitous for PHP but its harder for Java or ASP sites. This however is not a defect of those languages.


71

Just like with the skill to program with/out API documentation, looking for code examples is a sign not of a bad programmer, but of one who lacks fluency... ...Here, I am talking about fluency. About being not just capable of something but fluent. Do you know what it is to be fluent? It's when for someone looking at you it appears as if you code as ...


70

Java absolutely is used for modern web application development. Particularly once you get to the slighly larger / more complex / scalable end of the web application spectrum. If you are interested in modern, productive tools and frameworks take a look at: The Play framework Google Web Toolkit Vaadin Tapestry 5 But I think most truly modern web development ...


65

Try it like this: If the username exists, log "failed login attempt by username". If not, log "failed login attempt by IP 123.45.67.89" instead. That should take care of the problem of having passwords show up in the log accidentally.


64

Server side validation is absolutely necessary. Client side validation is purely a user experience improvement since the same validation should always happen on the server anyway. After all, you can always disable JavaScript or simply post arbitrary data directly via HTTP. If you can provide server side validation which gives just as smooth a user ...


Only top voted, non community-wiki answers of a minimum length are eligible