red dragon + elephant = +22 moral?

Discuss anything related to warbarons.

Re: red dragon + elephant = +22 moral?

Postby KGB » Thu Sep 25, 2014 9:50 pm

I work for an Energy Technologies company that mostly supplies the Oil and Gas industry both on and offshore. Some of our offshore stuff is in exploration/cable laying and not Oil and Gas related.

Most of this year has been spent doing a website for our customer base. A company we contracted started the development since we didn't have the time or expertise. The idea was we would take over their development. Unfortunately it was a disaster as they we using obsolete web technologies from a few years ago rather than the latest stuff. Plus they don't appear to have known squat about security because all their data entry fields were susceptible to SQL injection attacks :(

Long story short, we ended up rewriting most of it ourselves and learning the latest technologies on the fly. The back end is a load balancing server farm running SQL. There are some stored procedures in the database (which we are working to gradually eliminate because it's hard to version control that stuff) but otherwise on the server side it's a lot of C# code to handle client requests to the database and return data in json format (I do very little on that side of things). On the browser side of things we are using HTML5/Javascript/jquery with Knockout. Knockout especially has been a godsend to us to not only speed development but to also handle doing quasi live updates on our browser pages (our live view of drilling data updates at once a second. Ie Rigs around the world upload data to our servers and clients can view that from their desk/phone/tablet etc).

The last few months we've started on a mobile/tablet app. Due to time constraints (ie we are behind due to redoing the website) the first apps for Android/iPhone aren't native, but are rather just HTML5/JS in a browser that's been skinned down (ie no browser buttons so it looks like an app). That meant all our development for the desktop came right away and we only had to do a small amount of specialized code for mobile/tablet. Eventually we'll replace that with native apps for speed and access to more advanced graphics etc.

KGB
KGB
 
Posts: 3028
Joined: Tue Feb 16, 2010 12:06 am

Re: red dragon + elephant = +22 moral?

Postby piranha » Fri Sep 26, 2014 6:12 am

Cool, we are doing the same things then :-). Are you more focused on frontend, backend or both?
I prefer to build sites as apps like you do where the server is just sending json. Warbarons is the first time I do that, but now more and more sites are built that way. Our community part of warbarons is rendered on the server like the old days and then sent to the client which is why I have to rewrite it for mobile and tablet. It's the same otherwise as you, a browser without any buttons. We use PhoneGap which gives you access to the mobile/tablet hardware through a API that you otherwise need to have a native app for but we aren't using that except for detecting when the app is getting focus after being in the background for a while.

Take a look at famo.us, it's using transform3D to take advantage of the GPU which should make it possible to get not too far from native performance when it comes to rendering graphics.

Normal work for me these days is on a site called Blocket owned by Schibsted, it's similar to eBay but there is no auction just fixed prices. Its the second largest site here in Sweden. They have expanded in a lot of countries and are basically racing against a couple of other international players (such as eBay) in the classified media business to take as many markets as possible.
Focus there is however to support old browsers and progress slow so as a developer it's not the most interesting place to work if you are interested in the latest.
User avatar
piranha
Site Admin
 
Posts: 1185
Joined: Fri Feb 12, 2010 9:44 pm

Re: red dragon + elephant = +22 moral?

Postby KGB » Fri Sep 26, 2014 5:17 pm

I'm pretty much all on the front end. I know practically nothing about databases as my background is real-time/embedded in C/C++. I know C# from helping with a GUI we did for one of our PC applications. That's how I ended up contributing a few C# routines for the server side of things that weren't related to DB queries (It's how I know we have C# running on the server and how I know about the stored procedures in the DB because they frustrated me to no end because you can't debug that in Visual Studio like you can the C# server code). I learned HTML5/JS on the fly as part of the take over of the front end website development.

The MVVM (model view - view model) pattern is fantastic. The separation of data/business logic from the GUI front end is one of the most important developments in computer science in the last 10 years. Once you use it once and see the benefits you are hooked and won't want to develop any other way. So I am not surprised you are a big fan.

I'm the system architect here and myself and another guy spent a lot of time setting up the separation of data from the GUI when we redeveloped our website. That proved insanely valuable when we had to do the mobile app on short notice. In fact our original PC application is about to be overhauled (it's 9 years old now) and I'm already laying out the the architecture. The plan is to use what we have for the website (database serving json) for the PC application that's written in C++/C# so that we have one common back end and GUI's on multiple platforms (PC-C#, browser-javascript, mobile-native).

