|
Ravi Bhavnani wrote: I'm currently in a passionate relationship with Android and expect this to continue for several years.
Very smart. I like Android development a lot. Probably my favorite platform right now because it reminds me of Windows dev in the earlier years. Just seems like a lot more fun.
iOS has a lot of crappy stuff and Xcode (IDE) is annoying and I realy don't like the UI layout designer because it is so confusing. In Android you can get right down into the XML and the XML makes sense and is easy to deal with (which I think is rare). iOS Ui and interactions are a pain to deal with. I feel like I"m going to move something and mess up the whole layout.
|
|
|
|
|
I think with Swift and future tooling, iOS development will evolve to be like how Android is today. I think the reason why iOS development is a bit fragmented today is because it has deep roots in the legacy NextStep OS, much like early Win32 development was because it had its roots in MS-DOS (on which Windows was layered). Today, I rely on the .NET framework and Windows Forms to insulate me from Win32 APIs.
Another reason I chose to start mobile development with Android is because I get to use my favorite language (C#) and IDE (VS) to build native Android apps using Xamarin. I have a lot of well-tested, production code in C# that I would have to rewrite (and retest) in Java. Using the native Android API from C# is a joyous experience. The downside is VS doesn't gibe you the free Firebase tooling that Android Studio. But I'm still crawling, and have a way to go before I use Firebase.
/ravi
|
|
|
|
|
If you want to see some very readble, but nasty code, you should try Cobol or better yet, SNOBOL.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Have just been asked to take over support for a live website. It's a mix of Classic ASP and ASP.Net. It runs on Windows Server 2003, .Net Framework 1.1, on a box running in the client's office. The business depends on the application.
Because there's a mix of classic and .Net, and the login authentication is done in Classic with a login token stored in the Classic Session object, login status is inaccessible to the .Net pages. So you can just enter the URL of a .net page and you get full access to everything. Neat!
The .ASPX pages are written exactly as Classic ASP; no code-behind, absolutely no separation of UI and business logic. HTML interspersed with VB.Net. Variables are defined without any type in most cases. There is no concept of objects and absolutely no code re-use (e.g. most pages can send emails, and there's all the code needed to setup an SMTP client on every page). Some pages connect to the database using ODBC and OLEDB concurrently, and the connection strings for each are hard-coded in the pages themselves.
Came across this little snippet just now...
The page has about 20 bound controls, dropdown lists, all setup the same way:
mySelect = "select product_id, name from mytable"
If Request.QueryString("cust_id") <> "0" Then
mySelect = mySelect + " WHERE cust_id=" & Request.QueryString("cust_id")
End If
mySelect = mySelect + " order by name"
myDBCommand = New OleDbCommand(mySelect, myConnection)
myDBReader = myDBCommand.ExecuteReader()
lstBox1.DataSource = myDBReader
lstBox1.DataTextField = "name"
lstBox1.DataValueField = "product_id"
lstBox1.DataBind()
myDBReader.Close()
myDBReader = myDBCommand.ExecuteReader()
iLoop = 0
Do While myDBReader.Read And iLoop < 10000
If product_id = myDBReader("product_id") Then
lstBox1.SelectedIndex = iLoop
iLoop = 10000
End If
iLoop = iLoop + 1
Loop
myDBReader.Close()
I don't know what I like least about this. The lack of validation of the querystring parameter; the concatenation of the query string into the SQL statement (ripe for SQL injection); the re-opening (i.e. re-execution) of the data reader; the looping through all the rows to match the existing value; the arbitrary limit of 10000 on the loop; the setting of the loop counter to 10000 rather than 9998 to exit the loop ... almost every line makes my head hurt.
There's hundreds of pages written like this. Of which about 10% are actually used; the remainder are "old" versions of pages, but not named consistently and some referenced from live pages so I can't just go through and delete irrelevant stuff.
I'm advising the client that a total rewrite is very urgently needed, but in the meantime there are functional changes required and this stuff has to be edited!
|
|
|
|
|
Sometimes code is the equivalent of a train wreck.
What you have there is more like a jumbo jet crashing into the titanic which is sent hurtling into a train.
Well, thank goodness there are probably lots of global variables in there that will help you code this up right.
Good luck!
|
|
|
|
|
|
smoke and a few pops? Suggest Office Space - Printer Scene (UNCENSORED) - YouTube[^]
Now that scene was in California, so we could go to other extremes....
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
What a waste of good deodorant!
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Bet you could use some (being the hard worker that you are )
|
|
|
|
|
I say we take off and nuke the entire site from orbit. It's the only way to be sure.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You'll need it.
cheers
Chris Maunder
|
|
|
|
|
Been there, done that, found a different job.
|
|
|
|
|
Sounds like there is a big goodies bag at the end if you fix this!
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
If only. I quoted my (very cheap) hourly rate and the customer was obviously taken aback... "But I've been so used to paying £40/hour for years..." I used to charge clients £40/hour... in 1996.
Peanuts and monkeys come to mind
Trouble is I like a challenge, am semi-retired so this is really like a paid hobby, and his offices are fabulous (an old English stately home, complete with wood panelling and huge portraits on the wall) so site visits are interesting! He has now agreed a rewrite is in order (once the initial fire fighting is over) so there's a good few months' work in it.
|
|
|
|
|
As long as it doesn't happen to you... Dilbert Comic Strip on 2013-02-24 | Dilbert by Scott Adams[^]
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
I envy you not.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
Poking around, MS doesn't want you to use GetSaveFileName anymore. Instead, they want you to use the 'Common Item Dialog'. So click on that page, and find a function with 11 indentation levels! Copy and paste it, to find that it is part of a sample code, and relies on other functions in that sample. Try to download the sample, and the page isn't found. But you can download an SDK which supposedly contains the sample? Try to run it, though, and you will get a 'Some components cannot be installed' error, and no indication that the samples are included in it. Oh MS, you funny!
All this because I was trying to figure out a way to allow the user to save program configuration files in the user app work directory, and regular files wherever they wish, but MS, in their infinite non-wisdom, won't allow the directory to be changed using GetSaveFileName , because they believe you will only ever be dealing with one type of file for your application.
(Of course, they have the same issue in MS Word, and other Office programs, because they store config files like macros in a special subdirectory until the user changes where they store them. Afterwards, the dialog will default to that special directory until after you change it once. At least that was the case the last time I played with macros in Word.) Double-
|
|
|
|
|
This is why I use .NET
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
In .NET, can you create a program where the save file dialog will default to the user's AppData folder for files like .ini files, and then back to the user's regular folders for their regular files? (I doubt you can, because I think this is a limitation of MS believing they know better than us how programs should work, and overriding their dialogs to disable such use.) If I'm wrong, I'm not going to rewrite, but would be interested to know.
|
|
|
|
|
|
Interesting. Thanks for the knowledge!
|
|
|
|
|
That's correct, you can not save app.config settings in the application directory with C#.
I have a simple fix which allows this using file based search and replace, if you want I can send you some code, just let me know
|
|
|
|
|
Please do, and I'll see if I can pound it into C++.
|
|
|
|
|
I will post it tomorrow, as I don't have the source code at home
|
|
|
|