Not sure if we are using PhoneGap or not to tell when our app is minimized. I'll have to ask the guy who did that part of the code. I'll definitely take a look at famo.us because it would be really nice to take advantage of the GPU whenever possible esp on older/slower phones.

Sorry to hear your day job is working on older browsers. Exactly how old? Are you not allowed to use HTML5? It seems a waste to develop for browers that are ever more obsolete every day on PC's that are always being replaced by newer ones. You would think they'd want a modern solution to move forward with and then have a stripped down version for customers with older hardware along with a notice to move to newer browser versions for better site experience!

KGB
KGB
 
Posts: 3028
Joined: Tue Feb 16, 2010 12:06 am

Re: red dragon + elephant = +22 moral?

Postby piranha » Fri Sep 26, 2014 6:42 pm

I would have guessed you were doing backend stuff, I always got the impression that you are interested and good at logic problems which usually is done in the back.
What kind of work have you been doing in real-time c/c++ ? Anything with games?

When I started 1.5 years ago we supported IE7, a few days back we decided to drop support for IE8 so it's much better now in that sense. The problem is the entire system was developed by backend people and they built a language of their own to handle the high load on the servers which is fast but very unpleasant to work with. We are kind of stuck with that system now and the people who have been there for many years have learned to like the system since they know it and don't know much about other modern systems. Whatever I'm doing it takes 4-8 times as much time compared if I work on my own but the company is doing fantastic so they aren't very eager to change things.
We used a few HTML5 features for non critical things. Small steps are taken to start using more recent technologies on the frontend, but since all pages are rendered on the back and then just manipulated by javascript and not separated you are still stuck.
User avatar
piranha
Site Admin
 
Posts: 1185
Joined: Fri Feb 12, 2010 9:44 pm

Re: red dragon + elephant = +22 moral?

Postby KGB » Fri Sep 26, 2014 11:37 pm

Maybe there is a little confusion when we are talking about front/back end.

We have 4 pieces to our products
1) QNX real time O/S on embedded boards that do low level real time control loops and real time stuff.
2) Windows PC's that provide GUI front ends for the user to monitor and control #1 and upload data over satellite to #3.
3) Webserver's storing data uploaded by #2.
4) GUI front ends for viewing data on the Webservers.

#1/#2 reside on the customer site (Rigs, Ships, Drilling platforms etc). There is normally is 2 #1's and 2 or more #2's.
#3 resides someplace (I have no idea where it physically is).
#4 resides on customer desktops/phones/tablets where ever they are in the world. There are an unknown number of these.

I was the system architect who designed the #1/#2 system. I wrote 95% of the code for #1 all in C/C++. I helped with the C# part of #2 in terms of doing all the communication with #1. The core business logic in our system resides in #1 since #2 is Windows which isn't reliable enough for control of hardware. So if you consider #1 back end, then yeah I did back end stuff though I usually call it embedded business logic.

#3/#4 is what we have taken over in the last year. I did a few of the back end business logic routines on the server and because I was interested in HTML5/JS, I did some Knockout/JS GUI work which was a fun change of pace for me. But really on #3/#4 it was all front end stuff (GUI) in JS/HTML5.

Games wise the last big thing I did was the Warlords IV patches from the original C++ source code I got from Steve when I signed an NDA for it. Working on the multi-player aspect of that taught me a lot about how multi-player games work. That's why I can guess a lot of what you must be writing when solving issues on Warbarons. I also got involved with the open source Colossus game (it's in Java, based on the board game Titan). Some on the AI development and some on the multi-player aspects since the games are similar (turn based).


Now that you have dropped IE7 and IE8, you can technically support HTML 5 :) As much as I love Win XP, the fact there are so many machines out there still running it is holding up HTML 5 since IE for XP doesn't support it so you have to have Firefox/Chrome on XP. Maybe we'll get there in another year or two!

Doesn't the company understand that the fact they are rendering on the server is the reason the loads are so high? The more customers you have, the worse it gets and the more you are forever adding servers trying to keep up. They are really handicapping themselves by doing things that way and eventually they will have to address it.

KGB
KGB
 
Posts: 3028
Joined: Tue Feb 16, 2010 12:06 am

Re: red dragon + elephant = +22 moral?

Postby Chazar » Wed Oct 08, 2014 11:40 am

Now that we have experienced people from industry talking here, what is your opinion on treating Javascript like the assembler of browsers, rather than programming in it directly?

My original question that derailed this thread aimed at a mistake that my students often do: they duplicate code having the same purpose between server and client rather than having one shared piece of code, suffering then from both versions diverging over time and having trouble maintaining both. So this is something that I preach against in my lectures.

Now web development is quite outside my field of expertise, but I do understand that the code duplication (here for computing the stack bonuses) is necessary since you do not want to run Javascript on the server. However, I believe there already exist solutions that use a common language for the development that are then compiled to different languages for client and server, i.e. javascript being the compiler's output for the client.

Why are such approaches not used in industry?
Are such approaches even considered at all?
Chazar
 
Posts: 670
Joined: Tue Feb 28, 2012 7:51 pm

Re: red dragon + elephant = +22 moral?

Postby KGB » Wed Oct 08, 2014 4:49 pm

I am sure some companies may do as you suggest. We aren't one of them.

I don't know if the solution you mention (a common language that compiles to other languages exists). I'm not sure how it could other than for some *very* simple code.

For example Javascript is single threaded (therefore has no concept of mutexes, semaphores etc). It also lacks type checking (something that endlessly frustrated me during development when mistyping a variable name goes undetected because javascript just creates a new variable) and some other features that more robust languages have. Lastly of course Javascript is slow because it's interpreted rather than compiled.

Most of our server code for example is in C# because it can do multi-threading and compiles to provide very fast execution times.

The problem with trying to derive code for C# and Javascript from some common language would be how to get the best features of both languages when they don't provide the same functionality. You'd end up having to dumb down what was produced for C# and Javascript so that you didn't get the best of either language. This is essentially what Java was created for.

Also what would you do about differences in libraries (for example newer languages often provide a built in library to handle JSON data with a single function call while older languages like C require you to entirely write your own or find an open source library that may not duplicate exactly what the library in another language does)?

KGB
KGB
 
Posts: 3028
Joined: Tue Feb 16, 2010 12:06 am

Re: red dragon + elephant = +22 moral?

Postby Moonknight » Wed Oct 08, 2014 5:01 pm

BORING!!!!! Let's fight!
Moonknight
 
Posts: 784
Joined: Tue Dec 07, 2010 2:57 am

Re: red dragon + elephant = +22 moral?

Postby piranha » Wed Oct 08, 2014 7:42 pm

KGB:
I was thinking of #3 and #4 that has to do with web development and that you would be doing more #3 than #4. But #1 and #2 is even more about logic so my guess wasn't that bad :-).

There are several typed languages that compile to JavaScript. Google is developing one called DART that can run native in chrome browsers and also be converted to JavaScript. Microsoft have another one called TypeScript. I haven't tried them myself but read quite a lot and I think you can do anything, not just small simple things. I'm not sure that you could run them on a server.
But if you go with nodeJS you can run javascript both on the back and the front and perhaps avoid some of the duplicate code that we have to write with php on the back.

I guess a lot of JavaScript developers come from the web world where PHP is big and it un typed so many are used to un typed languages. Whats wrong with some anarchy and freedom :mrgreen: .

I'm not that great at writing code the right way. When we started on Warbarons we had only worked on code together and are completely self taught, never on another company. Since I started working as a programmer on other companies I realised that I suck :-D, or at least there are some people who are very good. Taking advantage of clever ways of structuring code is something I try to learn as much as possible now but I'm mainly interested in the creative process of doing something fun.

Chazar what languages do you teach?
User avatar
piranha
Site Admin
 
Posts: 1185
Joined: Fri Feb 12, 2010 9:44 pm

Re: red dragon + elephant = +22 moral?

Postby Chazar » Thu Oct 09, 2014 7:25 am

piranha wrote:I guess a lot of JavaScript developers come from the web world where PHP is big and it un typed so many are used to un typed languages. Whats wrong with some anarchy and freedom :mrgreen: .
...
Chazar what languages do you teach?

Type systems are a big part of my research, so programming in untyped languages is my idea of hell. :shock:

I understand that one can relish the anarchy and freedom offered by untyped languages. It's a mighty tool. As such, it allows one to do mighty things easily; and just as easily it allows to shoot oneself mightily in the own foot, too. I guess it works well for small teams of excellent programmers, but most programmers are not excellent (they are average by definition, duh) and the larger and long-lived a project gets, the more it benefits from a language that enforces safety and clarity.

So my choices are strongly-typed functional languages like Haskell, OCaml and F# (compiler backends to compile into Javascript are also emerging for these languages nowadays, but I have not yet tried those), but I am often forced to teach plain Java.
Chazar
 
Posts: 670
Joined: Tue Feb 28, 2012 7:51 pm

PreviousNext

Return to Game discussion

Who is online

Users browsing this forum: No registered users and 13 guests

Not able to open ./cache/data_global.php